test the routine please: texts with justification to the right, this correct, texts with justification to the left ERROR
as are the problem? thanks
(defun C:muevetexto ()
(command "undo" "mark")
(setq OLDORTHO (getvar "ORTHOMODE")
OLDOSMODE (getvar "OSMODE")
)
(setvar "ORTHOMODE" 0)
(setvar "OSMODE" 0)
(princ "\n Osnap & Ortho have been turned off")
(setq TOLINE (entsel "\n Pick line to move to: "))
(setq TOLINEELIST (entget (car TOLINE)))
(redraw (car TOLINE) 3)
(setq TOLINEENDPT1 (cdr (assoc 10 TOLINEELIST))
TOLINEENDPT2 (cdr (assoc 11 TOLINEELIST))
)
(setq ss nil)
(prompt "\nPick the Text to Align:")
(setq ss (ssget))
(if ss
(progn
(setq c 0)
(repeat (sslength ss)
(setq text_ent (ssname ss c))
(setq txt (entget text_ent))
(setq just (cdr (assoc 72 txt))); justification
(if (/= just 0)
(setq ip (cdr (assoc 11 txt))); Right end
(setq ip (cdr (assoc 10 txt))); present location
); if
(setq ip0 (cdr (assoc 10 txt)))
(setq ip1 (cdr (assoc 11 txt)))
(setq INTPT (inters TOLINEENDPT1 TOLINEENDPT2 ip0 ip1 nil))
;(command "change" text_ent "" INTPT "" "" "" "")
;(setq np (polar ip (angle IP RX) DX))
(command "_move" text_ent "" ip INTPT)
(setq c (+ c 1))
); repeat
); progn
); if
(redraw (car TOLINE) 4)
(setvar "ORTHOMODE" OLDORTHO)
(setvar "OSMODE" OLDOSMODE)
(princ "\n Osnap & Ortho have been restored ")
(princ)
); function