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 set: Advanced swarf - Geometry - Avoid machine surfaces - Model, clereance

5 REPLIES 5
Reply
Message 1 of 6
maurizio_manzi
148 Views, 5 Replies

How to set: Advanced swarf - Geometry - Avoid machine surfaces - Model, clereance

Hello,

How to set the parameter 'clereance' of 'Advanced swarf - Geometry - Avoid machine surfaces - Model' (see pic)?

 

Best regards

Maurizio

03-04-_2024_11-17-05.png

5 REPLIES 5
Message 2 of 6
kandennti
in reply to: maurizio_manzi

Hi @maurizio_manzi -San.

 

I think the parameter name displayed there is wrong.
The correct parameter name seems to be "clearanceInfo".

# Fusion360API Python script

import traceback
import adsk.core as core
import adsk.fusion as fusion
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
        unitsMgr: core.UnitsManager = camObj.unitsManager

        setup: cam.Setup = camObj.setups[0]
        opeAdvancedSwarf: cam.Operation = setup.operations[0]

        param: cam.CAMParameter = opeAdvancedSwarf.parameters.itemByName(
            "clearanceInfo"
        )

        ui.messageBox(f"{unitsMgr.formatValue(param.value.value)}")

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

Hello,

'operation1' is my advanced swarf operation reference.
I test:

cadcontours1: adsk.cam.CadObjectParameterValue = operation1.parameters.itemByName('clearanceInfo').value
cadcontours1.value = -0.1

 

But it is also not working (see pic). The value remain 0.

 

Best regards

Maurizio

04-04-_2024_08-36-06.png

Message 4 of 6
kandennti
in reply to: maurizio_manzi

Message 5 of 6
kandennti
in reply to: maurizio_manzi

@maurizio_manzi -San.

 

I did some more research.


The "clearanceInfo" was a parameter for "Total Clearance".

I right-clicked on the operation and opened "Compare and Edit" and could not find the corresponding parameter, so I think it is not provided by the API.

1.png

Message 6 of 6

okay, thank you. I will make a future-request in the Manufacturing (CAM) API Feedback post.

 

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