天天看点

Revit 二次开发创建墙的实例

1创建墙实例的方法一共5个重载 

 (1)Wall.Create(Document document, IList<Curve> profile, bool structural) 

       document :文档

        profile : 生成墙的定位线集合

        structural :是否是结构

 (2)Wall.Create(Document document, Curve curve, ElementId levelId, bool structural)

             document :文档

             curve:定位线

              levelld :标高Id

               structural: 是否是结构

 (3) Wall.Create(Document document, IList<Curve> profile, ElementId wallTypeId, ElementId levelId, bool structural)

              document: 文档

               profile : 生成墙的定位线集合

               wallTypeId:墙类型 WallType的id

                levelId:标高id

                structural: 是否是结构

 (4) Wall.Create(Document document, IList<Curve> profile, ElementId wallTypeId, ElementId levelId, bool structural, XYZ normal)

   document: 文档

    profile : 生成墙的定位线集合

     wallTypeId:墙类型 WallType的id

      levelId:标高id

      structural: 是否是结构

      normal:一个向量 决定墙的内外面

  (5) Wall.Create(Document document, Curve curve, ElementId wallTypeId, ElementId levelId, double height, double offset, bool flip, bool structural)

   document: 文档

    profile : 生成墙的定位线集合

    wallTypeId:墙类型 WallType的id

    levelId:标高id

   height:墙的高度

   offset : 偏移量

   flip :墙的内外

   structural : 是否是结构

2准备需要的参数  

 (1) 得到所有墙类型   List<WallType> allWallTypes = new FilteredElementCollector(this.wrapper.Document).OfClass(typeof(WallType)).Cast<WallType>().Where(x => x.Kind == WallKind.Basic).ToList();

allWallTypes再筛选自己想要的类型

其他的都就比较简单了

继续阅读