ActiveCommand not working for Tool Library

ActiveCommand not working for Tool Library

Anonymous
481 Views
4 Replies
Message 1 of 5

ActiveCommand not working for Tool Library

Anonymous
Not applicable

Hello,

I am currently writing out to a file whatever the currently active command is.

This seems to work with almost all commands except with the 'tool library' window? 

In which case it just returns the 'SelectComand' instead.

 
app = adsk.core.Application.get()
ui  = app.userInterface 
ActiveCom = ui.activeCommand
 
Is there any other way to know when then Tool Library is opened and closed?
 
Thanks,
Matt
0 Likes
Accepted solutions (1)
482 Views
4 Replies
Replies (4)
Message 2 of 5

kandennti
Mentor
Mentor
Accepted solution

Hi @Anonymous .

 

It can be picked up by using the commandStarting and commandTerminated events of the UserInterface object.

http://help.autodesk.com/view/fusion360/ENU/?guid=GUID-52303e26-c1c2-4a1c-8c1a-a3c199e6db63 


In this add-in, the commandStarting event is used.

https://github.com/kantoku-code/Fusion360_Small_Tools_for_Developers/tree/master/CommandLogger 

1.png

Message 3 of 5

Anonymous
Not applicable

 

Message 4 of 5

Anonymous
Not applicable

@kandennti 

Hi again, I have just discovered a particular case in which opening the tool library doesn't not get picked up by the commandStarting event.

It works fine when the tool library is opened from the ribbon toolbar but not when it is open from with in another command, e.g when selecting a tool from inside any of the tooling operation commands as in the image below.

Is this to do with the fact it is a nested command event? I would appreciate any thoughts you might have!

Thanks,

Matt

Capture.png

0 Likes
Message 5 of 5

kandennti
Mentor
Mentor

I think you're probably right.
I'm sorry, but I don't know how to detect it either.

0 Likes