TORIENT alternative

TORIENT alternative

shane.plunkett
Explorer Explorer
446 Views
5 Replies
Message 1 of 6

TORIENT alternative

shane.plunkett
Explorer
Explorer

Hi, My company recently changed from Civils 3D to Autocad LT, A few changes but one we have come across that will take a bit of extra time is the loss of the Text Orient tool. Is there an alternative that can be used on Autocad LT?

 

Thanks

0 Likes
447 Views
5 Replies
Replies (5)
Message 2 of 6

pendean
Community Legend
Community Legend

Which feature do you use the most,  like just needing your text/attributes to always be "right way up" so to speak all the time?

 

Or do you use is most often to align those elements with angular lines etc.?

0 Likes
Message 3 of 6

paullimapa
Mentor
Mentor

I assume you are on LT 2024 then try this code found on this thread


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 4 of 6

shane.plunkett
Explorer
Explorer

We regularly align text with angular lines

0 Likes
Message 5 of 6

hak_vz
Advisor
Advisor

@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

EESignature

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.
0 Likes
Message 6 of 6

dlbsurveysuk
Collaborator
Collaborator

Lee Mac has this https://www.lee-mac.com/dtcurve.html as well as other text alignment routines.

 

Attached -

Modified dtcurve to continuously loop.

Original torient routine.

Komondormrex 2024 torient routine.

0 Likes