revit二次开发——自适应构件族

来源:建筑界编辑:黄子俊发布时间:2020-03-22 19:39:13

[摘要] 自适应构件族有着强大的功能,在桥梁建模里非常实用。自适应族重要的类:AdaptiveComponentInstanceUtils自适应族实例化:CreateAdaptiv

自适应构件族有着强大的功能,在桥梁建模里非常实用。

自适应族重要的类:AdaptiveComponentInstanceUtils
自适应族实例化:CreateAdaptiveComponentInstance
得到自适应点的ID:GetInstancePlacementPointElementRefIds
自适应点的位置:Position
自适应点和元素关联起来:SetPointElementReference

下面贴一段代码作为例子方便使用。

 bool modelCurveZhu = revitDoc.LoadFamilySymbol(TempFamily.FamilyPath_first, System.IO.Path .GetFileNameWithoutExtension(TempFamily.FamilyPath_first), out familySymbol); //这里的族一定要有类型才行 familySymbol.Activate(); //激活族类型 famIns1 = AdaptiveComponentInstanceUtils.CreateAdaptiveComponentInstance(revitDoc, familySymbol); //自适应族实例化 IList<ElementId> placePointIds = AdaptiveComponentInstanceUtils.GetInstancePlacementPointElementRefIds(famIns1); point = revitDoc.GetElement(placePointIds[0]) as ReferencePoint; //自适应构件族的自适应点 point.Position = modelCurve.GeometryCurve.GetEndPoint(0); PointLocationOnCurve pointLocationOnCurve00 = new PointLocationOnCurve(PointOnCurveMeasurementType.NormalizedCurveParameter, 0, PointOnCurveMeasureFrom.Beginning); PointOnEdge poe00 = revitApp.Create.NewPointOnEdge(modelCurve.GeometryCurve.Reference, pointLocationOnCurve00); /将自适应点和模型线关联起来 point.SetPointElementReference(poe00 as PointElementReference);
构件,自适应,revit

延展阅读

相关文章