Message 1 of 7
No prompt for origin construction plane?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hey guys, super new to writing scripts/add-ins!
I've created SelectionCommandInput to choose which plane to sketch stuff on. I'd like to show the origin construction planes, but can't seem to figure it out.
I can choose a default construction plane just fine:
# Construction pane selection
construction_plane_input = inputs.addSelectionInput('plane', 'Construction Plane', 'Select a Construction Plane')
construction_plane_input.addSelectionFilter(adsk.core.SelectionCommandInput.ConstructionPlanes)
construction_plane_input.addSelection(design.rootComponent.xYConstructionPlane)
I'd like to show the origin planes (XY, XZ, YZ) as options similar to creating a new sketch. Something like this:
I started going down this path, but this doesn't work at all.
def input_changed_handler(args: adsk.core.InputChangedEventArgs):
# Show construction plane input as necessary
if args.input.id == 'plane_input':
plane_input: adsk.core.SelectionCommandInput = args.inputs.itemById('plane_input')
design = adsk.fusion.Design.cast(app.activeProduct)
root = design.rootComponent
# Show construction plane picker
# THIS DID NOT WORK
if not plane_input.selectionCount:
input: adsk.fusion.ConstructionPlaneInput = root.constructionPlanes.createInput(design.activeOccurrence)
root.constructionPlanes.add(input)
Any help at all would be greatly appreciated!
Thanks!