When zoomed in close to the line for placing the text, the text is placed correctly. If zoomed out the text is not placed as per the routine.
Why does zoomed in make a difference, and how can I fix it.
I always want (setq pnt2 (polar pnt1 (+ ang1 2) 3)) to work.
Thanks
(defun RTIT (/ rline firstendpnt secondendpnt pnt1 pnt2 ang1 txt agl ang angd xx)
(setvar "CMDECHO" 0)
(setvar "OSMODE" 512)
(setq rline (entsel "\n* Pick Roof Line: ")
firstendpnt (trans (cdr (assoc 10 (entget (car rline)))) 0 1)
secondendpnt (trans (cdr (assoc 11 (entget (car rline)))) 0 1)
ang1 (angle firstendpnt secondendpnt)
pnt1 (arch:mid firstendpnt secondendpnt)
)
(if (and (<= ang1 4.71239)(> ang1 1.5708))(setq ang1 (angle secondendpnt firstendpnt)))
(setq pnt2 (polar pnt1 (+ ang1 2) 3))
(command "_.text" "j" "bc" pnt2 "" 0 (strcase ITEM))
(setq AG (angle firstendpnt secondendpnt))
(if (and (<= ang1 4.71239)(> ang1 1.5708))(setq ang1 (angle secondendpnt firstendpnt)))
(setq AGL (car (list (cons 50 ang1))))
(setq N 0)
(setq TXT (ssget "L"))
(repeat (sslength TXT)
(setq
Elist (subst AGL (assoc 50 (entget (ssname TXT N))) (entget (ssname TXT N))))
(entmod Elist)
(entupd (ssname TXT N))
(setq N (+ N 1)))
(princ))
(defun C:RT ()
; (ARCH:F_S-VAR)
; (cond ((= ARCH#CLAY "Off") (ARCH:LYR "A-ROOF-NOTE")))
; (ARCH:SET-ARIAL)
(initget 7 "G H R K V E")
(setq TYP (getkword "\n* Select: [Gable, Hip, Ridge, raKe, Valley, Enter text: ] *"))
(cond ((= TYP "G") (setq ITEM "GABLE"))
((= TYP "H") (setq ITEM "HIP"))
((= TYP "R") (setq ITEM "RIDGE"))
((= TYP "K") (setq ITEM "RAKE"))
((= TYP "V") (setq ITEM "VALLEY"))
((= TYP "E") (setq ITEM (getstring 1 "\n* Type in text: ")))
)
(while (/= (getvar "cmdactive") 1)(RTIT))
; (ARCH:F_R-VAR)
(princ)
)