用lisp读取txt文件
闭合多段线的填充调用 能否把读取调用的两个文件合并成一个单一的文件 并读取 调用 成功合并 调用
(defun c:ttb()
(setvar "cmdecho" 0)
(setvar "osmode" 0)
(setq xb (getreal "\n输入线性比例<1>"))
(setq hlst '())
(setq cf (open "c:\\LSPTOOLS\\tba.txt" "r"))
(setq sele (read-line cf))
(while sele
(setq hlst (cons sele hlst))
(setq sele (read-line cf))
)
(close cf)
(setq data_list '())
(setq ff (open "c:\\LSPTOOLS\\ttch.txt" "r"))
(setq data (read (read-line ff)))
(while data
(setq data (* xb data))
(setq data_list (cons data data_list))
(setq data (read (read-line ff)))
)
(close ff)
(if (setq ss (ssget '((0 . "*POLYLINE"))))
(progn
(setq i -1)
(command "layer" "m" "填充" "c" "52" "" "")
(repeat (sslength ss)
(setq en (ssname ss (setq i (1+ i))))
(setq huame (nth (rem i 16) hlst))
(setq bl (nth (rem i 16) data_list))
(command "_bhatch" "p" huame bl "0" "s" en "" "")
)
(prin1)
)
)
)
页:
[1]