Idea: complete the CAM api, or at least advance it some since 2016.

anthony.a.douglas
Enthusiast
Enthusiast

Idea: complete the CAM api, or at least advance it some since 2016.

anthony.a.douglas
Enthusiast
Enthusiast

So I was planning for more than a year to implement a fusion 360 script to help automate a new manufacturing process I am working with.  There are hundreds of toolpath operations that need to be created for a single part, so making them manually is impractical, but it is highly amenable to automation. 

I have been advancing the project, but completely run aground when I discovered the CAM api has apparently not changes since 2016!   It still has only very rudimentary functionality, and cannot be used to create toolpaths like the user can, for instance.  Why not expose this?

The plugin I am trying to write first slices an object into layers that can be manufactured through 3d milling, then slices the surface of the model at the layer tops, then needs to input these surfaces into the cam toolpaths.  There are sometimes quite thin layers, so there end up being hundreds of toolpaths for a complex or highly detailed part, with as many toolchanges.  Totally impracticaly to do it manually.

 

 

1 Like
Reply
Accepted solutions (1)
2,458 Views
14 Replies
Replies (14)

kandennti
Mentor
Mentor

Is there a macro using API in HSMWorks?
I could not find it by searching the forum.

 

PowerMill (Autodesk) implements very powerful macros.
It is an impression that has been actively worked since the Delcam era.

0 Likes

anthony.a.douglas
Enthusiast
Enthusiast

cool thanks for the tip, I will look into powermill.  When I say macro I mean a keyboard macro, like a second program that sends keyboard and mouse signals repetitively.  Very cumbersome.

0 Likes

kandennti
Mentor
Mentor

This is a demonstration of simply creating a drilling tool path on a board.

 

The CAD data is imported and the macro is executed.
・ Recognize hole shapes from 3D data
・ Select and create tools and processes according to the hole diameter
・ Execution of tool path creation batch
After that, a simulation was performed.

 

 

This is only drilling, but it should be possible to automate even milling.

 

In my opinion, PowerMill users are more likely to work on macros.
There are also many specialists on the forum.


Unfortunately, Fusion360's CAM cannot do this.

0 Likes

anthony.a.douglas
Enthusiast
Enthusiast

ok, thanks.  I don't know if macros will cut it, it sounds like it might lack the power of a proper programming language, but I will try it.  I tried to find documentation, but could not find any good documentation like they have for fusion.  That's a real problem, unfortunately.  Gotta be documented.

0 Likes

ArjanDijk
Advisor
Advisor

This is being worked on by @Customgeo Roberts. Maybe he can update


Inventor HSM and Fusion 360 CAM trainer and postprocessor builder in the Netherlands and Belgium.


0 Likes

anthony.a.douglas
Enthusiast
Enthusiast
Cool beans. It has been a very very long time. I have to say I used to
really admire autdesk and wish I could work for them, but stuff like this
baffles me and gives me pause.
0 Likes

GeorgeRoberts
Autodesk
Autodesk
Accepted solution

Hello,

 

Thanks for tagging me @ArjanDijk! He is correct, we are currently working on improving the CAM API. Some of the things we are currently working on are:

- Create operations from templates

- Get/set parameters

- Get/set geometry

- Post process

 

Hopefully we can finish this soon and then look into other areas of the CAM API. If you have any thoughts / feedback, feel free to contact me: george.roberts@autodesk.com

-

George Roberts

Manufacturing Product manager
If you'd like to provide feedback and discuss how you would like things to be in the future, Email Me and we can arrange a virtual meeting!
1 Like

skunkworksllc
Participant
Participant
0 Likes

anthony.a.douglas
Enthusiast
Enthusiast
yeah, I have heard nothing. It has been four years now since the api help
indicates it would be done soon. I think it is not coming.
0 Likes

skunkworksllc
Participant
Participant

Agreed. My family business developed a 100% automated CAM system for hole drilling and 2D machining for another CAD environment. We are swapping to Inventor and had dreams of leveraging and existing CAM that runs inside the CAD environment so we didn’t have to reinvent a hundred thousand lines of code but at this rate I may be backed into that very corner. I think even “Phase 2” isn’t going to have any level of “light out” CAM programming as I would need control over stock, setups, and MCS along with the things mentioned in “Phase 2”. I think I’ll be waiting for phase 3 or 4. 

0 Likes

GeorgeRoberts
Autodesk
Autodesk

Good morning,

 

In the latest release of Fusion, you can do much more with the API:

  • Get/set expressions
  • Set properties in post processing
  • Create operations by inserting pre-defined templates into a setup
  • get/set operation notes
  • Get identifiers for bodies/fixtures/stock that are selected in a setup

     

    Here is a very simple sample to give you an idea of how you can access this:

    import adsk.core, adsk.fusion, adsk.cam, traceback
    
    def run(context):
        ui = None
        try:
            app = adsk.core.Application.get()
            ui  = app.userInterface
            prod = app.activeProduct
            # cast the CAM product (need to be in the CAM workspace. Although you could explicitly set it on the CAMProduct)
            cam = adsk.cam.CAM.cast(prod)
            # get the first setup
            setup = cam.setups.item(0)
            #Insert template into the selected setup. In reality, you would probably put these templates in some sort of resource folder
            setup.createFromTemplate("D:\\Face.f3dhsm-template")
            operations = setup.allOperations
            for operation in operations:
                # get a collection of parameters
                parameters = operation.parameters
                # use itemByName to access the stepover parameter
                stepOver = parameters.itemByName("stepover")
                # if that parameter exists, set the expression to 2mm
                if stepOver:
                    stepOver.expression = "2mm"
                    # add a note to tell the user the stepover has been adjusted
                    operation.notes = "Automatically changed stepover"
    
            # generate toolpaths   
            cam.generateAllToolpaths(True)
    
        except:
            if ui:
                ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))
    ​

As you can see, we are still actively working on the API and hope to have more functionality in near-term releases, but just these few tasks massively expands the reach of the previous CAM API. If anyone would like to have a discussion about their API requirements, please contact me any time: george.roberts@autodesk.com

 

 

 

-

George Roberts

Manufacturing Product manager
If you'd like to provide feedback and discuss how you would like things to be in the future, Email Me and we can arrange a virtual meeting!
2 Likes

kandennti
Mentor
Mentor

Thank you for a good job.

 

Since operation.parameters is an ObjectCollection, you will not notice unless you use breakpoints when debugging.

I think it is better to add such code or code that dumps operation.parameters to Help as a sample program.

1.png

I feel that your hard work on the API of CAM is the reason why it has not been transmitted to add-in developers.

1 Like

GeorgeRoberts
Autodesk
Autodesk

Thanks for the feedback, that makes sense. I'll create some sample programs and see about getting them added to sample files

-

George Roberts

Manufacturing Product manager
If you'd like to provide feedback and discuss how you would like things to be in the future, Email Me and we can arrange a virtual meeting!
1 Like

skunkworksllc
Participant
Participant

We are pretty excited about the new CAM API rollout.

 

Two questions:

 

1. Will this trickle into InventorCAM?

 

2. I see that there is access to parameters for setup objects. Under ...parameters.itemByName("") I could see the possibility of having access to get/set nearly all parameters for setups and operations. For my company we would definitely need to be able to set the WCS and stock programmatically. Will this functionality be available?

 

 

0 Likes