Hi @karl.ri -San.
Since it does not seem to be provided in the API, we created a sample using a TextCommands.
# Fusion360API Python script
import traceback
import adsk.core as core
import adsk.fusion as fusion
def run(context):
ui: core.UserInterface = None
try:
app: core.Application = core.Application.get()
ui = app.userInterface
msg: str = "Select Sketch"
selFilter: str = "Sketches,SketchCurves,SketchLines,SketchCircles,SketchPoints"
sel: core.Selection = select_ent(msg, selFilter)
if not sel:
return
hide_projected_sketch_geometries(sel.entity)
ui.messageBox("Done")
except:
if ui:
ui.messageBox("Failed:\n{}".format(traceback.format_exc()))
def hide_projected_sketch_geometries(
sketchEntity
) -> None:
skt: fusion.Sketch = None
if hasattr(sketchEntity, "parentSketch"):
skt = sketchEntity.parentSketch
else:
skt = sketchEntity
app: core.Application = core.Application.get()
sels: core.Selections= app.userInterface.activeSelections
sels.clear()
sels.add(skt)
app.executeTextCommand(u"Commands.Start HideProjectedGeometries")
sels.clear()
def select_ent(
msg: str,
filter: str
) -> core.Selection:
try:
app: core.Application = core.Application.get()
ui: core.UserInterface = app.userInterface
sel = ui.selectEntity(msg, filter)
return sel
except:
return None