zoukankan      html  css  js  c++  java
  • Revit二次开发 SweptProfile扫掠轮廓线

    SweptProfile扫掠轮廓线,在Revit二次开发中,我们经常要获取一个拉伸体对象的轮廓信息和方向等信息,特别对于梁和柱子,我们经常可以定义为如下:

     

    一个指定的截面,在指定的方向的延申。那么我们如何获取这个截面和这个界面的延申距离呢,则可以通过FamilyInstance实例的GetSweptProfile函数:

    public void GetProfile(Element element)
    {
        string messageInfo = "Profile : ";
        if (element is FamilyInstance)
        {
            FamilyInstance beam = element as FamilyInstance;
            if (beam.StructuralType == StructuralType.Beam)
            {
                //获取扫掠轮廓线
                Autodesk.Revit.DB.SweptProfile sweptProfile = beam.GetSweptProfile();
                //获取轮廓
                Autodesk.Revit.DB.Profile profile = sweptProfile.GetSweptProfile();
               //获取扫掠线
               Autodesk.Revit.DB.Curve curve= sweptProfile.GetDrivingCurve();
     
            }
        }
    }
    

    以上代码,就是通过GetSweptProfile函数,获取指定实例的轮廓信息和扫掠线信息。扫掠线就是当前族延申的方向和距离

  • 相关阅读:
    一、linux 挂起进程 nohup
    1.C#窗体和控件
    C#笔记——5.迭代器
    C#笔记——4.集合
    设计模式——3.观察者模式
    设计模式——2.策略模式
    Code基础——1.数据结构
    设计模式——1.模板方法
    C#笔记——3.泛型
    C#笔记——2.委托
  • 原文地址:https://www.cnblogs.com/minhost/p/12826564.html
Copyright © 2011-2022 走看看