[Transaction(TransactionMode.Manual)]
[Regeneration(RegenerationOption.Manual)]
public class cmdGetSysFamilyName : IExternalCommand
{
public Result Execute(ExternalCommandData cmdData, ref string messages, ElementSet elements)
{
UIDocument uiDoc = cmdData.Application.ActiveUIDocument;
Document doc = uiDoc.Document;
Selection sel = uiDoc.Selection;
Transaction ts = new Transaction(uiDoc.Document, " 风管类型 ");
ts.Start();
// 得到风管的系统族名称
Reference refDuct = sel.PickObject(ObjectType.Element, " 风管 ");
Duct duct = doc.GetElement(refDuct) as Duct;
TaskDialog.Show( " duct ", duct.DuctType.get_Parameter(BuiltInParameter.ALL_MODEL_FAMILY_NAME).AsString());
// 得到墙的系统族名称
Wall wall = null;
wall.WallType.get_Parameter(BuiltInParameter.ALL_MODEL_FAMILY_NAME).AsString();
ts.Commit();
return Result.Succeeded;
}
}
[Regeneration(RegenerationOption.Manual)]
public class cmdGetSysFamilyName : IExternalCommand
{
public Result Execute(ExternalCommandData cmdData, ref string messages, ElementSet elements)
{
UIDocument uiDoc = cmdData.Application.ActiveUIDocument;
Document doc = uiDoc.Document;
Selection sel = uiDoc.Selection;
Transaction ts = new Transaction(uiDoc.Document, " 风管类型 ");
ts.Start();
// 得到风管的系统族名称
Reference refDuct = sel.PickObject(ObjectType.Element, " 风管 ");
Duct duct = doc.GetElement(refDuct) as Duct;
TaskDialog.Show( " duct ", duct.DuctType.get_Parameter(BuiltInParameter.ALL_MODEL_FAMILY_NAME).AsString());
// 得到墙的系统族名称
Wall wall = null;
wall.WallType.get_Parameter(BuiltInParameter.ALL_MODEL_FAMILY_NAME).AsString();
ts.Commit();
return Result.Succeeded;
}
}