Hi Leon.Vladimirov.
I don't know how to access the controls.
But there is a way to execute the command.
I tried and it was possible to start rendering.
#Fusion360API Python script
#Author-kantoku
#Description-sample start rendering
import adsk.core, adsk.fusion, traceback
def run(context):
ui = None
try:
app :adsk.core.Application = adsk.core.Application.get()
ui :adsk.core.UserInterface = app.userInterface
# new document
desType = adsk.core.DocumentTypes.FusionDesignDocumentType
app.documents.add(desType)
des :adsk.fusion.Design = app.activeProduct
root :adsk.fusion.Component = des.rootComponent
# create body
createBody(root)
# change workspace
des.workspaces.itemById('FusionRenderEnvironment').activate()
# start rendering
cmdDefs :adsk.core.CommandDefinitions = ui.commandDefinitions
cmdDef :adsk.core.CommandDefinition = cmdDefs.itemById('InCanvasRenderCommand')
cmdDef.execute()
except:
if ui:
ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))
def createBody(
comp :adsk.fusion.Component):
skts = comp.sketches
skt = skts.add(comp.xZConstructionPlane)
ctr = adsk.core.Point3D.create(0, 0, 0)
skt.sketchCurves.sketchCircles.addByCenterRadius(ctr, 5.0)
prof = skt.profiles.item(0)
exts = comp.features.extrudeFeatures
newBodyOpe = adsk.fusion.FeatureOperations.NewBodyFeatureOperation
ext = exts.createInput(prof, newBodyOpe)
dist = adsk.core.ValueInput.createByReal(5)
ext.setDistanceExtent(True, dist)
exts.add(ext)