; Copyright 2000 EMT Software, Inc. ; (defun C:XYZOUT (/ #RES #SSET #CNT #IDX #ENT #FN #DL #PT #X #Y #Z) (initget "Points Blocks") (setq #RES (getkword "Type of entities to select [Points/Blocks]: ")) (if (or (not #RES) (= #RES "Points")) (progn (prompt "\nSelect all the Points to be exported: ") (setq #SSET (ssget (list (cons 0 "POINT"))))) (progn (prompt "\nSelect all the Blocks to be exported: ") (setq #SSET (ssget (list (cons 0 "INSERT")))))) (if #SSET (progn (initget "Comma Tab") (setq #DL (getkword "\nType of Delimiter for the export file [Comma/Tab]: ")) (cond ((not #DL) (setq #DL ", ")) ((= #DL "Comma") (setq #DL ", ")) ((= #DL "Tab") (setq #DL "\t")) (T (setq #DL ", "))) (setq #FN (getfiled "Select an Export File" "" "txt" 1) #FN (open #FN "w")) (setq #CNT (sslength #SSET) #IDX 0) (while (/= #IDX #CNT) (setq #ENT (entget (ssname #SSET #IDX)) #PT (cdr (assoc 10 #ENT)) #X (car #PT) #Y (cadr #PT) #Z (caddr #PT)) (write-line (strcat (rtos #X) #DL (rtos #Y) #DL (rtos #Z)) #FN) (setq #IDX (1+ #IDX))) (close #FN))) (princ)) ;;; Uncomment for the language needed. ;(princ "\n\nXYZOUTを入力して開始") ; For Japanese. (princ "\n\nType XYZOUT to start.") ; For English. (princ)