Community
Fusion API and Scripts
Got a new add-in to share? Need something specialized to be scripted? Ask questions or share what you’ve discovered with the community.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Text commands result/error code/status

3 REPLIES 3
Reply
Message 1 of 4
axalea_thomas
146 Views, 3 Replies

Text commands result/error code/status

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)
Upcoming: Axalea Notes - Floating notes stored in the timeline
3 REPLIES 3
Message 2 of 4
kandennti
in reply to: axalea_thomas

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.

Message 3 of 4
MichaelT_123
in reply to: kandennti

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
Message 4 of 4

@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)
Upcoming: Axalea Notes - Floating notes stored in the timeline

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

Post to forums  

Autodesk Design & Make Report