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函数,获取指定实例的轮廓信息和扫掠线信息。扫掠线就是当前族延申的方向和距离

 

posted @ 2020-05-04 14:52  Min.Xiaoshuang  阅读(1081)  评论(0编辑  收藏  举报