I would simply recreate them, you have the linked model element Id, and the tag (relative) position
From doc: can create a Tag to a linked element https://www.revitapidocs.com/2023/b8e8eec2-8e3b-08f2-a9a5-89f24465c8b9.htm
Thank you alot for your suggestion ,the situation is that inside that link the tag is putten on another linked model, is there a way to get the element id of those link inside link elements ? or anyway to recreate them
Hi @sabra.tarek ,
You can iterate all tags in a linked model and get it's TaggedElementId.
I don't know if it's possible to get the LinkedElementId of a Tagged nested link, as that link doesn't exist in the host document, could be it won't report the linkedElementid?
You would almost have the link itself openend as a model, and then re-create the tags, from reading from the other opened document (with the link that's tagged), in the same Revit session of course.
But you should then be tagging that nested link...or what does need to be tagged.
So you have this structure.
HostModel A
-> LinkeModel B (with tags to C)
-> NestedModel C (linked as overlay or attachement in B?)
Is NestedModel C also directly linked into A?
Ps. For what kind (category) do the tags need to be copied over?
Hi @Sleepingfish_Kuo ,
Use PickObjects methods and use "ObjectType.LinkedElement" as argument.
For ID, would only work if you also have the RevitLinkInstance Id.
Oh, thank you.
But what I want is to let the element be selected in UI, just like
Selection.SetElementIds(elementID);
in API.
I can get the link IDs from Interference check, but no where to use it except opening that link in another revit.
What type of type you want to copy, because an independent tag needs host element, your approach mat not work.
revit will delete the copied tag with you dont get it a host. I have try it before for lightingfixture tag
Well for this the Revit Version comes into play.
In Revit 2024 I think the selection of elements in links is possible, search the web or this forum or the https://www.revitapidocs.com/