Revit二次开发-3
程序员文章站
2022-04-02 09:39:31
...
选取元素
{
try
{
UIDocument uidoc = revit.Application.ActiveUIDocument;
Document doc = revit.Application.ActiveUIDocument.Document;
Reference pickedElemRef = uidoc.Selection.PickObject(ObjectType.Element);
Element elem = uidoc.Document.GetElement(pickedElemRef.ElementId);
string info = "所选元素类型为:";
info += "\n\t" + elem.GetType().ToString();
TaskDialog.Show("Revit", info);
}
catch(Exception e)
{
message = e.Message;
return Autodesk.Revit.UI.Result.Failed;
}
return Autodesk.Revit.UI.Result.Succeeded;
}
上一篇: Bailian3728 Blah数集【数学+set】
下一篇: 初识revit二开
推荐阅读