(defun C:Poly2GeoDIN () (setq datname (getfiled "Geben Sie die LIN-Datei an:" "" "lin" 1)) (setq lindat (open datname "w")) (write-line "1" lindat) (setq en (car (entsel "Polylinie auswählen: "))) (foreach n (plist en) (write-line (strcat (rtos (nth 0 n) 2 6) " " (rtos (nth 1 n) 2 6)) lindat) ) (write-line "END" lindat) (write-line "END" lindat) (close lindat) ) (defun plist ( ename / en entl flag vlist pt Elev) (defun LI_item (n alist)(cdr (assoc n alist))) ;(setq ename (car(entsel))) (setq vlist '() entl (entget ename) en (LI_item 0 entl) ) ;_ end of setq (cond ((= en "LWPOLYLINE") (setq vlist '() Elev (LI_item 38 entl) ) ;_ end of setq (foreach pt entl (if (= (car pt) 10) (setq vlist (cons (list (cadr pt) (caddr pt) Elev) vlist)) ) ;_ end of if ) ;_ end of foreach ) ((= en "SPLINE") (setq vlist (LI_mitem 11 entl)) ) ((= en "POLYLINE") (setq ename (entnext ename) entl (entget ename) en (LI_item 0 entl) vlist '() ) ;_ end of setq (while (= en "VERTEX") (setq flag (LI_item 70 entl)) (if (and (zerop (logand flag 1)) (zerop (logand flag 2)) (zerop (logand flag 8)) ) ;_ end of and (setq pt (LI_item 10 entl) vlist (cons pt vlist) ) ;_ end of setq ) ;_ end of if (setq ename (entnext ename) entl (entget ename) en (LI_item 0 entl) ) ;_ end of setq ) ;_ end of while ) ((= en "LINE") (setq vlist (list (LI_item 10 entl) (LI_item 11 entl))) ) ) ;_ end of cond (if vlist (reverse vlist) nil ) ;_ end of if ) ;_ end of defun