;;;Written By : Peter Jamtgaard
(defun C:ATX ()
(princ "\n* Select Dtext to be Aligned: *")
(setq SSET (ssget))
(princ "\n* Enter [V]ertical or [H]orizontal : *")
(setq PROMPT1 (strcase (substr (getstring) 1 1)))
(princ "* Pick alignment point: *")
(setq PT1 (getpoint))
(if (or (= PROMPT1 "H") (= PROMPT1 ""))
(setq YLOC (cadr PT1)
PROMPT1 "H"
)
(setq XLOC (car PT1)
PROMPT1 "V"
)
)
(setq C 0)
(repeat (sslength SSET)
(setq ENT (ssname SSET C))
(if (/= ENT nil)
(progn
(setq ED (entget ENT))
(setq TYPE1 (cdr (assoc 0 ED)))
(if (or (= TYPE1 "INSERT") (= TYPE1 "TEXT"))
(progn
(if (= PROMPT1 "H")
(progn
(setq INSP (cdr (assoc 10 ED)))
(setq YLOC2 (cadr INSP))
(command "move"
ENT
""
"0,0"
(strcat "@0," (rtos (- YLOC YLOC2) 2 4))
)
)
(progn (setq INSP (cdr (assoc 10 ED)))
(setq XLOC2 (car INSP))
(command
"move"
ENT
""
"0,0"
(strcat "@" (rtos (- XLOC XLOC2) 2 4) ",0")
)
)
)
)
)
)
)
(setq C (+ C 1))
)
)

(c:atx)

Advertisements