I have bee searching for a way to edit entries in the active sketch instead of creating a new one, finally found a solution that works. Maybe there is a better way.
this is the code i use in the commandExecuteHandler
Solved! Go to Solution.
I have bee searching for a way to edit entries in the active sketch instead of creating a new one, finally found a solution that works. Maybe there is a better way.
this is the code i use in the commandExecuteHandler
Solved! Go to Solution.
Solved by john.kirchner. Go to Solution.
One other way you can do this is to use the app.activeEditObject property - here's the link to its doc reference https://help.autodesk.com/view/fusion360/ENU/?guid=GUID-ac27a7e8-5c75-45de-9218-152844057096
So your script could be reduced to
#first get a reference to the application
app = adsk.core.Application.get()
mySketch = adsk.fusion.Sketch.cast(app.activeEditObject)
# If there is no active sketch, exit the command
if mySketch is None:
ui.messageBox('no sketch')
return
One other way you can do this is to use the app.activeEditObject property - here's the link to its doc reference https://help.autodesk.com/view/fusion360/ENU/?guid=GUID-ac27a7e8-5c75-45de-9218-152844057096
So your script could be reduced to
#first get a reference to the application
app = adsk.core.Application.get()
mySketch = adsk.fusion.Sketch.cast(app.activeEditObject)
# If there is no active sketch, exit the command
if mySketch is None:
ui.messageBox('no sketch')
return
Can't find what you're looking for? Ask the community or share your knowledge.