任意形状下的钢筋容器——High
Show how to create a Rebar Container in a concrete element (Beam or Column) which does not currently host reinforcement.
如何给目前不含钢筋的混凝土图元(梁或柱)创建一个钢筋容器
1、创建容器
//create Rebar Container
ElementId conTypeId = RebarContainerType.CreateDefaultRebarContainerType(m_revitDoc);
RebarContainer cont = RebarContainer.Create(m_revitDoc, m_hostObject, conTypeId);
2、添加钢筋
protected RebarContainerItem PlaceContainerItem(
RebarContainer cont,
RebarBarType rebarType,
RebarHookType startHook,
RebarHookType endHook,
RebarGeometry geomInfo,
RebarHookOrientation startOrient,
RebarHookOrientation endOrient)
{
// the direction of reinforcement distribution 法线方向
Autodesk.Revit.DB.XYZ normal = geomInfo.Normal;
// the shape of the reinforcement curves 钢筋的曲线
IList<Curve> curves = geomInfo.Curves;
// 从RebarContainer中添加曲线钢筋
RebarContainerItem item = cont.AppendItemFromCurves(RebarStyle.Standard, rebarType, startHook, endHook, normal, curves, startOrient, endOrient, false, true);
if (2 < geomInfo.RebarNumber && 0 < geomInfo.RebarSpacing)
{
item.SetLayoutAsNumberWithSpacing(geomInfo.RebarNumber, geomInfo.RebarSpacing, true, true, true);
}
return item;
}
区别:可以直接添加钢筋进钢筋容器
例子可以参考:Reinforcement–Revit钢筋创建
BIM树洞
做一个静谧的树洞君
用建筑的语言描述IT事物;
用IT的思维解决建筑问题;
共建BIM桥梁,聚合团队。
本学习分享资料不得用于商业用途,仅做学习交流!!如有侵权立即删除!!
-
微信公众号: BIM树洞
-
知乎专栏:BIM树洞
-
气氛组博客:http://www.31bim.com
-
BIM应用及咨询,CAD,Revit, OpenGL,图形开发交流,加Q群1083064224