2027 Class
Changes 0
C

AdaptiveComponentFamilyUtils

Description:
An interface for Adaptive Component Instances.
Inheritance Hierarchy:
System.Object
  Autodesk.Revit.DB.AdaptiveComponentFamilyUtils
public static class AdaptiveComponentFamilyUtils
private void CreateAdaptiveComponentFamily(Document document)
{
    // check if this family is an Adaptive Component family
    if (!(AdaptiveComponentFamilyUtils.IsAdaptiveComponentFamily(document.OwnerFamily))) return;
    using (Transaction transaction = new Transaction(document))
    {
       int placementCtr = 1;
       ReferencePointArray refPointArray = new ReferencePointArray();
       for (int i = 0; i < 10; i++)
       {
           transaction.SetName("Point" + i);
           transaction.Start();
           ReferencePoint referencePoint = document.FamilyCreate.NewReferencePoint(new XYZ(i, 0, 0));
           if (i % 2 == 0)
           // Even-numbered reference points will be Placement Points
           {
               AdaptiveComponentFamilyUtils.MakeAdaptivePoint(document, referencePoint.Id, AdaptivePointType.PlacementPoint);
               transaction.Commit();
               AdaptiveComponentFamilyUtils.SetPlacementNumber(document, referencePoint.Id, placementCtr);
               placementCtr++;
           }
           else
           // Odd-numbered points will be Shape Handle Points
           {
               AdaptiveComponentFamilyUtils.MakeAdaptivePoint(document, referencePoint.Id, AdaptivePointType.ShapeHandlePoint);
               transaction.Commit();
           }
           refPointArray.Append(referencePoint);
       }
       // Create a curve running through all Reference Points
       if (transaction.GetStatus() == TransactionStatus.Committed)
       {
          transaction.SetName("Curve");
          transaction.Start();
          CurveByPoints curve = document.FamilyCreate.NewCurveByPoints(refPointArray);
          transaction.Commit();
       }
    }
}
Name Return Type Description
M GetNumberOfAdaptivePoints(Family) Int32 Gets number of Adaptive Point Elements in Adaptive Component Family.
M GetNumberOfPlacementPoints(Family) Int32 Gets number of Placement Point Elements in Adaptive Component Family.
M GetNumberOfShapeHandlePoints(Family) Int32 Gets number of Shape Handle Point Elements in Adaptive Component Family.
M GetPlacementNumber(Document, ElementId) Int32 Gets Placement number of an Adaptive Placement Point.
M GetPointConstraintType(Document, ElementId) AdaptivePointConstraintType Gets constrain type of an Adaptive Shape Handle Point.
M GetPointOrientationType(Document, ElementId) AdaptivePointOrientationType Gets orientation type of an Adaptive Placement Point.
M IsAdaptiveComponentFamily(Family) Boolean Verifies if the Family is an Adaptive Component Family.
M IsAdaptivePlacementPoint(Document, ElementId) Boolean Verifies if the Reference Point is an Adaptive Placement Point.
M IsAdaptivePoint(Document, ElementId) Boolean Verifies if the Reference Point is an Adaptive Point.
M IsAdaptiveShapeHandlePoint(Document, ElementId) Boolean Verifies if the Reference Point is an Adaptive Shape Handle Point.
M MakeAdaptivePoint(Document, ElementId, AdaptivePointType) None Makes Reference Point an Adaptive Point or makes an Adaptive Point a Reference Point.
M SetPlacementNumber(Document, ElementId, Int32) None Sets Placement Number of an Adaptive Placement Point.
M SetPointConstraintType(Document, ElementId, AdaptivePointConstraintType) None Sets constrain type of an Adaptive Shape Handle Point.
M SetPointOrientationType(Document, ElementId, AdaptivePointOrientationType) None Sets orientation type of an Adaptive Placement Point.