ProcessedCommand Event

ProcessedCommand Event

TK.421
Advisor Advisor
1,392 Views
6 Replies
Message 1 of 7

ProcessedCommand Event

TK.421
Advisor
Advisor

How is this used? I'm looking to capture when my plugin tabs are switched. I thought maybe this would do it but apparently I'm using it incorrectly.

 

comms.EventUtils.Subscribe(new EventSubscription("ProcessedCommand", Process_Command));

and then

      private void Process_Command(string event_name, Dictionary<string, string> event_arguments)
        {
            if (event_arguments["Command"] == "PLUGIN TAB '{8720D785-4D58-47BD-A76D-35DB484B3BD2}:1'")
            {
                // my commands here
            }
        }

 

does anyone know how i can find out when a plugin tab is changed? @rafael.sansao  @5axes  @kukelyk ?

thanks!


the numbers never lie
0 Likes
Accepted solutions (1)
1,393 Views
6 Replies
Replies (6)
Message 2 of 7

peter.lockyer
Autodesk
Autodesk
Accepted solution

I'm sorry, I think this is the one plugin event that was never actually implemented.  If I recall correctly, there were significant concerns that if plugins started to subscribe to this event, PowerMill performance would start to degrade noticeably.



Peter Lockyer

Software Development Manager, Fusion 360 Manufacturing and PowerMill

0 Likes
Message 3 of 7

TK.421
Advisor
Advisor

Nooooooooooooo! i spent so much time on that yesterday, lol!! Thank you for informing me that it does not work, that'll save some headaches!

Do you think that it'll be implemented in the future? I would think that most of us developing plugins would know to roll back our functionality if it started harming the performance of the software...

thanks @peter.lockyer !


the numbers never lie
0 Likes
Message 4 of 7

iroda
Participant
Participant

Awh. Same problem here... I wanted to 'watch' only one command.

0 Likes
Message 5 of 7

krasimir.vasilev
Participant
Participant

it might sounds a bit primitive 😅 is it possible to create a UDP placeholder and set a value when event in your plugin occur? 

0 Likes
Message 6 of 7

iroda
Participant
Participant

@krasimir.vasilev wrote:

...UDP placeholder...


What do you mean? Can you be a bit more specific?


@krasimir.vasilev wrote:

...and set a value when event in your plugin occur? 


It is the other way around: to get a command processed by PowerMill can mark an event in PowerMill, and not in the plugin, so the plugin can act accordingly. Example: user reorders the toolpaths/NC programs in PowerMill Explorer - there is no event for this. So if we can 'watch' for the command 'ORDERSESSION' and its arguments, then the plugin can initiate a necessary action.

0 Likes
Message 7 of 7

Sean571
Advocate
Advocate

You might be able to do something with a WPF event instead. Not sure off the top of my head which one but it could be some event like "has focus" or something  that could flag which tab is being used? ¯\_(ツ)_/¯

Sean Wroblewski
Applications Engineer

0 Likes