Community
Fusion API and Scripts
Got a new add-in to share? Need something specialized to be scripted? Ask questions or share what you’ve discovered with the community.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to create a "Manual NC" operation using the API?

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
jan_weidner
179 Views, 4 Replies

How to create a "Manual NC" operation using the API?

The the GUI, one can create manual NC options, like so: Is this possible from the API as well?

jan_weidner_0-1695635367128.png

 

4 REPLIES 4
Message 2 of 5

Hi,

I don't know if it will be available sometime.
While it isn't, a customization to the post-processor could help you.

Regards,
Jorge Jaramillo
Software Engineer
Message 3 of 5
kandennti
in reply to: jan_weidner

Hi @jan_weidner -San.

 

How about creating a "Manual NC" template in advance and importing it?

# Fusion360API Python script

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

THIS_DIR = pathlib.Path(__file__).resolve().parent
TEMPLATE_PATH = str(THIS_DIR / "Manual_NC_Test.f3dhsm-template")

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

        # get CAM
        camObj: cam.CAM = app.activeProduct

        # create template from file
        template: cam.CAMTemplate = cam.CAMTemplate.createFromFile(
            str(TEMPLATE_PATH)
        )

        # get setup
        setup: cam.Setup = camObj.setups[0]

        # import template
        setup.createFromCAMTemplate(template)

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


Attached is a script.

Message 4 of 5
jan_weidner
in reply to: jan_weidner

Ok, thanks! Using the template solution, is there a way to insert a manual nc in the setup after some already existing operations?

Message 5 of 5
kandennti
in reply to: jan_weidner

@jan_weidner -San.

 

If you do a createFromCAMTemplate for the desired setup, it will be added last.

Conversely, it is not possible to import a template at an arbitrary position, nor is it currently possible to change the order of operations.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report