话不多说,直接代码

 var doc = commandData.Application.ActiveUIDocument.Document;
FilteredElementCollector linkInstances = new FilteredElementCollector(doc); linkInstances = linkInstances.WherePasses(new ElementClassFilter(typeof(RevitLinkInstance))); if (linkInstances != null && linkInstances.Any()) { foreach (RevitLinkInstance linkIns in linkInstances) { Autodesk.Revit.DB.Document linkDoc = linkIns.GetLinkDocument(); if (linkDoc != null) { //选取你想要的构件 } } }

 

posted on 2018-05-29 12:55  airforce094  阅读(989)  评论(0编辑  收藏  举报