Quantcast
Channel: All Revit API Forum posts
Viewing all articles
Browse latest Browse all 66666

Re: Selecting in Linked Documents

$
0
0

Hi ! 

To Select linked elements I use this :

 

IList<Element> Allelems = new List<Element>();
IList<Element> elems = collector .OfCategory(BuiltInCategory.OST_RvtLinks) .OfClass(typeof(RevitLinkType)).ToElements(); foreach (Element e in elems) { if (e.Name == arc) { Allelems.Add(e); } }
 foreach (Element e in Allelems)
                {
                    RevitLinkType linkType = e as RevitLinkType;
    foreach (Document linkedDoc in CachedUiApp.Application.Documents)
                    {
                        if (linkedDoc.Title.Equals(linkType.Name))
                        {
                            FilteredElementCollector collLinked = new FilteredElementCollector(linkedDoc);
                            IList<Element> linkedWalls = collLinked.OfClass(typeof(Wall)).WherePasses(filter).ToElements();
                            if (linkedWalls.Count != 0)
                            {
                                foreach (Element eleWall in linkedWalls)
                                {
                                    walls.Add(eleWall);
                                }
                            }
                        }
                    }
                }

Here you can Select every walls in linked projects

Hope this help !


Viewing all articles
Browse latest Browse all 66666

Trending Articles