Modify leads and links after toolpath generation

Modify leads and links after toolpath generation

Adam_Popma
Explorer Explorer
171 Views
3 Replies
Message 1 of 4

Modify leads and links after toolpath generation

Adam_Popma
Explorer
Explorer



Issue with Lead and Link Parameters in Toolpath Templates

I'm running into a limitation with toolpath generation that I’m hoping someone can help clarify or offer a workaround for.

The toolpath I'm working with requires specific Lead and Link parameters to be set in order to generate correctly. However, these settings are only available through the Modify Leads and Links menu—they're not accessible directly within the main toolpath form.

The bigger issue is that when I save the toolpath as a template, the customized Lead and Link settings don’t carry over. So when I apply the template later, I have to manually reconfigure those settings each time.

I’m wondering if there’s a way to handle this using the API—perhaps by editing the toolpath links after the toolpath has been generated? Has anyone had success automating this part of the workflow?


ToolpathSetting-Linking.png

 




Available Lead/Link parameters within the Modify Lead and Links formAvailable Lead/Link parameters within the Modify Lead and Links form

 

0 Likes
172 Views
3 Replies
Replies (3)
Message 2 of 4

kandennti
Mentor
Mentor

Hi @Adam_Popma -San.

I created a sample that switches the RetractionPolicy between “minimum” and “shortest”.

# Fusion360API Python script

import traceback
import adsk.core as core
import adsk.cam as cam

def run(context):
    ui: core.UserInterface = None
    try:
        app: core.Application = core.Application.get()
        ui = app.userInterface

        camObj: cam.CAM = app.activeProduct

        setup: cam.Setup = camObj.setups[0]
        ope: cam.Operation = setup.operations[0]
        prm = ope.parameters.itemByName("retractionPolicy")
        if prm.value.value == "minimum":
            prm.value.value = "shortest"
        else:
            prm.value.value = "minimum"

        ui.messageBox(f"RetractionPolicy: {prm.value.value}")

    except:
        if ui:
            ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))
0 Likes
Message 3 of 4

Chris.Barnes.ADSK
Autodesk
Autodesk

I believe he is asking if the leads and links modification that is part of the machining extension is available through the API. I may be mistaken, but I believe your code here only modifies the retraction policy on the "base" toolpath, before any modifications have been applied. And I believe he is applying the modification because the base toolpath parameters are giving an undesired result 



Christopher Barnes
Principal QA Engineer
0 Likes
Message 4 of 4

kandennti
Mentor
Mentor

Hi @Chris.Barnes.ADSK -san.

I misunderstood.

kandennti_0-1763302622805.png

Although the parameter name here is “entry_type”, I was unable to retrieve it using `cam.Operation.parameters.itemByName(“entry_type”)`.

kandennti_1-1763302643635.png

 

 

Can we assume that the parameter currently set to “System Default: isParentStrategyHSM” is not supported?

0 Likes