Я использую эту. Работает и в 2002'м
(DEFUN C:XYZPOINT ( / fn ins f bm hi os format input read-point line plist ss)
; Is a utility for use with AutoCAD Release 10 or 11,
; which reads coordinate data from ASCII files in CDF or SDF format,
; and generates AutoCAD geometry using the incoming coordinate data.
; The XYZPOINT command will read coordinate data from an ASCII file,
; and generate either a continuous string of LINES, a POLYLINE, a
; 3DPOLYline, multiple copies of a selected group of objects, or
; AutoCAD POINT entities.
;
; Format:
; Command: XYZPOINT
; File to read: MYFILE.TXT <- ASCII input file
; Comma/Space delimited <Comma>: Comma <- data format
; Generate Copies/Lines/Nodes/3Dpoly/<Pline>: Nodes <- entity to create
; Reading coordinate data...
;
; If you selected "Copies", then XYZPOINT will prompt you to select the
; objects that are to be copied. The basepoint for all copies is the
; current UCS origin (0,0,0). One copy of the selected objects will be
; created for each incoming coordinate, and placed at each coordinate.
;
; A comma-delimited (CDF) ascii file contains one coordinate per line,
; with each component seperated by a comma, like this:
;
; -4.33,0.0,6.3
; 0.322,5.32,0.0
; etc....
;
; There should be no spaces or blank lines in a CDF coordinate data file.
;
; A space-delimited (SDF) ascii file contains one coordinate per line,
; with each component seperated by one or more spaces, like this:
;
; -4.33 0.0 6.3
; 0.322 5.32 0.0
; ...
;
; Coordinate data can be 2D or 3D.
;
; Note that all numeric values must have at least one digit to the left
; and the right of the decimal point (values less than one must have a
; leading 0), and a leading minus sign indicates negative values. This
; applys to both CDF and SDF formats.
; XYZPOINT can generate a continuous chain of LINE entities from your
; coordinate data, where each pair of adjacent lines share a coordinate
; from the file.
; XYZPOINT can also generate a polyline or 3DPOLYline from the coordinate
; data, where each point in the file becomes a vertice of the polyline.
; If the input file contains 3D coordinates, and you specify a polyline,
; then the Z component is ignored and the default of 0.0 is used.
; XYZPOINT will also COPY a selected group of objects, creating one copy
; for each incoming coordinate, and using the coordinate as the absolute
; copy displacement from the CURRENT UCS origin (0,0,0).
;
; Finally, XYZPOINT will generate AutoCAD POINT entities from the data in
; the file. Specify the point size and type prior to invoking XYZPOINT.
(DEFUN CDF (l) (COMMAND "_.SETVAR" "LASTPOINT" l) (GETVAR "LASTPOINT"))
(DEFUN SDF (l) (READ (STRCAT "(" l ")")))
(DEFUN NOZ (p) (LIST (CAR p) (CADR p)))
(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) )
)
; (SETQ fn "~") ; Имя файла по умолчанию
(SETQ fn (GETFILED "Список файлов для чтения" "" "*" 2))
(IF (AND fn (SETQ f (OPEN fn "r"))) ;Есть имя файла и он открыт
(PROGN
(INITGET "Пробел Запятая")
(SETQ format
(COND
((GETKWORD "\nРазделитель - Пробел/Запятая <Пробел>: "))
(T "Пробел")
)
)
(INITGET "Копии Линии Точки 3Мполилиния Полилинию")
(SETQ input
(CDR (ASSOC
(COND
((GETKWORD "\nСоздавать - Копии/Линии/Точки/3Мполилиния/<Полилинию>: "))
(T "Полилинию")
)
'(("Линии" . "_.LINE") ("Копии" . "_.COPY")("Точки" . "_.POINT")
("Полилинию" . "_.PLINE")("3Мполилиния" . "_.3DPOLY"))
)
)
)
(SETQ read-point (COND ((EQ format "Запятая") CDF) (T SDF)))
(SETVAR "CMDECHO" 0)
(SETQ bm (GETVAR "BLIPMODE"))
(SETQ hi (GETVAR "HIGHLIGHT"))
(SETQ os (GETVAR "OSMODE"))
(SETVAR "BLIPMODE" 0)
(SETVAR "OSMODE" 0)
(PRINC "\nЧтение координат...")
(WHILE (SETQ line (READ-LINE f))
(COND
((SETQ line (STRTRIM line))
(SETQ line (READ-POINT line))
(SETQ plist
(APPEND plist
(COND
((EQ input "_.PLINE") (LIST (NOZ line)))
(T (LIST line))
)
)
)
)
)
)
(CLOSE f)
(PRINC "\nЧтение координат закончено!")
(COND
((EQ input "_.POINT")
(SETVAR "HIGHLIGHT" 0)
(COMMAND "_.POINT" "0,0,0" "_.COPY" (SETQ ss (ENTLAST)) "" "_M" "0,0,0")
(APPLY 'COMMAND plist) (COMMAND)
(ENTDEL ss)
)
((EQ input "_.COPY")
(PRINC "\nВыберите объекты для копирования:")
(WHILE (NOT (SETQ ss (SSGET)))
(PRINC "\nОбъекты не выбраны!")
(PRINC " Выберите объекты для копирования:")
)
(SETQ ins (GETPOINT "Укажите точку вставки копируемых объектов:"))
(SETVAR "HIGHLIGHT" 0)
(COMMAND "_.COPY" ss "" "_M" ins)
(APPLY 'COMMAND plist)
(COMMAND)
)
(T (COMMAND input) (APPLY 'COMMAND plist) (COMMAND))
)
(PRINC "\nНанесение точек закончено!")
(SETVAR "HIGHLIGHT" hi)
(SETVAR "BLIPMODE" bm)
(SETVAR "OSMODE" os)
);end PROGN
(PRINC "\nНе могу открыть файл для чтения координат.")
);end IF
(PRIN1)
)