2 Replies Latest reply on Apr 10, 2014 11:14 AM by Mika Ihatsu

# How to create Coordinate system using Rotational matrix and Translation vector

Hi,

I try to figure out how to create coordinate system using rotational matrix and transitional vector. I have been reading these two samples:

http://help.solidworks.com/2013/English/api/sldworksapi/Create_Coordinate_System_Feature_Example_VB.htm

In second one is introduced IMathTransform and I would like to make coordinate system using these variables

‘Add a rotational diagonal unit matrix (zero rotation) to the transformation matrix
compXforms(0) = 1#
compXforms(1) = 0#
compXforms(2) = 0#
compXforms(3) = 0#
compXforms(4) = 1#
compXforms(5) = 0#
compXforms(6) = 0#
compXforms(7) = 0#
compXforms(8) = 1#

' Add a translation vector to the transformation matrix
compXforms(9) = 0#
compXforms(10) = 0#
compXforms(11) = 0#

Is it even possible to make coordinate system using these or do I need to make first point and lines and then use Set swFeat = swFeatMgr.CreateCoordinateSystem() ?

Thank you

Mike

• ###### Re: How to create Coordinate system using Rotational matrix and Translation vector

Hi Mika,

No, you cannot create a coordinate system using the transforms. You have to have a SolidWorks entities. You need to call the MathTransform::GetData2 to find the axes directions and the origin and create a 3D Sketch with those entities, make a selection and insert the coordinate system.

______________________________________________

Regards, Artem Taturevych | Snr. Developer | IC3D ANZ

IC3DSteel – New Steel Solution for SolidWorks

translationXpert – SolidWorks files language translator

• ###### Re: How to create Coordinate system using Rotational matrix and Translation vector

Artem, Thank you very much I got it work!