Announcements
Autodesk Community will be read-only between April 26 and April 27 as we complete essential maintenance. We will remove this banner once completed. Thanks for your understanding

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

maurizio_manzi
Advocate

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

maurizio_manzi
Advocate
Advocate

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

0 Likes
Reply
581 Views
5 Replies
Replies (5)

kandennti
Mentor
Mentor

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()))
0 Likes

maurizio_manzi
Advocate
Advocate

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

0 Likes

kandennti
Mentor
Mentor
0 Likes

kandennti
Mentor
Mentor

@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

0 Likes

maurizio_manzi
Advocate
Advocate

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

 

1 Like