Message 1 of 4
Not applicable
10-05-2015
06:35 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am writing an Extrude like command called FACE (Sheet Metal feature), which takes sketch as input. Following is what I have written, but it does not select the sketch.
class FaceCommandCreatedEventHandlerPanel(adsk.core.CommandCreatedEventHandler):
def __init__(self):
super().__init__()
def notify(self, args):
try:
cmd = args.command
onFaceExecute = FaceCommandExecuteHandler()
cmd.execute.add(onFaceExecute)
onFaceInputChanged = FaceInputChangedHandler()
cmd.inputChanged.add(onFaceInputChanged)
onFaceValidateInput = FaceValidateInputHandler()
cmd.validateInputs.add(onFaceValidateInput)
# keep the handler referenced beyond this function
handlers.append(onFaceExecute)
handlers.append(onFaceInputChanged)
#handlers.append(onFaceValidateInput)
#define the inputs
# Sketch Selection
inputs = cmd.commandInputs
i1 = inputs.addSelectionInput('FaceSketchSelection', 'Sketch', 'Please select an sketch') # 'PlanarSketch'
i1.addSelectionFilter('Sketches');
except:
if ui:
ui.messageBox(('Panel command created failed: {}').format(traceback.format_exc()))
Picture:
What am I missing?
Solved! Go to Solution.