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: 

Fusion crashes after TextCommand in command dialog's execute method

1 REPLY 1
SOLVED
Reply
Message 1 of 2
0xHexdec
136 Views, 1 Reply

Fusion crashes after TextCommand in command dialog's execute method

Hey all,

I encountered a very strange bug: 

app.executeTextCommand('Commands.Start IntersectionCurve')

This innocent looking line of code crashes fusion every single time it is inside a command definition but works fine if it is outside of such.

 

It is easy to reproduce:

  • Create a new Python Add-In in Fusion, name it whatever you want
  • open the commands/commandDialog/entry.py file
  • choose a line you like, I used line 105, the "Your code here" comment in the command_execute method
  • paste the above command in there
  • run the Add-In
  • click the newly added Button next to the Add-Ins Button, click OK
  • Crash

If you, on the other hand, paste the following code into your <YourCreatedAddInName>.py instead of the run method, the code gets executed as expected.

 

def run(context):
    try:
        commands.start()
        # just to make app available here
        import adsk.core
        app = adsk.core.Application.get()
        # same line as above
        app.executeTextCommand('Commands.Start IntersectionCurve')
    except:
        futil.handle_error('run')

 

Am I missing something here? I can run other textCommands successfully, but not the "intersectionCurve" one.

Is there another option to run the textCommand outside the command dialog environment? more like a Script triggered by the command dialog?

 

Best regards,

Julian

1 REPLY 1
Message 2 of 2
0xHexdec
in reply to: 0xHexdec

Oh well, just seconds later I found this: creating-a-custom-command-dialog-then-running-a-text-command

So it seems like the question is answered...

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

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report