Message 1 of 6
Search Element in multiple open document
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have opened multiple documents and have my element id.
What I want to do is to search the ids in the documents. So the api will look which document contains the Id and select.
Currently the below code is working only for single opened document but it return me an error when the selected id does not exist.
Selection selection = uidoc.Selection;
ICollection<ElementId> selectedIds = uidoc.Selection.GetElementIds();
Element el = null;
foreach (ElementId id in selectedIds)
{
el = doc.GetElement(id);
uidoc.ShowElements(e);
}