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













Must log in before commenting!
Sign Up