Changing feeds and speeds requires regenerating toolpath for drill operations

Changing feeds and speeds requires regenerating toolpath for drill operations

avandertoorn
Explorer Explorer
639 Views
4 Replies
Message 1 of 5

Changing feeds and speeds requires regenerating toolpath for drill operations

avandertoorn
Explorer
Explorer

When updating feeds and speeds through the API for drill operations, it places the drill operation in a "Toolpath out of date" state, necessitating regeneration. This does not happen for any of the milling operations that I've encountered, which leads me to believe that the same should be expected for drilling. Of course, regenerating the toolpath is a straightforward solution. However, a larger issue arises when, for instance, an adaptive toolpath uses rest machining, as it also places all these toolpaths into a "Toolpath out of date" state. I do not wish to regenerate all toolpaths that get put into an invalid state every time as I don't want to potentially change a toolpath and add a lot of extra time.

Is this something that should be fixed?

0 Likes
640 Views
4 Replies
Replies (4)
Message 2 of 5

jeff.pek
Community Manager
Community Manager

Can you share a sample script that demonstrates this?

Thanks!

  Jeff

0 Likes
Message 3 of 5

kandennti
Mentor
Mentor

Hi @avandertoorn .

 

I tried to confirm it with "Face" and "Drill". It can be reproduced.

# 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]

        print(f"ver {app.version}")
        change_feed(setup.operations[0])
        change_feed(setup.operations[1])

    except:
        if ui:
            ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))

def change_feed(
    ope: cam.Operation,
) -> None:

    if ope.strategy == "drill":
        prmName = "tool_feedPlunge"
    else:
        prmName = "tool_feedCutting"

    prm: cam.ParameterValue = ope.parameters.itemByName(
        prmName
    )

    msgLst = [
        f"** Name: {ope.name} **",
        "---",
        f"Before Feed: {prm.value.value}",
        f"Before State: {ope.operationState}",
        "---",
    ]

    prm.value.value += 100

    msgLst.extend(
        [
            f"After Feed: {prm.value.value}",
            f"After State: {ope.operationState}",
        ]
    )

    print("\n".join(msgLst))

 

ver 2.0.16761
** Name: Face1 **
---
Before Feed: 1000.0
Before State: 0
---
After Feed: 1100.0
After State: 0
** Name: Drill1 **
---
Before Feed: 1000.0
Before State: 0
---
After Feed: 1100.0
After State: 1

 

1.png

0 Likes
Message 4 of 5

avandertoorn
Explorer
Explorer

@kandennti,

Thanks for taking the time to test this out on your end.

I added a few toolpaths with 'Rest Machining' on with 2 of them and off with the last one.

# 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]

        print(f"ver {app.version}")


        print("\n\nBefore Change")
        print("------------------")
        print_state(setup.operations[2])
        print_state(setup.operations[3])
        print_state(setup.operations[4])
        print("------------------")
        print("\n\n")

        change_feed(setup.operations[0])
        change_feed(setup.operations[1])

        print("\n\nAfter Change")
        print("------------------")
        print_state(setup.operations[2])
        print_state(setup.operations[3])
        print_state(setup.operations[4])
        print("------------------")

    except:
        if ui:
            ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))

def change_feed(
    ope: cam.Operation,
) -> None:

    if ope.strategy == "drill":
        prmName = "tool_feedPlunge"
    else:
        prmName = "tool_feedCutting"

    prm: cam.ParameterValue = ope.parameters.itemByName(
        prmName
    )

    msgLst = [
        f"** Name: {ope.name} **",
        "---",
        f"Before Feed: {prm.value.value}",
        f"Before State: {ope.operationState}",
        "---",
    ]

    prm.value.value += 100

    msgLst.extend(
        [
            f"After Feed: {prm.value.value}",
            f"After State: {ope.operationState}",
        ]
    )

    print("\n".join(msgLst))

def print_state(
    ope: cam.Operation,
) -> None:

    msgLst = [
        f"** Name: {ope.name} **",
        f"State: {ope.operationState}",
        f"Rest: {cam.BooleanParameterValue.cast(ope.parameters.itemByName('useRestMachining').value).value}"
    ]

    print("\n".join(msgLst))

 

ver 2.0.16976


Before Change
------------------
** Name: Adaptive1 **
State: 0
Rest: True
** Name: Pocket1 **
State: 0
Rest: True
** Name: Pocket1 (2) **
State: 0
Rest: False
------------------



** Name: Face1 **
---
Before Feed: 1000.0
Before State: 0
---
After Feed: 1100.0
After State: 0
** Name: Drill1 **
---
Before Feed: 1000.0
Before State: 0
---
After Feed: 1100.0
After State: 1


After Change
------------------
** Name: Adaptive1 **
State: 1
Rest: True
** Name: Pocket1 **
State: 1
Rest: True
** Name: Pocket1 (2) **
State: 0
Rest: False
------------------

 

avandertoorn_0-1691578656295.png


Also, I noticed the same thing happens when updating feeds and speeds through the UI except for the edited operation is obviously regenerated when clicking "OK".


Message 5 of 5

avandertoorn
Explorer
Explorer

What is the process for getting issues like this looked at by the development team?

0 Likes