📜  获取链接元素 revit api - C# 代码示例

📅  最后修改于: 2022-03-11 14:49:20.139000             🧑  作者: Mango

代码示例1
UIApplication uiapp = commandData.Application;
            UIDocument uidoc = uiapp.ActiveUIDocument;
            Application app = uiapp.Application;
            Document doc = uidoc.Document;
            ObjectType obt=ObjectType.LinkedElement;
            Reference refElemLinked;
            Element linkedelement = null;
            
            refElemLinked = uidoc.Selection.PickObject(obt, "Please pick an element in the linked model");
                        RevitLinkInstance elem = doc.GetElement(refElemLinked.ElementId) as RevitLinkInstance;
                        Document docLinked = elem.GetLinkDocument();
                        
                        linkedelement = docLinked.GetElement(refElemLinked.LinkedElementId);