BIM网校

revit 里面的family types 参数怎么导出来

2020-09-01 15:10 发布

1条回答
睃猊 BIM小白
1楼 · 2020-09-01 15:48.
可以从WallType类型的Duplicate()方法创建一个墙类型,从FamilySymbol.Duplicate() 方法创建一个窗户类型。 请看下面代码示例创建一个标注样式类型: public class RevitCommand : IExternalCommand { public Result Execute(ExternalCommandData commandData, ref string messages, ElementSet elements) { UIApplication app = commandData.Application; Document doc = app.ActiveUIDocument.Document; //get an exising dimension type. FilteredElementCollector collector = new FilteredElementCollector(doc); collector.OfClass (typeof(DimensionType)); DimensionType dimType = null; foreach(Element elem in collector) { if(elem.Name == "Linear Dimension Style") { dimType = elem as DimensionType ; break; } } DimensionType newType = dimType.Duplicate("NewType"); if(newType != null) { Transaction trans = new Transaction(doc, "ExComm"); trans.Start(); newType.get_Parameter(BuiltInParameter.LINE_PEN).Set(二); //you can change more here. doc.Regenerate(); trans.Commit(); } return Result.Succeeded ; } 转载请注明来源:www.bimsq.com