An interface for Adaptive Component Instances.
Inheritance Hierarchy
System.ObjectAutodesk.Revit.DB.AdaptiveComponentFamilyUtils
Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 25.3.0.0 (25.3.0.0)
Syntax
C#
public static class AdaptiveComponentFamilyUtils
The AdaptiveComponentFamilyUtils type exposes the following members.
Methods
Name | Description | |
---|---|---|
![]() ![]() | GetNumberOfAdaptivePoints | Gets number of Adaptive Point Elements in Adaptive Component Family. |
![]() ![]() | GetNumberOfPlacementPoints | Gets number of Placement Point Elements in Adaptive Component Family. |
![]() ![]() | GetNumberOfShapeHandlePoints | Gets number of Shape Handle Point Elements in Adaptive Component Family. |
![]() ![]() | GetPlacementNumber | Gets Placement number of an Adaptive Placement Point. |
![]() ![]() | GetPointConstraintType | Gets constrain type of an Adaptive Shape Handle Point. |
![]() ![]() | GetPointOrientationType | Gets orientation type of an Adaptive Placement Point. |
![]() ![]() | IsAdaptiveComponentFamily | Verifies if the Family is an Adaptive Component Family. |
![]() ![]() | IsAdaptivePlacementPoint | Verifies if the Reference Point is an Adaptive Placement Point. |
![]() ![]() | IsAdaptivePoint | Verifies if the Reference Point is an Adaptive Point. |
![]() ![]() | IsAdaptiveShapeHandlePoint | Verifies if the Reference Point is an Adaptive Shape Handle Point. |
![]() ![]() | MakeAdaptivePoint | Makes Reference Point an Adaptive Point or makes an Adaptive Point a Reference Point. |
![]() ![]() | SetPlacementNumber | Sets Placement Number of an Adaptive Placement Point. |
![]() ![]() | SetPointConstraintType | Sets constrain type of an Adaptive Shape Handle Point. |
![]() ![]() | SetPointOrientationType | Sets orientation type of an Adaptive Placement Point. |
Example
C#
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(); } } }
VB
Private Sub CreateAdaptiveComponentFamily(document As Document) ' check if this family is an Adaptive Component family If Not (AdaptiveComponentFamilyUtils.IsAdaptiveComponentFamily(document.OwnerFamily)) Then Return End If Using transaction As New Transaction(document) Dim placementCtr As Integer = 1 Dim refPointArray As New ReferencePointArray() For i As Integer = 0 To 9 transaction.SetName("Point" & i) transaction.Start() Dim referencePoint As ReferencePoint = document.FamilyCreate.NewReferencePoint(New XYZ(i, 0, 0)) If i Mod 2 = 0 Then ' Even-numbered reference points will be Placement Points AdaptiveComponentFamilyUtils.MakeAdaptivePoint(document, referencePoint.Id, AdaptivePointType.PlacementPoint) transaction.Commit() AdaptiveComponentFamilyUtils.SetPlacementNumber(document, referencePoint.Id, placementCtr) placementCtr += 1 Else ' Odd-numbered points will be Shape Handle Points AdaptiveComponentFamilyUtils.MakeAdaptivePoint(document, referencePoint.Id, AdaptivePointType.ShapeHandlePoint) transaction.Commit() End If refPointArray.Append(referencePoint) Next ' Create a curve running through all Reference Points If transaction.GetStatus() = TransactionStatus.Committed Then transaction.SetName("Curve") transaction.Start() Dim curve As CurveByPoints = document.FamilyCreate.NewCurveByPoints(refPointArray) transaction.Commit() End If End Using End Sub