View Full Version : align text to a line.
Chris Matira
2006-02-23, 06:50 AM
anyone got a lisp routine that makes a text align parallel to a line?
i'm having a lot of time spent rotating text to make it parallel to a line.. this would really help...
thanks...
kennet.sjoberg
2006-02-23, 08:01 AM
Here is a simple code in the fly for you to start with
no errorhandler, no user trapping security
just rotate selected text equal to one selected line.
(defun c:AlignText (/ VlaObjLine LinAngle VlaObjText )
(vl-load-com )
(setq VlaObjLine (vlax-ename->vla-object (car (entsel "Select the line : " ))) )
(setq LinAngle (vla-get-Angle VlaObjLine ) )
(while (setq VlaObjText (vlax-ename->vla-object (car (entsel "Select the text : " ))))
(vla-put-Rotation VlaObjText LinAngle )
(vlax-release-object VlaObjText )
)
(vlax-release-object VlaObjLine )
(princ)
)
: ) Happy Computing !
kennet
Chris Matira
2006-02-23, 11:21 AM
thanks kenneth...
boesiii
2006-02-23, 06:04 PM
If you have Express then it has a command that does that also, it's called torient, but it asks for two points to get the rotation angle instead of a line.
vBulletin® v3.6.7, Copyright ©2000-2009, Jelsoft Enterprises Ltd.