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.
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.
Hi Kandennti-San, Mr Axalea_Thomas,
I am not entirely sure, but ... UserInterfaceGeneralEvent Object might give some hope extracting textCommand result.
How .... ???
Regards
MichaelT
@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.
Can't find what you're looking for? Ask the community or share your knowledge.