Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I would like to clear any & all selections the user may have selected before a script starts.
Brad Bylls
Solved! Go to Solution.
I would like to clear any & all selections the user may have selected before a script starts.
Solved! Go to Solution.
Hi @brad.bylls -San.
Try this.
# Fusion360API Python script
import traceback
import adsk.core as core
def run(context):
ui: core.UserInterface = None
try:
app: core.Application = core.Application.get()
ui = app.userInterface
sels: core.Selections = ui.activeSelections
ui.messageBox(f"Select Count {sels.count}")
sels.clear()
ui.messageBox(f"Select Count {sels.count}")
except:
if ui:
ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))
Thanks @kandennti
sels: core.Selections = ui.activeSelections
sels.clear()
This worked at the start of the Create function