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

 Revit二次开发  SweptProfile扫掠轮廓线

一个指定的截面,在指定的方向的延申。那么我们如何获取这个截面和这个界面的延申距离呢,则可以通过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函数,获取指定实例的轮廓信息和扫掠线信息。扫掠线就是当前族延申的方向和距离

 

相关文章:

  • 2021-12-26
  • 2021-12-26
  • 2021-05-23
  • 2021-10-03
  • 2021-12-01
  • 2021-03-31
  • 2021-09-22
  • 2021-07-23
猜你喜欢
  • 2022-12-23
  • 2022-01-08
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-18
相关资源
相似解决方案