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#msg617740ARX constructs the rotation transformation matrix through AcGeMatrix3d::setToRotation(..)
======================
Use the rotate transformation matrix under AcGeMatrix3d and cooperate with the point monitor to implement the original AUTOCAD rotate command:
(defun _call
-back
(dynpt
) (xdrx-entity-delete clone)
(xdrx
-matrix
-setrotation
(angle base dynpt
) '
(0 0 1) base
) )
(setq clone
(xdrx
-entity
-transformedcopy ents mat
-rotate
)) )
(and (setq ss
(xdrx
-ssget "\nSelect the object to be moved <exit>:")) (setq p1
(getpoint "\nThe first point of the rot base<exit>:")) )
(xdrx-begin)
(setq ents
(xdrx
-ss
->ents ss
) clone (xdrx-entity-copy ss)
)
(xdrx-pointmonitor "_call-back")
(= 0
(xdrx-yesorno
"\nWhether to keep the original object:"
1
)
)
)
(xdrx-entity-delete ents)
)
)
)
(xdrx-pointmonitor)
(xdrx-end)
)
)
)