Problem with method IndependentTag Create

Problem with method IndependentTag Create

Adamchuk_Nicolay
Enthusiast Enthusiast
1,025 Views
5 Replies
Message 1 of 6

Problem with method IndependentTag Create

Adamchuk_Nicolay
Enthusiast
Enthusiast

Problem with method IndependentTag.Create for element as Rebar - does not work.

Tested on my own code, as well as an example from the library TagBeam.

Command "Tag Beam" is Ok. But command "Tag Rebar" reports an error - "The reference can not be tagged.
Parameter name: referenceToTag".

This situation for version 2023 only.

 

0 Likes
1,026 Views
5 Replies
Replies (5)
Message 2 of 6

caroline.gitonga
Autodesk
Autodesk

Hi @Adamchuk_Nicolay ,

Thank you for bringing this up.

This is noted and reproduced. I will escalate to the Engineering team and will revert with feedback.

Carol Gitonga, Developer Advocacy and Support, ADN Open
0 Likes
Message 3 of 6

Adamchuk_Nicolay
Enthusiast
Enthusiast

Thanks for the quick response.
The same problem exists with other methods like: GetLeaserElbow, GetLeaderEnd and etc.

 
Message 4 of 6

caroline.gitonga
Autodesk
Autodesk

Hi @Adamchuk_Nicolay,

I have got a response from the Dev Team.

Starting with Revit 2023 the tag is placed on individual bars (sub-elements), not on the set (rebar element). So, you need to reference bar x of the set.
The snippet below iterates through all rebar subelements and creates a tag on each.
Rebar rebar; // this is your rebar
IList<Subelement> subelements = rebar.GetSubelements(); // here are the subelements
foreach(var subelement in subelements)
{
IndependentTag tag = IndependentTag.Create(m_rvtDoc, m_view.Id, subelement.GetReference() /*the new reference is to the subelement*/, true, Autodesk.Revit.DB.TagMode.TM_ADDBY_CATEGORY, Autodesk.Revit.DB.TagOrientation.Horizontal, tagPosition);
}

A ticket has been raised to update the TagBeam sdk sample to reflect this new behavior.

You can implement this response and retest your addin and let me know if it works fine. Thank you for noticing this.

Carol Gitonga, Developer Advocacy and Support, ADN Open
Message 5 of 6

Adamchuk_Nicolay
Enthusiast
Enthusiast

Hello.

Thanks for the help and advice.
Everything works well.

Message 6 of 6

caroline.gitonga
Autodesk
Autodesk

Hi @Adamchuk_Nicolay,

Kindly, mark the solution as solved if it worked fine. Thank you

Carol Gitonga, Developer Advocacy and Support, ADN Open
0 Likes