Selecting in Linked Documents
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi everybody,
As it is possible to select in linked documents (Tab-Tab-Tab...) via the GUI, and since Revit can react to such selection changes, I wonder why this is so non-obvious to do via the API. I have two related questions which I try to keep as short as possible:
1) is it possible to select/show elements in linked documents?
I tried out two ideas which unfortunately did not seem to work:
The first one is to instantiate a UIDocument for the linked doc, which seems to be illegal in the API:
var uiDoc = new UIDocument(linkedDoc); // <- not allowed uiDoc.ShowElements(elementId);
var uiDoc = uiApp.ActiveUIDocument; // var element = linkedDoc.GetElement(elementId); // we may need to get the element first uiDoc.ShowElements(element); <- use element here instead of ID
Here, there is no exception thrown, but Revit comes back with the message that it could not find a suitable view.
2) can one obtain the set of selected elements in linked documents?
UIDocument.Selection does not seem to work here, since it is ElementId-based. Moreover, as stated above, the instantiation of linked UIDocuments is prohibited.
Would be great if anyone had some advice! Note: I'm aware that picking elements in linked documents works since 2014 or so. I wrote this in bold because I am not interested in picking and don't want anybody to spend his/her precious time on a picking-related answer. Picking is a totally different story and does not fit the intended workflow.
In case there is no hope in the 2017 edition of the API, would it be possible to request these two crucial features for enhancing user interaction?
Thanks for reading and any comment that may follow! 🙂
Have a good day/weekend!
Christian