Text commands result/error code/status

Text commands result/error code/status

axalea_thomas
Enthusiast Enthusiast
465 Views
3 Replies
Message 1 of 4

Text commands result/error code/status

axalea_thomas
Enthusiast
Enthusiast

Is it possible to get an exit code or return value from text commands?

 

In various command shells (Powershell, Bash, ..) it is possible to check the exit code after a command has run to programmatically determine if it was successful:

 

cat non-existing-file.txt
echo $?   # Echo the exit code, which will be non-zero

 

Is this possible in Fusion? Either as a text command that can be run or as an API function.

Thomas @ Axalea

My Add-ins (Windows)
⌨️ Toolbar & Shortcuts Editor: Assign any key (and some mouse buttons) as keyboard shortcut!
⤴️ Extra Shortcuts: Assign shortcut to Front, Home view, Look At, Activate Component and more!
My Logo: Put your logo in the Fusion window (for presentations and streaming)
 Axalea Notes - Annotate your model with notes
0 Likes
466 Views
3 Replies
Replies (3)
Message 2 of 4

kandennti
Mentor
Mentor

Hi @axalea_thomas-San.

 

This may not answer your question.

 

You can get the return value of the executeTextCommand method.
This is the same as what is output to the TextCommand palette.
However, we feel that there are many commands that do not output anything to the palette.

 

Unfortunately, I don't know of any way to know if the command succeeded or failed.

0 Likes
Message 3 of 4

MichaelT_123
Advisor
Advisor

Hi Kandennti-San, Mr Axalea_Thomas,

 

I am not entirely sure, but ... UserInterfaceGeneralEvent Object might give some hope extracting textCommand result.

How .... ???

 

Regards

MichaelT

 

 

MichaelT
0 Likes
Message 4 of 4

axalea_thomas
Enthusiast
Enthusiast

@kandennti Thanks, but unfortunately I need a general way to tell if any text command fails.

 

@MichaelT_123 UserInterfaceGeneralEvent seems to be fired when a palette is closed, going by " Accessed From:

Palette.closed, TextCommandPalette.closed" 

at https://help.autodesk.com/view/fusion360/ENU/?guid=GUID-8307C183-CC81-4535-BE44-2FE0B7D238DC

 

This is unfortunately not at all what I'm looking for. 

Thomas @ Axalea

My Add-ins (Windows)
⌨️ Toolbar & Shortcuts Editor: Assign any key (and some mouse buttons) as keyboard shortcut!
⤴️ Extra Shortcuts: Assign shortcut to Front, Home view, Look At, Activate Component and more!
My Logo: Put your logo in the Fusion window (for presentations and streaming)
 Axalea Notes - Annotate your model with notes
0 Likes