ich habe dir das mal etwas überarbeitet:
(defun c:md_fla (/ t_2 Ss)
(setq Ss nil
t_2 nil
) ;_ end of setq
(setq Ss (ssget '((0 . "*POLYLINE"))))
(setq md_zaehler 0)
(setq gesamt 0)
(if (not Ss)
(princ (strcat "\nDa waren keine Polylinien dabei."))
(progn
(while (setq t_2 (ssname Ss 0))
(setq md_in (cdr (assoc 10 (entget t_2))))
(setq startp md_in)
(command "_.area" "_o")
(command t_2)
(entmake (LIST
'(0 . "TEXT")
(cons 8 (getvar "clayer"))
(CONS 10 startp)
'(40 . 0.35)
'(50 . 0)
(CONS 1 (rtos (getvar "area") 2 2))
) ;_ ende von LIST
) ;_ end of entmake
(setq Ss (ssdel t_2 Ss))
(princ md_zaehler)
(setq md_zaehler (1+ md_zaehler))
(setq einzel (atof (rtos (getvar "area") 2 2)))
(setq gesamt (+ gesamt einzel))
) ;ende while
(princ
(strcat "\n*****Gesamtfläche: " (rtos gesamt 2 2) " qm")
) ;_ end of princ
(if(setq start (getpoint "\nEinfügepunkt:"))
(entmake (LIST
'(0 . "TEXT")
(cons 8 (getvar "clayer"))
(CONS 10 start)
'(40 . 0.35)
'(50 . 0)
(CONS 1 (strcat "Gesamtfläche: " (rtos gesamt 2 2) "qm"))
) ;_ ende von LIST
) ;_ end of entmake
)
) ;endprogn
) ;endif
(princ)
)
------------------
Gruß
CADwiesel
Besucht uns im CHAT
Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP