AdaptiveComponentFamilyUtils Class |
An interface for Adaptive Component Instances.
Inheritance HierarchySystemObject
Autodesk.Revit.DBAdaptiveComponentFamilyUtils
Namespace: Autodesk.Revit.DBAssembly: RevitAPI (in RevitAPI.dll) Version: 27.0.4.0 (27.0.4.0)
Syntaxpublic static class AdaptiveComponentFamilyUtils
Public NotInheritable Class AdaptiveComponentFamilyUtils
public ref class AdaptiveComponentFamilyUtils abstract sealed
[<AbstractClassAttribute>]
[<SealedAttribute>]
type AdaptiveComponentFamilyUtils = class end
The AdaptiveComponentFamilyUtils type exposes the following members.
Methods
Exampleprivate void CreateAdaptiveComponentFamily(Document document)
{
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)
{
AdaptiveComponentFamilyUtils.MakeAdaptivePoint(document, referencePoint.Id, AdaptivePointType.PlacementPoint);
transaction.Commit();
AdaptiveComponentFamilyUtils.SetPlacementNumber(document, referencePoint.Id, placementCtr);
placementCtr++;
}
else
{
AdaptiveComponentFamilyUtils.MakeAdaptivePoint(document, referencePoint.Id, AdaptivePointType.ShapeHandlePoint);
transaction.Commit();
}
refPointArray.Append(referencePoint);
}
if (transaction.GetStatus() == TransactionStatus.Committed)
{
transaction.SetName("Curve");
transaction.Start();
CurveByPoints curve = document.FamilyCreate.NewCurveByPoints(refPointArray);
transaction.Commit();
}
}
}
See Also