Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
Showing results for 
Show  only  | Search instead for 
Did you mean: 

"Add Leader" Failure Resolution?

Message 1 of 5
213 Views, 4 Replies

"Add Leader" Failure Resolution?


We create room tags programatically, without leaders. In some cases they eventually move outside the room they were assigned to, so we get a warning:


In the UI, it looks like this:



In the API, it has an equivalent callback that we get via transaction.GetFailureHandlingOptions().SetFailuresPreprocessor() .

The problem is that the only resolution that is available is "Move to Room" (FailureResolutionType.MoveElements), equivalent to what we see in the UI. However, we would like to add a leader instead, but FailureResolutionType.FixElements is not available in this case.


My questions are:

1) Is there a FailureResolutionType that would work in this case?

2) Are we allowed to perform custom transaction operations (such as setting HasLeader=true) in the failure preprocessor?

3) Is there a best-practice way to do this?


Message 2 of 5

Yup, good question, sounds tricky. I asked the development team for you.


Jeremy Tammik, Developer Advocacy and Support, The Building Coder, Autodesk Developer Network, ADN Open
Message 3 of 5
in reply to: noamgatCXBC7

Thank you very much! I don't have access to that slack but I will be very happy to hear about the resolution.

Message 4 of 5
in reply to: noamgatCXBC7

That is a failure of warning severity not an error so you can likely dismiss it without providing a resolution (as can be done in UI in Revit 2022).


After deleting the warning fix the issue how you like.


Incidental in 2023 it seems to not care so much i.e. when moving a tag outside:

For 2022 it adds the leader, shows the warning but loses the value.

For 2023 it adds the leader and keeps the value without any warning.


FailuresAccessor.DeleteWarning (note the failing elements).

Message 5 of 5

A: Adding custom failure resolution types and logic is unfortunately not supported. For a warning, you could use this callback to suppress it and add a followup event to make the change in another transaction...


B: What version of Revit are they using? We recently made improvements in such cases we add the leader automatically (both in UI and API). We no longer show this warning.


C: Yes, Revit 2023.1 or later no longer shows this warning for area\room\space tags. We did preserve the legacy behavior with a Revit.ini option for any customer that prefers it, but automatic tag leaders is the new default (with no warning).


Here is the help link in Whats new in Revit 2023.1:


Jeremy Tammik, Developer Advocacy and Support, The Building Coder, Autodesk Developer Network, ADN Open

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Customer Advisory Groups

Rail Community