08-22-2023
02:19 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
08-22-2023
02:19 PM
My last try was to make a script that changes the tool orientation according to the wcs axis, to launch after I assign the template to the setup.
It's late and I am not good with python and API, I know that I need to follow a special rule to assign the geometry to the selection but now I need to sleep and I am not 100% sure that I can assign a vector to this specific parameter.
I attach some line of the code that I add to my existing script that set the origin and the name of the setups, if someone want to contribute to finish it I will appreciate, else I will follow the thread with the hopefully right script. ![]()
good night
(origin, xAxis, yAxis, zAxis) = setup.workCoordinateSystem.getAsCoordinateSystem()
for op in ops:
opName=op.name
if opName=='BORR 8 LEFT':
opToolOrient0=op.parameters.itemByName('overrideToolView')
opToolOrient0.expression="true"
opToolOrient1=op.parameters.itemByName('view_orientation_mode')
opToolOrient1.expression="'axesZX'"
opToolOrientZ=op.parameters.itemByName('view_orientation_axisZ')
opToolOrientZ.expression="true"
opToolOrientZ.expression.value=xAxis
clearly ops is the variable that refer the operations inside the setup.
Fusion