Rotation around x axis

Rotation around x axis

BestFriendCZ
Advocate Advocate
840 Views
2 Replies
Message 1 of 3

Rotation around x axis

BestFriendCZ
Advocate
Advocate

Hi all,

 

is there easy way how to get rotation around X axis?
My function returns rotation around Z axis (same rotation shows ACAD) but i don't know how to convert to different axis like X or Y

rotation.png

...
0 Likes
Accepted solutions (1)
841 Views
2 Replies
Replies (2)
Message 2 of 3

_gile
Consultant
Consultant
Accepted solution

Hi,

If the block reference have only been rotated about the X axis, you can computr the rotation about the X axis of the block reference from its BockTransform.CoordinateSystem3d.YAxis.

Vector3d yAxis = br.BlockTransform.CoordinateSystem3d.Yaxis;
double rotationX = Math.Atan2(yAxis.Z, yAxis.Y);

If the block reference have been rotated about more than one axis, the rotations about each axis might be described by the Euler angles. But the rotation about one axis may differ according to the "order the rotations occured".

You can see this topic about Euler angles and BlockRefence.BlockTransform.



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

0 Likes
Message 3 of 3

BestFriendCZ
Advocate
Advocate

Thank you for your advice Gile

...
0 Likes