Fusion API able to set entry points, predrill points etc in Operations?

Fusion API able to set entry points, predrill points etc in Operations?

keonfrey
Explorer Explorer
116 Views
1 Reply
Message 1 of 2

Fusion API able to set entry points, predrill points etc in Operations?

keonfrey
Explorer
Explorer

I'd like to create a script that automatically places preferred lead in positions into an operation but cant for the life of me figure out how. Is this something the API has no access to or ability to set them? 

        entry_param = profile_op.parameters.itemByName('entryPositions')
        if not entry_param:
            ui.messageBox('<li-emoji id="lia_cross-mark" src="/html/@06346EE0D3462AE3E5A5D9E6F66C63B6/emoticons/274c.png" class="lia-deferred-image lia-image-emoji" alt=":cross_mark:" title=":cross_mark:"></li-emoji> "entryPositions" parameter not found in operation.')

finds the parameter but cant seem to figure out what would set the points?
0 Likes
Accepted solutions (1)
117 Views
1 Reply
Reply (1)
Message 2 of 2

rohit_maneYV8C9
Autodesk
Autodesk
Accepted solution

Hello @keonfrey ,
Please refer this to this forum post. This shows how you can set preferred lead-in positions for operations.

occ = _design.rootComponent.occurrences.item(0)
sketch = occ.component.sketches.add(occ.component.xYConstructionPlane)
sketchPoint = sketch.sketchPoints.add(adsk.core.Point3D.create(0, 3, 2.5))

entry_param = operation.parameters.itemByName('entryPositions')
Entrypoint: adsk.cam.CadObjectParameterValue = entry_param.value
Entrypoint.value = [sketchPoint.createForAssemblyContext(occ)]

 

0 Likes