;;; Programm zum Berechnung/Addition der Flaechen und Laengen von Objekten, Kreisen, Polygonen und Regionen ;;; Version 1.0 ;;; 22.12.2000 von Thomas Rolf ;;; EMail: Thomas.Rolf@KME.com ;;; für AutoCAD f. Windows Rel. 2000 (deutsch) ;;; ALLE RECHTE VORBEHALTEN ;;; Änderungen: ;;; Datum Ver. Änderung ;;; (defun c:Flaeche (/ Lalle Lpoly Flpoly alle i Flanz ele) (princ "\n® Zur Flächen- / Laengenberechnung ") (setq alle (ssget) Lalle 0 Lpoly 0 Flpoly 0 Flanz 0 i 1 ) (while (<= i (sslength alle)) (princ (strcat "\nObjekt " (rtos i 2 0))) (setq ele (ssname alle (1- i)) typ (cdr (assoc 0 (entget ele)))) (if (OR (= typ "LWPOLYLINE") (= typ "REGION") (= typ "CIRCLE") ) (progn (setq Flanz (1+ Flanz)) (cond ((= typ "LWPOLYLINE") (princ " (Polygon)")) ((= typ "REGION") (princ " (Region)")) ((= typ "CIRCLE") (princ " (Kreis)")) ) (princ "\nLänge: ") (command "_AREA" "_O" ele) (princ (setq Lpoly (+ Lpoly (getvar "PERIMETER")))) (princ " Fläche: ") (princ (setq Flpoly (+ Flpoly (getvar "AREA")))) ) (command "_LENGTHEN" ele "") ) ;ende if (command) (setq Lalle (+ Lalle (getvar "PERIMETER"))) (setq i (1+ i)) ;(command) ) ;ende while (princ "\n.\n.\n® ") (if (/= Flanz (sslength alle)) (progn (princ (strcat (rtos (sslength alle) 2 0) " Objekt(e) gefunden\n Gesamtlaenge Objekt(e)= " (rtos Lalle) ) ) (if (> FLanz 0) (princ "\n® davon ") ) ) ) (if (> FLanz 0) (princ (strcat (rtos FLanz 2 0) " Kreis(e)/Polygon(e)/Region(en) gefunden" "\n Gesamtlänge Kreis(e)/Polygon(e)/Region(en) = " (rtos Lpoly) " ; Fläche = " (rtos Flpoly) ) ) ) (princ) ) ;ende defun (princ "\n...geladen") (princ)