Message 1 of 5
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi, I am creating a 2d pocket operation for my setup and it cause the Fusion 360 crash. I am trying to add selected face (Planar face with id 52) as a pocket selection to the pocket operation.
It crashes on line "pocketSel.inputGeometry = [face]"
The same via UI looks successful.
input = setup.operations.createInput('pocket2d')
input.tool = tool
input.displayName = 'Pocket 2D'
# Get the "pockets" parameter from the operation, which is a CAD Contour 2D.
# The name of the parameter will vary depending on the type of operation.
contourParam: adsk.cam.CadContours2dParameterValue = input.parameters.itemByName('pockets').value
# Get the CurveSelections object from the CAD contour. This
# object manages the list of contour selections.
curveSelections = contourParam.getCurveSelections()
# Create a new pocket selection.
pocketSel: adsk.cam.PocketSelection = curveSelections.createNewPocketSelection()
# Set some properties of pocket contour.
pocketSel.isSelectingSamePlaneFaces = False
# Add the selected face to the face contour.
pocketSel.inputGeometry = [face]
# Apply the curve selection back to the parameter.
contourParam.applyCurveSelections(curveSelections)
op = setup.operations.add(input)
Solved! Go to Solution.