Message 1 of 5
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello, I'm trying to make a script that converts single Lines into drilling tool paths including "tool orientation", but unfortunately there is not a lot of information on how the CAM API works within fusion 360. here is what I have so far. After importing the drilling tool path template I can select the points that need to be drilled like this:
inputs = args.command.commandInputs
GuiInputs = getInput(inputs)
DrillLines = GuiInputs[0]
drillBottomPoints = adsk.core.ObjectCollection.create()
for lines in DrillLines:
drillBottomPoints.add(lines.startSketchPoint)
doc = app.activeDocument
products = doc.products
cam = adsk.cam.CAM.cast(products.itemByProductType("CAMProductType"))
templateFilename = "C:\#python\DrillLines\Templates\TestDrill.f3dhsm-template"
results = setup.createFromTemplate(templateFilename)
operation : adsk.cam.Operation = results.item(0)
setups = cam.setups
setup = setups.item(0)
holePoints = operation.parameters.itemByName("holePoints")
val: adsk.cam.CadObjectParameterValue#note the documentation says nothing about this, just found it in the fourms
val = holePoints.value
val._set_value(drillBottomPoints)
#so all that works now I want to set the axis orientation
toolOriantationCheck.expression = "true" # this works enabling tool orientation
#the following 2 fails with RuntimeError: 3 : Invalid enumeration value
#I don't know what it is supposed to be tbh
view_origin_mode.expression = "(view_orientation_mode == 'surfaceNormalZ' || view_orientation_mode == 'surfaceNormalX') ? 'surfacePointOrigin' : 'jobOrigin'"
view_origin_mode.expression = "axesZX"
#after this I still have to select the Z and X-axis orientations, I don't know how to do that too
So Please advise on the above and a link to where the documentation of the parameters is located
Thanks!
Solved! Go to Solution.