@shane.plunkett
Try this. Select one or more text or mtext entities, and pick an entity to align with. Code is looking for a nearest point at that entity at the place of selection, and looks for a point that is very near to that one. It than rotates all selected entities in that direction. If for some reason you need text entities to be rotated in 180° to opposite direction answer "y" . As alignment object you can use practically any geometric object (line polyline circle rectangle.....)
I hope this wil work in LT version, I can not test it myself.
(defun c:alt ( / ss e pt1 pt2 di i again)
(princ "\nSelect text/mtext to realign > ")
(setq ss (ssget '((0 . "*TEXT"))) i -1)
(cond
((and ss (>= (sslength ss) 1))
(setq e (entsel "\nSelect entity to align with >" ))
(cond
((and e)
(setq
pt1 (cadr e)
e (car e)
e (vlax-ename->vla-object e)
pt1 (vlax-curve-getclosestpointto e pt1)
di (+ 0.01 (vlax-curve-getdistatpoint e pt1))
pt2 (vlax-curve-getpointatdist e di)
)
(while (<(setq i (1+ i))(sslength ss))
(setq e (vlax-ename->vla-object (ssname ss i)))
(vlax-put e 'rotation (angle (trans pt1 1 0)(trans pt2 1 0)))
)
(initget 1 "y n")
(setq again (strcase (getkword "\nRotate to opposite direction <y/n>? ")) i -1)
(if (= again "Y")
(while (<(setq i (1+ i))(sslength ss))
(setq e (vlax-ename->vla-object (ssname ss i)))
(vlax-put e 'rotation (angle (trans pt2 1 0)(trans pt1 1 0)))
)
)
)
(T (princ "\nYou didn't select an object to align with!"))
)
)
(T (princ "\nYou didn't select any text object to realign!"))
)
(princ "\nDone!")
(princ)
)
Miljenko Hatlak

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.