Is it possible to specify CAM SETUP WCS Work Coordinate System based on origin point and XYZ vectors via API

Is it possible to specify CAM SETUP WCS Work Coordinate System based on origin point and XYZ vectors via API

omedvydskiy
Participant Participant
773 Views
5 Replies
Message 1 of 6

Is it possible to specify CAM SETUP WCS Work Coordinate System based on origin point and XYZ vectors via API

omedvydskiy
Participant
Participant

I have origin point and vectors xAxis, yAxis, zAxis.
I want to specify workCoordinateSystem for CAM setup.

 

Method setWithCoordinateSystem returns True but it does not work.

setup.workCoordinateSystem.setWithCoordinateSystem(origin, xaxis, yaxis, zaxis)

 

Accepted solutions (1)
774 Views
5 Replies
Replies (5)
Message 2 of 6

Jorge_Jaramillo
Collaborator
Collaborator

Hi,

Just to check, could you post the results of

app.lof(f'{setup.workCoordinateSystem.asArray()=}')

before and after you change it?

 

The result of it is printed in the Text Commands window, below in Fusion's screen.

 

And also the values of origin.asArray(), xaxis.asArray(), yaxis.asArray(), zaxis.asArray()?

 

0 Likes
Message 3 of 6

omedvydskiy
Participant
Participant

omedvydskiy_0-1693557614327.pngomedvydskiy_1-1693557629761.png

 

0 Likes
Message 4 of 6

Jorge_Jaramillo
Collaborator
Collaborator
Accepted solution

Hi @omedvydskiy ,

 

I was able to reproduce the same situation on my environment.

Looking at the documentation for Setup.workCoordinateSystem Property, it states only to GET its value and it doesn't say anything about setting it:

wtallerdemadera_0-1693599297100.png

I made two additional tests:

- Try to assign a new matrix to setup.workCoordinateSystem: got this error : AttributeError: can't set attribute

- Get the matrix that setup.workCoordinateSystem contains, and update it with setWithCoordinateSystem().  It allowed me to update the matrix but the changes are not reflected in the setup property.

 

Conclusion: I don't thing it is possible to update it at the moment.

 

Regards,

Jorge Jaramillo

Software Engineer

 

Message 5 of 6

omedvydskiy
Participant
Participant

Thanks for replay.

0 Likes
Message 6 of 6

jonathan_davisJNRKK
Explorer
Explorer

I'm on this rabbit trail right now... Is it not possible to set it using an input parameter?

 

setup.parameters.itemByName('wcs_orientation_axesZX_unselected_default').expression = # reference geometry somehow???

 

0 Likes