求高手:如果读取txt并写出对于的数值
1、首先命令后可选择设置:
a、梁截面宽:200:;250;300等
b、通长面积:12;14;16;18;20;22;25;28等
2、设置完后选择上图并得出最大值。
3、读取TXT中列表对应的数值。
;200是梁截面宽-11是对应的最大值-22是钢筋直径-后面为写出的数值(前三个三种)
200-11-22-3%%13222
200-11-25-2%%13225/2%%13220
200-12-16-6%%132163/3
200-12-18-5%%13218
200-12-20-4%%13220
200-12-22-2%%13222/2%%13218
200-12-25-2%%13225/2%%13220
200-13-18-4%%13218/2%%13216
200-13-20-4%%13220/2%%13216
200-13-20-5%%13220
200-13-22-2%%13222/2%%13220
200-13-22-4%%13222
下面是点取最大值的代码。
(defun c:tqsz( / ts1)
(setq ts1 (cdr (assoc 1 (entget (car (entsel "\n请选取文字图元:")))))
ts1 (vl-string-translate "-" " " ts1)
ts1 (read (strcat "(" (vl-string-translate "G" " " ts1) ")"))
ts1 (apply 'max (vl-remove-if '(lambda (x) (= (numberp x) nil)) ts1))
)
(setq pp ts1)
(setq h 300 an 0)
(command "text" "\\" h an pp)
)
(setq ts2 (grread (setq pp (grread))))
)
还有一条,有些满足前三个条件有几个答案,可以用空格键切换选择。最好能动态显示出来再点位置。我那lisp是点位置才生成文字。
页:
[1]