- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello, I am having trouble fixing my CAM toolpath avoid surfaces script since the September 2024 update. I have gotten to a point where fusion is not giving me any errors, however upon generating my toolpath the avoid group does not show up at all and the script does essentially nothing.
The main goal of the script is to find vertical faces on a given body by evaluating the face normals and then adding those faces to an avoid group for an exisiting toolpath. I had gotten a script to do this prior to the update, but haven't been able to figure it out since.
Here is the part of the code that introduces the machine avoid group:
verticalWalls = []
surfaceGroupsParam: adsk.cam.CadMachineAvoidGroupsParameterValue = operation.parameters.itemByName('checkSurfaceSelectionSets').value
machineAvoidGroups = surfaceGroupsParam.getMachineAvoidGroups()
machineAvoidGroup: adsk.cam.MachineAvoidDirectSelection = machineAvoidGroups.createNewMachineAvoidDirectSelectionGroup()
machineAvoidGroup.machineMode = adsk.cam.MachiningMode.Avoid_MachiningMode
machineAvoidGroup.radialOffset = .02
machineAvoidGroup.axialOffset = .02
bodyFaces = bRepBody.faces
for face in bodyFaces:
normal = face.evaluator.getNormalAtPoint(face.centroid)
normalZ = round(normal[1].z, 10)
if normalZ == 0:
verticalWalls.append(face)
machineAvoidGroup.inputGeometry = list(verticalWalls)
cam.generateToolpath(operation)
bRepBody is a variable referncing a given body and operation is a variable representing an exisitng toolpath operation.
I would greatly appreciate any insight into my issue. Thank you!
Solved! Go to Solution.