Dear All,
How to select(highlight) the linked element by elementId?
We can select the current project element by elemnetId.
Thanks
Eden Oo
Selecting is not possible via the Revit API, unfortunately. But it is good that people keep asking this, since it is one of the most annoying missing feature .
Still no solution to this one, we can extract the ID of linked element through dynamo, but not select it.
Hope this feature gets added in next version.
Hi @boris_zivkovic ,
Not sure if this is something similar to what you are looking for:
List<Reference> selectedObjs = new List<Reference>();
selectedObjs = sel.PickObjects(ObjectType.LinkedElement, "Select Linked Elements").ToList();
List<Element> selectedElements = new List<Element>();
foreach (Reference r in selectedObjs)
{
RevitLinkInstance linkInstance = doc.GetElement(r) as RevitLinkInstance;
Document linkedDoc = linkInstance.GetLinkDocument();
selectedElements.Add(linkedDoc.GetElement(r.LinkedElementId));
}
foreach(Element e in selectedElements)
{
do something...
}
This solves a different problem. We want to set the selection set programmatically in linked docs. This is still not possible and probably in the top 10 of every serious developers‘ list of annoying API limitations.
As far as I can tell this is still not possible.
my work around was to:
1- make a list of all the elements I wanted to interact with from the linked document.
2- copy these elements to my host document- using CopyElements
3- do whatever I needed to do with them
4- delete them from my host document.
I know this may seem time consuming, but my list was rather small.
if you have a better method please let me know
Can't find what you're looking for? Ask the community or share your knowledge.