current command id in updater

current command id in updater

Anonymous
Not applicable
721 Views
3 Replies
Message 1 of 4

current command id in updater

Anonymous
Not applicable

Any way to determine which Revit command was executed that triggered an updater?  I suppose something along the lines of a context for the updater.

 

for instance, in an updater, I'd like to know that this was triggered because the user pressed the "Remove system" command then I could potentially respond more intelligently.

 

 

0 Likes
Accepted solutions (1)
722 Views
3 Replies
Replies (3)
Message 2 of 4

arnostlobel
Alumni
Alumni
Accepted solution

Ken,

 

it is a request that is practicaly impossible to satisfy. There is no rule or guarantee that a transaction (at which end an updater is invoked) is part of a command at all or that t has any association with the current command. I am afraid you'd get a lot of false positives and if the logic of your app depends on figuring out current commands you will make a lot of wrong conclusions. Take, for example the Idling event - there is not command, yet there can be a lot of transactions committed, and Revit has no idea about the nature of those transaction. In take even a regular events raised during standard commands - even though events are raised during commands it does not mean that handlers of the events are obligated to make changes that are actually related to the command (they should, but they are not obligated.)

Arnošt Löbel
Message 3 of 4

Anonymous
Not applicable
Hi Arnošt,
I don't think I'm terribly surprised. I thought maybe that Revit kept some idea of this but now that you explain it, it's fairly obvious that it would be a fool's errand to try and keep track of.

Thanks for your response. 🙂
0 Likes
Message 4 of 4

Anonymous
Not applicable
I think your best bet would be to carefully craft the updater filters and select specific changetypes to infer more information about the changes and how best to respond.
0 Likes