给我一段revit生成柱子的C#代码
时间: 2023-03-12 11:58:22 浏览: 141
C++代替C#对revit编程,读取revit中的dwg信息
在Revit中,可以使用以下代码来生成柱子:Document doc = uidoc.Document;FamilySymbol columnSymbol = new FilteredElementCollector(doc) .OfClass(typeof(FamilySymbol)) .WhereElementIsElementType() .Cast<FamilySymbol>() .FirstOrDefault(s => s.Family.Name == "Column");// Create the columnLocationPoint point = new XYZ(0, 0, 0);Level level = new FilteredElementCollector(doc).OfClass(typeof(Level)).Cast<Level>().FirstOrDefault(l => l.Name == "Level 1");if (columnSymbol != null) {FamilyInstance column = doc.Create.NewFamilyInstance(point, columnSymbol, level, StructuralType.NonStructural);}
阅读全文