Modify leads and links after toolpath generation

Modify leads and links after toolpath generation

Adam_Popma
Participant Participant
579 Views
8 Replies
Message 1 of 9

Modify leads and links after toolpath generation

Adam_Popma
Participant
Participant



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
580 Views
8 Replies
Replies (8)
Message 2 of 9

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 9

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 9

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
Message 5 of 9

alexDXZRG
Explorer
Explorer

Adam did you ever find a solution? I am trying to do the same thing. Store a tool op as a toolpath but also bring with it my modifications to lead ins and outs. I've had no luck.

0 Likes
Message 6 of 9

Adam_Popma
Participant
Participant

No, I have not. From my understanding, some of the toolpath algorithms are ran through ModuleWorks, some through fusion. Currently fusion can't modify some of the toolpath parameters from ModuleWorks until after the toolpath is calculated. That is why the available lead/link settings to modify differs for during toolpath calculation vs after its generated. 

I may be inaccurate on this, that was just my general understanding. 

0 Likes
Message 7 of 9

alexDXZRG
Explorer
Explorer

Thanks for the update. Very silly that this doesn't work considering you can copy and paste a tool op and the modification carry with it. My current workaround is to have a blank part file with a setup that has the tool operations with modifications and I just copy and paste from that file into whatever I am working on. Very annoying and breaks my workflow a little but at least it works. Have you figured out a better way?

0 Likes
Message 8 of 9

Adam_Popma
Participant
Participant

Unfortunately I have not found a better way. I didn't know that you could copy a toolpath from one file to another, so that's good to know, thanks!

0 Likes
Message 9 of 9

alexDXZRG
Explorer
Explorer

Hey I'm glad I could kinda help lol. I get better results with the ctrl+c and ctrl+v btw. You can also shift select multiple tool operations and past them in case you're trying to move a whole setup.