cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping a vector.

Builder
Builder

How do you map a vector from the current display part and put it in terms of the current workPart.

Assuming that the workPart does not equal the displayPart.

2 REPLIES

Re: Mapping a vector.

Honored Contributor
Honored Contributor

You would need to find the transformation matrix from the display to the work part and multiply your vector matrix by the transformation matrix. There are several methods in the NXOpen API to help do this; however, for this situation, I would recommend using the .MapPoint method. I think it will provide the easiest way to transform your vector information.  Vectors point from the origin (0,0,0) to the given point (Vx, Vy, Vz); since all vectors start from the origin, they are usually just written as a triplet (the same as point coordinates). Therefore, the .MapPoint function can be used to transform your vector information.

Re: Mapping a vector.

Creator
Creator

If you utilize the WCS you can use this approach assuming the work part and displayed part are different as stated.  Then you can have all the vector information you need from one object.  Be sure to delete the saved csys when done.

 

CartesianCoordinateSystem cartesianCoordinateSystem1;
cartesianCoordinateSystem1 = theSession.Parts.Display.WCS.Save();

CartesianCoordinateSystem cartesianCoordinateSystem2 = (CartesianCoordinateSystem)theSession.Parts.WorkComponent.FindOccurrence(cartesianCoordinateSystem1);