BIM World
A Professional BIM Learning Platform


Revit Secondary Development: Creating Adaptive Component Families

The adaptive component family offers powerful features and is highly practical for bridge modeling.

Key classes and methods for working with adaptive families include:

  • AdaptiveElementInstanceUtils
  • Creating an adaptive family instance: CreateAdaptiveComponentInstance
  • Getting the adaptive point IDs: GetInstancePlacementPointElementRefIds
  • Adaptive point position: Position
  • Associating adaptive points with elements: SetPointElementReference

Below is a sample code snippet demonstrating how to use these functionalities:

bool modelCurveLoaded = revitDoc.LoadFamilySymbol(
    TempFamily.FamilyPath_first,
    System.IO.Path.GetFileNameWithoutExtension(TempFamily.FamilyPath_first),
    out familySymbol);  // Load the family symbol

familySymbol.Activate();  // Activate the family type

famIns1 = AdaptiveComponentInstanceUtils.CreateAdaptiveComponentInstance(revitDoc, familySymbol);  // Instantiate adaptive family

IList<ElementId> placePointIds = AdaptiveComponentInstanceUtils.GetInstancePlacementPointElementRefIds(famIns1);

ReferencePoint point = revitDoc.GetElement(placePointIds[0]) as ReferencePoint;  // Get the adaptive point

point.Position = modelCurve.GeometryCurve.GetEndPoint(0);  // Set the adaptive point position

PointLocationOnCurve pointLocationOnCurve00 = new PointLocationOnCurve(
    PointOnCurveMeasurementType.NormalizedCurveParameter, 0, PointOnCurveMeasureFrom.Beginning);

PointOnEdge poe00 = revitApp.Create.NewPointOnEdge(modelCurve.GeometryCurve.Reference, pointLocationOnCurve00);  // Create a point on the model curve

point.SetPointElementReference(poe00 as PointElementReference);  // Associate adaptive point with the model curve
xuebim
Follow the latest BIM developments in the architecture industry, explore innovative building technologies, and discover cutting-edge industry insights.
← Scan with WeChat
Like(0) 打赏
BIM WORLD » Revit Secondary Development: Creating Adaptive Component Families

Comment Get first!

Must log in before commenting!

 

BIM World, A Professional BIM Learning Platform

Stay updated on the latest architecture trends and share new building technologies.

Contact UsAbout Us

觉得文章有用就打赏一下小编吧

非常感谢你的打赏,我们将继续提供更多优质内容,让我们一起创建更加美好的网络世界!

支付宝扫一扫

微信扫一扫

Account Login

By signing in, you agree toUser Agreement

Sign Up