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

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

请先
18G901图集下载,18G901高清版图集百度网盘免费下载
18G901图集下载,18G901高清版图集百度网盘免费下载
8分钟前 有人购买 去瞅瞅看

社交账号快速登录

微信扫一扫关注
扫码关注后会自动登录网站