AdaptiveComponentInstanceUtils Class


An interface for Adaptive Component Instances.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 2015.0.0.0 (2015.0.0.0)
Since: 2012

Syntax

C#
public static class AdaptiveComponentInstanceUtils
Visual Basic
Public NotInheritable Class AdaptiveComponentInstanceUtils
Visual C++
public ref class AdaptiveComponentInstanceUtils abstract sealed

Examples

Copy C#
private void CreateAdaptiveComponentInstance(Document document, FamilySymbol symbol)
{
    // Create a new instance of an adaptive component family
    FamilyInstance instance = AdaptiveComponentInstanceUtils.CreateAdaptiveComponentInstance(document, symbol);

    // Get the placement points of this instance
    IList<ElementId> placePointIds = new List<ElementId>();
    placePointIds = AdaptiveComponentInstanceUtils.GetInstancePlacementPointElementRefIds(instance);
    double x = 0;

    // Set the position of each placement point
    foreach (ElementId id in placePointIds)
    {
        ReferencePoint point = document.GetElement(id) as ReferencePoint;
        point.Position = new Autodesk.Revit.DB.XYZ(10*x, 10*Math.Cos(x), 0);
        x += Math.PI/6;
    }
}
Copy VB.NET
Private Sub CreateAdaptiveComponentInstance(document As Document, symbol As FamilySymbol)
    ' Create a new instance of an adaptive component family
    Dim instance As FamilyInstance = AdaptiveComponentInstanceUtils.CreateAdaptiveComponentInstance(document, symbol)

    ' Get the placement points of this instance
    Dim placePointIds As IList(Of ElementId) = New List(Of ElementId)()
    placePointIds = AdaptiveComponentInstanceUtils.GetInstancePlacementPointElementRefIds(instance)
    Dim x As Double = 0

    ' Set the position of each placement point
    For Each id As ElementId In placePointIds
        Dim point As ReferencePoint = TryCast(document.GetElement(id), ReferencePoint)
        point.Position = New Autodesk.Revit.DB.XYZ(10 * x, 10 * Math.Cos(x), 0)
        x += Math.PI / 6
    Next
End Sub

Inheritance Hierarchy

System Object
Autodesk.Revit.DB AdaptiveComponentInstanceUtils

See Also

ArchiLabs

Stop fighting Revit automation.

Build repeatable BIM design and documentation workflows with scripts, data, and AI in one place, without wrestling brittle one-off automations.

Try ArchiLabs →