I'm not sure what your exact workflow is, but here's something to get you started. It turns off the display of all sketches except the active sketch.
def HideSketches(context):
ui = None
try:
app = adsk.core.Application.get()
ui = app.userInterface
if app.activeEditObject.objectType != adsk.fusion.Sketch.classType():
ui.messageBox('A sketch must be active.')
return
# Get the active sketch.
activeSketch: adsk.fusion.Sketch = app.activeEditObject
# If the sketch is in an subassembly, the selection returns a proxy
# relative to the root component. This gets the native sketch in
# it's parent component.
if activeSketch.assemblyContext is not None:
activeSketch = activeSketch.nativeObject
product = app.activeProduct
design = adsk.fusion.Design.cast(product)
# Iterate through all of the components in this document
for comp in design.allComponents:
# Check to see if this component is owned by this design
# and is not an externally referenced component.
if comp.parentDesign == design:
# Iterate through the sketches in this component.
for sk in comp.sketches:
# Check if this sketch is the active sketch.
if sk != activeSketch:
sk.isLightBulbOn = False
except:
if ui:
ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))
---------------------------------------------------------------
Brian EkinsInventor and Fusion 360 API Expert
Website/Blog:
https://EkinsSolutions.com