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

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

自适应族重要的类: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);
0

评论0

请先

没有账号? 注册  忘记密码?

社交账号快速登录

微信扫一扫关注
扫码关注后会自动登录网站
普人特福的博客cnzz&51la for wordpress,cnzz for wordpress,51la for wordpress