ARTICLE DETAIL

建站实战干货

来自一线的建站与推广经验沉淀,每一条都经过真实交付验证。

revit api创建参考平面

2026/8/7 11:45:36 拓冰建站 浏览量
revit api创建参考平面

revit api创建参考平面

public void CreatReferencePlane()
{
   Document doc = this.ActiveUIDocument.Document;    
   if(!doc.IsFamilyDocument)
      return;
            
   using(Transaction transaction = new Transaction(doc, "Editing Family"))
   {
      transaction.Start();
      XYZ bubbleEnd = new XYZ(0,5,5);
      XYZ freeEnd = new XYZ(5, 5, 5);
      XYZ cutVector = XYZ.BasisY;
      View view = doc.ActiveView;
      ReferencePlane referencePlane = doc.FamilyCreate.NewReferencePlane(bubbleEnd, freeEnd, cutVector, view);
      referencePlane.Name = "MyReferencePlane";
      transaction.Commit();                
   }
}