(setvar "cmdecho" 0)(prompt "\nDIN-Bemassung 2 ...... ")(DEFUN g-txk3 (ab / du df fk tx)
 (setq du (atoi (rtos g_l 2 0)) df 0)(while (and (< df 0.05)(>= du (getvar "LUPREC")))(setq fk (* (abs ab) g_g (expt 10.0 (- du 1)))
 df (abs (- fk (fix (+ fk 0.5)))) du (- du 1)))(setq tx (rtos (abs (* ab g_g)) (getvar "LUNITS") (+ du 1) )))(prompt ".")(DEFUN C:g-MASr ( / p0 p1 pm)
(g_sv) (setq p0 (g_in nil "\nBogenpunkt fr Masspfeil :" (list 0 0 0 512 "NAE")) pm (osnap p0 "ZEN")
 p1 (g_in p0 "\nRichtung fr Text :" (list 0 0 0))) (g_se) (if (and (/= p0 nil)(/= pm nil))(g-mar p0 p1 pm)) (g_un) (princ))(prompt ".")
(DEFUN g-mar ( pr p1 pm / y d  ag a9 a18 a27 ab ho br rg t1 i tl y d tx)(command "LAYER" "SETZ" (nth 5 v-lay) "")(g_se)
 (setq ag (angle pm pr) rg (* (/ ag pi) 180.) a9 (+ ag (* pi 0.5)) a18 (+ ag pi) a27 (+ a9 pi) ab (distance pm pr)  ho (* g_f 3.5) br (* ho 0.8) 
 tx (strcat "R" (g-txk3 ab)) t1 (g_in tx "\nBemassungs-Text:" "") I (SEARC "<>" t1))(if (> i 1)(setq i (- i 1)))
(if (> i 0)(setq tx (strcat (substr t1 1 i) tx))(setq tx t1))(setq tl (strlen tx) ) (IF (< (distance p1 pm) ab)(progn(SETQ Y 0 d ab)
(if (> d (* 25.0 g_f))(setq d (* g_f 25.0)))(if (< d (* tl br))(setq d (+ (* tl br) br br)))(COMMAND "LINIE" pr (polar pr (angle pr pm) d) "")
(if (and (< ag 4.72)(> ag 1.58)) (COMMAND "TEXT" (polar (polar pr a27 g_f) a18 (* 2. br)) ho (+ rg 180) tx)
 (COMMAND "TEXT" "R" (polar (polar pr a9 g_f) a18 (* 2.0 br)) ho rg tx))
(entmod (subst (cons 8 (nth 6 v-lay))(assoc 8 (entget (entlast)))(entget (entlast)))))(progn(SETQ Y 180)
(if (> ab (* 5.0 g_f))(COMMAND "LINIE" pr)(command "LINIE" pm))(command (polar pr ag (* tl br)) "" )(if (and (< ag 4.72)(> ag 1.58))
 (COMMAND "TEXT" "R" (polar (polar pr ag br) a27 g_f) ho (+ rg 180) tx) (COMMAND "TEXT" (polar (polar pr ag br) a9 g_f) ho rg tx))
(entmod (subst (cons 8 (nth 6 v-lay))(assoc 8 (entget (entlast)))(entget (entlast))))))
(COMMAND "EINFGE" (strcat pfad "din359") pr g_f g_f (+ rg 180 y)))(prompt ".")(princ)
