;; --------------------------------------------------------------------------------------------------- ;; ;; -- GET_LAYER : Liest Layerdefinition mit angegebenen Namen aus Zeichnung aus -- ;; ;; -- Ist sie nicht vorhanden wird "nil" zurückgegeben -- ;; ;; --------------------------------------------------------------------------------------------------- ;; (defun GET_LAYER (LAYERNAME / EINTRAG EINTRAG_X DEFINITION ) (if (= (type LAYERNAME) 'STR) ; Parameter o.k.? ; .. dann solange Layer in Zeichnung definiert sind und angegebener noch nicht gefunden ist, .. (while (and (setq EINTRAG (tblnext "LAYER" (null EINTRAG))) (not DEFINITION)) (if (= (strcase (cdr (assoc 2 EINTRAG)))(strcase LAYERNAME)) ; auszulesenden Layer gefunden ? (progn (setq EINTRAG_X (entget(tblobjname "LAYER" (cdr (assoc 2 EINTRAG))))) (setq DEFINITION (list (cdr (assoc 2 EINTRAG )) ; Layername (itoa(abs(cdr (assoc 62 EINTRAG )))) ; Farbe (cdr (assoc 6 EINTRAG )) ; Linientyp (if (> (cdr (assoc 370 EINTRAG_X)) 0) (rtos (/(cdr (assoc 370 EINTRAG_X))100.0) 2 2) ; Linienstärke (rtos (/(getvar "LWDEFAULT") 100.0) 2 2)) (if (< (cdr (assoc 62 EINTRAG )) 0) "aus" "an" ) ; Layer an/ aus (if (= (cdr (assoc 290 EINTRAG_X)) 0) "nein" "ja" ) ; Plot ja/nein (if (= (logand (cdr (assoc 70 EINTRAG )) 1) 1) "ja" "nein" ) ; FROZEN ja/nein (if (= (logand (cdr (assoc 70 EINTRAG )) 4) 4) "ja" "nein" ))) ; LOCKED ja/nein (princ (strcat "\n LAYER : " (nth 0 DEFINITION) "\n FARBE : " (nth 1 DEFINITION) "\n Linientyp : " (nth 2 DEFINITION) "\n Linientyp : " (nth 3 DEFINITION) "\n Layerstatus : " (nth 4 DEFINITION) "\n plotbar : " (nth 5 DEFINITION) "\n gefroren : " (nth 6 DEFINITION) "\n gesperrt : " (nth 7 DEFINITION) "\n --------------------\n")) ) ) ) (princ "\n Fehlerhafter Parametertyp für (GET_LAYER)\n") ) DEFINITION ) ;; --------------------------------------------------------------------------------------------------- ;;