Showing results for 
Search instead for 
Did you mean: 

Mapping a vector.


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.


Re: Mapping a vector.

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed 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.


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);