;; Koordinaten einlesen (defun C:KoorL ( / f bm hi format input read-point line plist bk dph ss wl p punkt x y) (if (= (getvar "userr2") 0) (setvar "userr2" 1)) (setvar "ATTDIA" 0) (setvar "osmode" 0) ;;; Objektfang ausschalten (cond ( (eq "" (setq f (getfiled "Koordinatendatei auswählen..." "" "" 4)))) ( (not (setq f (open f "r"))) (princ "\nkann File nicht öffnen.")) (t (setq format "s") (setq input ".point") (setq read-point (cond ( (eq format "Comma") cdf) (t sdf))) (setvar "cmdecho" 0)(setq anz 1) (princ "\nlese Koordinaten aus Datei...") (while (setq line (read-line f)) (cond ( (setq line (strtrim line)) (setq line (read-point line)) (setq wl (car line)) (setq punkt (car (cdr line))) (setq xw (car (cdr (cdr line)))) (setq ywert (car (cdr (cdr (cdr line))))) (setq zwert (car (cdr (cdr (cdr (cdr line)))))) (setq z "0") (setq xwert xw) (setq anz (+ 1 anz)) (setq x (rtos xwert 2)) (setq xx (rtos xw 2)) (setq y (rtos ywert 2)) (if (> zwert 0) (setq z (rtos zwert 2))) (setvar "luprec" 0) (setq p (rtos punkt)) (setvar "luprec" 3) (setq xy (strcat x "," y)) (setq koord (strcat xx "," y "," z)) (if (= wl 1) ((command "-layer" "se" "0_SP_Hilfe" "") (command "_insert" "MD-Koord.dwg" koord (getvar "USERr2") (getvar "USERr2") "0" p z))) (if (= wl "BK") ((command "-layer" "se" "0_SP_BK" "") (command "_insert" "BK_Att.dwg" koord (getvar "USERr2") (getvar "USERr2") "0" (strcat "BK " p) ""))) (if (= wl "BS") ((command "-layer" "se" "0_SP_BS" "") (command "_insert" "BS_Att.dwg" koord (getvar "USERr2") (getvar "USERr2") "0" (strcat "BS " p) ""))) (if (= wl "DPH") ((command "-layer" "se" "0_SP_DPH" "") (command "_insert" "DPH_Att.dwg" koord (getvar "USERr2") (getvar "USERr2") "0" (strcat "DPH " p) ""))) (if (= wl "CPT") ((command "-layer" "se" "0_SP_CPT" "") (command "_insert" "CPT_Att.dwg" koord (getvar "USERr2") (getvar "USERr2") "0" (strcat "CPT " p) ""))) (if (= wl "SCH") ((command "-layer" "se" "0_SP_SCHURF" "") (command "_insert" "SCH_Att.dwg" koord (getvar "USERr2") (getvar "USERr2") "0" (strcat "SCH " p) ""))) )))) (close f) ) (princ "\nAnzahl gelesener Punkte: ") (princ (1- anz)) (princ) ); ende cond (princ "\n Koordinaten Einlesen wurde installiert...\n") (defun strtrim (s) (while (eq " " (substr s 1 1)) (setq s (substr s 2))) (while (eq " " (substr s (strlen s))) (setq s (substr s 1 (1- (strlen s))))) (cond ( (eq s "") nil)(t s)))