Revit二次开发 自带的钢筋

编程入门 行业动态 更新时间:2024-10-24 06:26:38

Revit二次开发 <a href=https://www.elefans.com/category/jswz/34/1769640.html style=自带的钢筋"/>

Revit二次开发 自带的钢筋

这里以Revit的自带的钢筋功能为例(非Revit自带的钢筋功能见我的优酷自频道==?spm=a2hzp.8244740.0.0)
具体步骤:

1)进行开发之前,要把钢筋导入到Revit里面。

2)如果钢筋族的形状不够项目用的话,可以自己做钢筋族

3)了解Revit的钢筋的功能(=5&fps=1  Revit钢筋api的翻译)


这里以一个螺旋箍筋为例:

/// <summary>
        /// 创建螺旋箍筋
        /// </summary>
        /// <param name="revitDoc"></param>
        /// <param name="rebarShape"></param>
        /// <param name="barType"></param>
        /// <param name="host"></param>
        /// <param name="locationPoint"></param>
        /// <param name="luoju"></param>
        /// <param name="lx_height"></param>
        /// <param name="lx_r"></param>
        public void CreatLXRebar(Document revitDoc,RebarBarType barType,Element host,XYZ locationPoint,double luoju,double lx_height,double lx_r)
        {
            RebarShape rebarShape=null;
            foreach (var item in TempRebarType<Element>.ListRebarShape)
            {
                if(item.Name=="53")
                {
                    rebarShape = item as RebarShape;
                }
            }
           
            Rebar rebar = Rebar.CreateFromRebarShape(revitDoc, rebarShape, barType, host, locationPoint, new XYZ(lx_r*2, 0, 0), new XYZ(0, lx_r*2, 0));
            rebar.ScaleToBoxFor3D(locationPoint, new XYZ(lx_r*2, 0, 0), new XYZ(0, lx_r*2, 0), lx_height);
            IList<Parameter> listParameters = rebar.GetParameters("螺距");
            listParameters[0].Set(luoju );
            IList<Parameter> listParameters2 = rebar.GetParameters("顶部面层匝数");
            listParameters2[0].Set(0);
            IList<Parameter> listParameters3 = rebar.GetParameters("底部面层匝数");
            listParameters3[0].Set(0);
            IList<Parameter> listParameters4 = rebar.GetParameters("高度");
            listParameters4[0].Set(lx_height );
            IList<Parameter> listParameters5 = rebar.GetParameters("R");
            listParameters5[0].Set(lx_r );
        }


其中53是指53号钢筋。


联合我自频道的介绍的钢筋方法,最后可以做到一键生成一个桩。


更多推荐

Revit二次开发 自带的钢筋

本文发布于:2024-02-08 22:01:08,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1675553.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:自带   钢筋   Revit

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!