CAM api to read operation time.

gina68ABR
Enthusiast

CAM api to read operation time.

gina68ABR
Enthusiast
Enthusiast

Hi!

 

is it possible to use the api fetch the time that fusion think an operation will take to run?

 

I’ve been poking around the docs for a while with no luck,

0 Likes
Reply
Accepted solutions (1)
347 Views
3 Replies
Replies (3)

Jorge_Jaramillo
Collaborator
Collaborator
Accepted solution

Hi,

 

I believe this is you're looking for (I didn't tried before):

Jorge_Jaramillo_0-1702846563325.png

 

 

I hope this can help.

 

Regards,

Jorge Jaramillo

Software Engineer

 

1 Like

Jorge_Jaramillo
Collaborator
Collaborator

Hi again,

 

I was playing with the cam.getMachiningTime() method and I notice the result it reports does not change if I provide different FeedScale values; it always report the machine time according to the Feed Scale parameter that is set with the user interface as I highlight in the following image (as it reminds it):

 

Jorge_Jaramillo_0-1702850000289.png

Notice that for first operation the machine time is 1:03 at normal speed; doubling the speed with a feed scale of 200% the machine time is 0:31; and since it was set like so in the user interface, it always returns the same value for different feed scale values to the getMachiningTime() method.

It look likes there is BUG in this function.  Can Fusion Team take a look at it?

 

This is the script I used to test it:

def get_cam_data() -> None:
    cam: adsk.cam.CAM = app.activeDocument.products.itemByProductType('CAMProductType')
    if cam:
        for setup in cam.setups:
            app.log(f'  {setup.name}')
            for op in setup.operations:
                app.log(f'    {op.name}')
                for feedScale in range(10,25,5):
                    app.log(f' {" ":20}{feedScale/10=} {cam.getMachiningTime(op, feedScale/10, 20000, 0).machiningTime=}')

 

Regards,

Jorge Jaramillo

Software Engineer

 

0 Likes

gina68ABR
Enthusiast
Enthusiast
This is exactly what I was looking for, thank you!
0 Likes