Message 1 of 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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
Solved! Go to Solution.