Use API to add fields to existing Setup dialogue in CAM workspace.

Use API to add fields to existing Setup dialogue in CAM workspace.

Shannon_IMD
Enthusiast Enthusiast
444 Views
4 Replies
Message 1 of 5

Use API to add fields to existing Setup dialogue in CAM workspace.

Shannon_IMD
Enthusiast
Enthusiast

Is it possible to use API to add new fields to the existing setup dialogue on the post process tab?

 

I'd like to add WCS xyz positions to each setup that I can the call up in the post to add to the work offset macro.

 

Setup WCS.PNG

0 Likes
Accepted solutions (1)
445 Views
4 Replies
Replies (4)
Message 2 of 5

kandennti
Mentor
Mentor

Hi @Shannon_IMD -San.

 

This may not be correct because we do not know the type of machine.

Every time we run this script, it counts up.

# 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#get_cam_product()

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

        prm: cam.CAMParameter = setup.parameters.itemByName(
            "job_workOffset"
        )

        print(f"before:{prm.value.value}")
        prm.value.value += 1
        print(f"after:{prm.value.value}")

    except:
        if ui:
            ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))
0 Likes
Message 3 of 5

Shannon_IMD
Enthusiast
Enthusiast
Hi Kandennti

I'm new to Python and API with Fusion. I've done a lot with javascript and
Fusion for posts.

I have saved the python script as you supplied. I formatted it to remove
errors.

However it has an error that camObj.setups is undefined.

I'm not sure if I have correctly relayed what I'm trying to do. Here is a
quick sketch to show what I'm wanting to achieve.

This is for the Okuma HB 5000 machine definition using the current post
definition.

[image: Setup WCS Example.PNG]
Thanks

Shannon

0 Likes
Message 4 of 5

kandennti
Mentor
Mentor
Accepted solution

@Shannon_IMD -San.

 

My apologies, I misunderstood your question.

You cannot change the standard command dialog.

0 Likes
Message 5 of 5

Shannon_IMD
Enthusiast
Enthusiast

Thank you for the reply. I guess that idea is done then so i can stop wasting time on it. I'll have to find another solution.