Regarding the basic concepts of AcGeMatrix3d and simple methods of implementing COPY and MOVE, see the post:
https://www.theswamp.org/index.php?topic=58880.msg617740#msg617740Transformation between different coordinate systems is a challenging task, but it is extremely convenient because ARX AcGeMatrix3d provides the AcGeMatrix3d::alignCoordSys method. This function is also the most distinctive function of AcGeMatrix3d.
======================
result:
The video above demonstrates the copying of text in different coordinate systems.
==========
;|
1. Key function to construct transformation matrices of different coordinate systems.
2.from: source coordinate system, (base point x-axis vector y-axis vector z-axis vector)
3.to: target coordinate system, (base point x-axis vector y-axis vector z-axis vector)
|;
(setq mat
(xdrx
-matrix
-aligncoordsystem from to
))
(defun c:tt
(/ box coord_from coord_to e1 m_from mat p0 px pz base vx vy vz
) (setq e1
(car (xdrx
-entsel "\nPick Circle<exit>:" '
((0 .
"circle"))))) )
(setq coord_from
(xdrx
-entity
-getecs e1
)) (setq vx
(xdrx
-vector
-normalize
(mapcar '
- px p0
))) (setq vz
(xdrx
-vector
-negate
(xdrx
-vector
-perpvector vx
))) (setq vy
(xdrx
-vector
-crossproduct vz vx
)) (setq mat
(xdrx
-matrix
-aligncoordsystem coord_from coord_to
)) (xdrx-entity-transformedcopy e1 mat)
)
)
)