Hi there.
I am very interested in the "Application.executeTextCommand" method implemented in Ver2.0.8335.
https://help.autodesk.com/view/fusion360/ENU/?guid=GUID-4DA98A57-C8E0-479E-B2FF-EB3C10BAE13F
I created a script like this to test a simple process.
#Fusion360API Python script
import adsk.core, adsk.fusion, traceback
def run(context):
ui = None
try:
app = adsk.core.Application.get()
ui = app.userInterface
txtCmd = 'data.property'
res = app.executeTextCommand(txtCmd)
print(res)
except:
if ui:
ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))
Unfortunately, doing so will result in an error.
If you actually enter the text command (txt), the result will be as follows.
Isn't there a sample for correct processing?
Solved! Go to Solution.
Solved by goyals. Go to Solution.
I tried but not able to reproduced it. Not sure if this particular text command is making some network call which failed at the time you tried it through API which results in to failure of text command. Please try with some other text command and see if you are getting the same result. Thanks.
Thank you @goyals .
If you change the language to English, you can execute without problems.
I strongly hope that it will work in Japanese as well.
I happened to be interested in the command text (txt) just before Ver2.0.8335 and tried various things.
I found out that command text is so powerful that you can do things that are not possible with the API.
Append.
This was fine in Japanese as well. It's unstable.
It was an encoding issue.
Even in Japanese, this method worked correctly.
txtCmd = u'data.property'
Can't find what you're looking for? Ask the community or share your knowledge.