From d82278ccc5974313fa5bf77631627d700c94e681 Mon Sep 17 00:00:00 2001 From: VitalGG Date: Tue, 24 Dec 2024 21:10:54 +0800 Subject: [PATCH] free at-math --- at-math/mark-in-zone.lsp | 4 +- at-math/matrix.lsp | 40 ++++++++--------- at-math/pkg.lsp | 2 +- at-math/stat.lsp | 88 +++++++++++++++++++------------------- at-math/tools-math.lsp | 92 ++++++++++++++++++++-------------------- at-math/unit-number.lsp | 2 +- 6 files changed, 114 insertions(+), 114 deletions(-) diff --git a/at-math/mark-in-zone.lsp b/at-math/mark-in-zone.lsp index 63d1d0d..1518f5e 100644 --- a/at-math/mark-in-zone.lsp +++ b/at-math/mark-in-zone.lsp @@ -35,7 +35,7 @@ 3))))) (defun @math:mark-in-lwpl (/ ent-nums) - (@:help '("区域标数:筛分多段线区域中的最大最小数,大数用红圈,小数用绿圈。")) + (@::prompt '("区域标数:筛分多段线区域中的最大最小数,大数用红圈,小数用绿圈。")) (setq zone (pickset:to-list (ssget (list '(0 . "lwpolyline") (cons 8 (@:get-config '@math:layer-of-zone)))))) (foreach @@ -44,7 +44,7 @@ (ssget "wp" (curve:get-points lwpl) '((0 . "text"))))) (@math:mark-in-ss ent-nums)))) (defun @math:mark-in-w () - (@:help '("筛分框选的最大最小数,大数用红圈,小数用绿圈。")) + (@::prompt '("筛分框选的最大最小数,大数用红圈,小数用绿圈。")) (if (setq ent-nums (pickset:to-list (ssget '((0 . "text"))))) (@math:mark-in-ss ent-nums)) diff --git a/at-math/matrix.lsp b/at-math/matrix.lsp index fdc0703..cb21b02 100644 --- a/at-math/matrix.lsp +++ b/at-math/matrix.lsp @@ -1,14 +1,14 @@ (defun @m:get-value (en0) (atof (entity:getdxf en0 1))) (defun @m:align-number (matrix-num) - "Сλ" + "按小数位对齐" (mapcar '(lambda (x) (list (strlen (itoa (fix(apply 'max x)))) (apply 'max (mapcar '(lambda(m)(- (strlen (vl-string-right-trim "0" (rtos(- m (fix m)) 2 5))) 2)) x)))) (matrix:trp matrix-num) )) (defun @m:form-matrix (entlist-text / fontsize row column result matrix) - "ѡһ֣γо" + "选择一组行列文字,形成行列矩阵。" (setq fontsize (entity:getdxf (car entlist-text) 40)) (setq matrix nil row (list (car entlist-text))) (foreach en% (cdr entlist-text) @@ -16,7 +16,7 @@ (cadr (entity:getdxf en% 10)) fontsize) (setq row (append row (list en% ))) - (progn ;; ͬһУУС + (progn ;; 不在同一行,加入列;清行。 (setq matrix (append matrix (list row))) (setq row (list en%))))) (setq matrix (append matrix (list row))) @@ -30,11 +30,11 @@ (if (apply '= (mapcar 'length matrix)) (mapcar '(lambda(x)(mapcar '@m:get-value x)) matrix) - (progn (alert "ʧܣȷж롣") nil) + (progn (alert "分析失败,请确认行列对齐。") nil) ) ) -;; (@:add-menu "ѧ" "м" "(@m:matrix-cal)") +;; (@:add-menu "数学" "行列计算" "(@m:matrix-cal)") (defun @m:sort-by-x (ss-lst) (vl-sort ss-lst '(lambda (x y) (> (car (entity:getdxf x 10)) @@ -44,12 +44,12 @@ (> (cadr (entity:getdxf e1 10)) (cadr (entity:getdxf e2 10)))))) (defun @m:matrix-cal (/ fontsize cal-symble number-matrix ss i% res-matrix) - (@:help (strcat "ѡһжݣÿн㣬õ")) + (@::prompt (strcat "选择一组行列对齐的数据,按输入的运算符对每行进行运算,得到结果表。")) (initget 1 "+ - * /") - (setq cal-symble (getkword " (+ - * /): ")) + (setq cal-symble (getkword "请输入运算符 (+ - * /): ")) (setq entlist-text (pickset:to-entlist (ssget '((0 . "text"))))) ;; remove non-real&int - ;; + ;; 排序 (setq fontsize (entity:getdxf (car entlist-text) 40)) (setq entlist-text (vl-sort entlist-text @@ -70,10 +70,10 @@ (mapcar '(lambda (x) (apply (read cal-symble) x)) number-matrix) ) (defun @m:get-entmatrix () - (prompt "ѡݽ϶ʱݷʱϳĵȴ...") + (prompt "当选择的数据较多时,数据分析用时较长,请耐心等待...") (setq entlist-text (pickset:to-list (ssget '((0 . "text"))))) ;; remove non-real&int - ;; + ;; 排序 (setq fontsize (entity:getdxf (car entlist-text) 40)) (setq entlist-text (vl-sort entlist-text @@ -89,9 +89,9 @@ T nil) ))))) -(@:add-menu "ѧ" "" "(@m:menu-calc-matrix)") +(@:add-menu "数学" "行列运算" "(@m:menu-calc-matrix)") (defun @m:menu-calc-matrix (/ *error* result dcl-tmp dcl-fp dcl_id matrix-num num-format column-id) - "м,Զʽм㡣" + "多列计算,自定公式进行计算。" (defun *error* (msg) (if (= 'file (type dcl-fp)) (close dcl-fp)) (vl-file-delete dcl-tmp) @@ -114,12 +114,12 @@ (setq dcl-fp (open dcl-tmp "w")) (write-line "calc :dialog{label=\"Calc\";:spacer{}:column{" dcl-fp) (foreach str% (list - ":edit_box{label=\"ʽ:\";key=\"formula\";}" - ":text{label=\"֧: + - * / ^ %() ( ) [ ] { } \";}" - ":text{label=\"֧Ǻ: sin cos tan ctan asin acos atan \";}" - ":text{label=\"ָ֧߽׺: ln lg sqr e(Ȼָŷ) \";}" - ":text{label=\"ʾ: sin(A)+B-2*C , A*B-C+2*D \";}" - ":text{label=\" A B C D F Укû E T Ϊ E ŷ, T 档 \";}" + ":edit_box{label=\"公式:\";key=\"formula\";}" + ":text{label=\"支持运算符: + - * / ^ %(求余) ( ) [ ] { } \";}" + ":text{label=\"支持三角函数: sin cos tan ctan asin acos atan \";}" + ":text{label=\"支持高阶函数: ln lg sqr e(自然指数、欧拉数) \";}" + ":text{label=\"示例: sin(A)+B-2*C , A*B-C+2*D \";}" + ":text{label=\" A B C D F 代表列,列号没有 E T ,因为 E 代表欧拉数, T 代表真。 \";}" ":image{ height=0.1; color=1; fixed_height=true;}" ":text{key=\"title\";}" @@ -163,7 +163,7 @@ (@m:draw) ) (setq @m:*result* nil) -(@:add-menu "ѧ" "дͼ" "(@m:draw)") +(@:add-menu "数学" "结果写图" "(@m:draw)") (defun @m:draw (/ pt1 pt-base ents *error*) (defun *error*(msg) (if ents @@ -208,4 +208,4 @@ )))) (if ents (ui:dyndraw ents pt-base) - (@::prompt "ûзּ"))) + (@::prompt "没有发现计算结果。"))) diff --git a/at-math/pkg.lsp b/at-math/pkg.lsp index a33249e..38a6576 100644 --- a/at-math/pkg.lsp +++ b/at-math/pkg.lsp @@ -2,7 +2,7 @@ (:FULL-NAME . "@lisp数学工具") (:AUTHOR . "VitalGG") (:EMAIL . "vitalgg@gmail.com") - (:VERSION . "1.0.51") + (:VERSION . "1.0.52") (:DESCRIPTION . "可操作单行文本,基本数学运算,求和求积(支持天正文本),批量四则运算,插序号、统计图元、行列运算等功能。") (:CATEGORY . "通用") (:URL . "http://atlisp.cn") diff --git a/at-math/stat.lsp b/at-math/stat.lsp index e68e24d..fd0fe0d 100644 --- a/at-math/stat.lsp +++ b/at-math/stat.lsp @@ -1,29 +1,29 @@ -(@:add-menu "ͳ" "ͼ" "(@:stat-block-by-name)") -(@:add-menu "ͳ" "" "(@:menu-stat-block-by-attribute)") -(@:add-menu "ͳ" "̬" "(@:menu-stat-block-by-properties)") -(@:add-menu "ͳ" "ı" "(@:menu-stat-text)") -(@:add-menu "ͳ" "" '(at-math:sumtxt)) -(@:add-menu "ͳ" "ͼԪͳ" "(@math:stat-entity-gui)") -(@:add-menu "ͳ" "ͼԪɫ" "(@math:stat-color)") -(@:add-menu "ͳ" "豸" "(@stat:telec-equip)") -(@:add-menu "ͳ" "򰴲" "(@stat:region-by-layer)") -(@:add-menu "ͳ" "--" "--") -(@:add-menu "ͳ" "" "(stat:print)") -(@:add-menu "ͳ" "ƽ" "(stat:draw)") -;;(@:add-menu "ͳ" "" "(@:stat-block-by-attribute)") +(@:add-menu "统计" "图块名" "(@:stat-block-by-name)") +(@:add-menu "统计" "块属性" "(@:menu-stat-block-by-attribute)") +(@:add-menu "统计" "动态块特性" "(@:menu-stat-block-by-properties)") +(@:add-menu "统计" "单行文本" "(@:menu-stat-text)") +(@:add-menu "统计" "文数汇总" '(at-math:sumtxt)) +(@:add-menu "统计" "图元统计" "(@math:stat-entity-gui)") +(@:add-menu "统计" "图元颜色" "(@math:stat-color)") +(@:add-menu "统计" "电气设备" "(@stat:telec-equip)") +(@:add-menu "统计" "面域按层" "(@stat:region-by-layer)") +(@:add-menu "统计" "--" "--") +(@:add-menu "统计" "输出结果" "(stat:print)") +(@:add-menu "统计" "绘制结果" "(stat:draw)") +;;(@:add-menu "统计" "块属性" "(@:stat-block-by-attribute)") (defun @:stat-block-by-name () - "ͳѡпĿ" - (setq @:tmp-stat-result ;; ͳƽ - (stat:stat ;; ͳƺ + "统计选中块的块名及数量。" + (setq @:tmp-stat-result ;; 统计结果 + (stat:stat ;; 统计函数 (mapcar (function - (lambda (x) ;; ѡбȡҪͳƵ - (block:get-effectivename x))) ;; ʾ: ͼԪȡͼ - (pickset:to-list (ssget '((0 . "insert"))))))) ;; ҪͳƵͼԪ + (lambda (x) ;; 匿名函数:从选择集列表中取出要统计的项。 + (block:get-effectivename x))) ;; 示例: 从图元取出图名。 + (pickset:to-list (ssget '((0 . "insert"))))))) ;; 要统计的图元。 (if @:tmp-stat-result (stat:draw)) ) (defun @:stat-block-by-attribute (attribute-name block-name) - "ͳѡеָеijһԵֵ" + "统计选中的指定块名中的某一属性的值及数量。" (setq @:tmp-stat-result (stat:stat (mapcar (function @@ -36,12 +36,12 @@ ) (defun @:menu-stat-block-by-attribute (/ blk-name attribute-name) - (setq blk-name (getstring "ҪͳƵĿ:")) - (setq attribute-name (getstring "ҪͳƵĿԵ:")) + (setq blk-name (getstring "请输入要统计的块名称:")) + (setq attribute-name (getstring "请输入要分类统计的块属性的名称:")) (@:stat-block-by-attribute attribute-name blk-name)) (defun @:stat-block-by-properties (prop-name block-name) - "ͳѡеָеijһ̬Եֵ" + "统计选中的指定块名中的某一动态块特性的值及数量。" (setq @:tmp-stat-result (stat:stat (mapcar (function @@ -53,13 +53,13 @@ (if @:tmp-stat-result (stat:draw))) (defun @:menu-stat-block-by-properties (/ blk-name prop-name) - (setq blk-name (getstring "ҪͳƵĿ:")) - (setq prop-name (getstring "ҪͳƵĶ̬Ե:")) + (setq blk-name (getstring "请输入要统计的块名称:")) + (setq prop-name (getstring "请输入要分类统计的动态块特性的名称:")) (@:stat-block-by-properties prop-name blk-name)) (defun @:stat-entity (stat-item ssfilter) - "stat-item: ͳĿ(dxf ͼ Ϊ8 ); ssfilter ѡ񼯹" + "stat-item: 统计项目(dxf 组码比如图层 为8 ); ssfilter 选择集过滤" (setq @:tmp-stat-result (stat:stat (mapcar (function @@ -69,8 +69,8 @@ (if @:tmp-stat-result (stat:draw))) (defun @math:stat-color (/ ents) - "stat-color: ͳʵɫ" - (prompt "ѡͼԪ:") + "stat-color: 统计实体的颜色" + (prompt "请选择图元:") (setq ents (pickset:to-list (ssget ))) (setq @:tmp-stat-result (stat:stat @@ -81,9 +81,9 @@ (if @:tmp-stat-result (stat:draw))) (defun @math:stat-entity-gui (/ name dxf) - (@:help "ҪͳĿͳѡеѡ񼯡") + (@::prompt "根据需要的统计项目统计选中的选择集。") (setq dxf nil) - (setq name (ui:select "ѡҪͳƵ" (mapcar 'cdr dxf-common))) + (setq name (ui:select "请选择要统计的项" (mapcar 'cdr dxf-common))) (foreach n% dxf-common (if (= name (cdr n%)) (setq dxf (car n%)))) @@ -91,7 +91,7 @@ (@:stat-entity dxf nil))) (defun @:menu-stat-text (/ ssfilter) - (setq strfilter (getstring "ıͨ(ʾ GBZ* ?BZ* LL*): ")) + (setq strfilter (getstring "请输入文本通配符(示例 GBZ* ?BZ* LL*): ")) (if (/= "" strfilter) (setq ssfilter (list '(0 . "TEXT,TCH_TEXT") (cons 1 strfilter))) (setq ssfilter (list '(0 . "TEXT,TCH_TEXT")))) @@ -104,30 +104,30 @@ (if @:tmp-stat-result (stat:draw))) (defun @stat:telec-equip () - (@:help (strcat - "ͳƵ豸豸顣")) - (setq @:tmp-stat-result ;; ͳƽ - (stat:stat ;; ͳƺ + (@::prompt (strcat + "统计电气设备。用于天正电气带计算机名的设备块。")) + (setq @:tmp-stat-result ;; 统计结果 + (stat:stat ;; 统计函数 (mapcar (function - (lambda (x) ;; ѡбȡҪͳƵ + (lambda (x) ;; 匿名函数:从选择集列表中取出要统计的项。 (car (string:to-list (block:get-effectivename x) "(") - ))) ;; ʾ: ͼԪȡͼ + ))) ;; 示例: 从图元取出图名。 (pickset:to-list (ssget '((0 . "insert")(2 . "*$equip*"))))))) (if @:tmp-stat-result (stat:draw))) (if (null dxf-common) (setq dxf-common - '((0 . "ͼԪ") - (8 . "ͼ") - (6 . "") - (62 . "ɫ") - (48 . "ͱ") - (40 . "뾶")))) + '((0 . "图元类型") + (8 . "图层") + (6 . "线型") + (62 . "颜色号") + (48 . "线型比例") + (40 . "半径")))) (defun @stat:region-by-layer () - (@:help (strcat "ͬͼͳ")) + (@::prompt (strcat "按不同的图层统计面域的面积。")) (setq @:tmp-stat-result (stat:classify (mapcar (function diff --git a/at-math/tools-math.lsp b/at-math/tools-math.lsp index 5bc3e7b..5e8f4bb 100644 --- a/at-math/tools-math.lsp +++ b/at-math/tools-math.lsp @@ -1,20 +1,20 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;; vitaltools -- Ψ߼ +;;; vitaltools -- 唯他工具集 ;;; Author: VitalGG -;;; Description: AutoLisp/VisualLisp Ļͼ߼ +;;; Description: 基于 AutoLisp/VisualLisp 开发的绘图工具集 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;; DWGļеĵıѧ -(@:define-config '@math:layer-of-zone "" "ʾĶڵͼ") -;;; -;;;˷ +;;; DWG文件中的单行文本的数学运算 +(@:define-config '@math:layer-of-zone "柱" "表示区域的多段线所在的图层") +;;; 数字求和 +;;;过滤非数字 (defun filter-num(str / tmp) (if (setq tmp (car (vl-remove-if-not 'string:numberp (string:auto-split str)))) (atof tmp))) -(@:add-menu "ѧ" "" "(@m:text-sum)") +(@:add-menu "数学" "∑求和" "(@m:text-sum)") (defun @m:text-sum ( / s1 si% ti% ename total ) - (@:help - "ֵıĺִ֧͡ıı") - (prompt "ѡһֵı") + (@::prompt + "求多个数字单行文本的和。支持纯单行文本和天正文本。") + (prompt "请选择一个或多个数字单行文本") (setq s1 (pickset:to-list (ssget '((0 . "text,tch_text"))))) (setq total (apply '+ (mapcar '(lambda(x)(filter-num(entity:getdxf x 1))) s1))) (print (setq @m:*result* total)) @@ -23,12 +23,12 @@ ) ;;;;;;;;;;;;;;;;;;;;;;;; -;;; -(@:add-menu "ѧ" "" "(@m:text-mul)") +;;; 数字求积 +(@:add-menu "数学" "∏求积" "(@m:text-mul)") (defun @m:text-mul ( / s1 ti% ename total ) - (@:help - "ֵıĻֵ֧ıı") - (prompt "ѡһֵı") + (@::prompt + "求多个数字单行文本的积。支持单行文本和天正文本。") + (prompt "请选择一个或多个数字单行文本") (setq s1 (pickset:to-list (ssget '((0 . "text,tch_text"))))) (setq total (apply '* (mapcar '(lambda(x)(filter-num (entity:getdxf x 1))) s1))) @@ -37,12 +37,12 @@ (princ) ) ;;;;;;;;;;;;;;;;;;;;;;;; -;;; -(@:add-menu "ѧ" "ֵ" "(@m:avg)") +;;; 数字求积 +(@:add-menu "数学" "算术均值" "(@m:avg)") (defun @m:avg ( / s1 ti% ename total ) - (@:help - "ֵıֵֵ֧ıı") - (prompt "ѡһֵı") + (@::prompt + "求多个数字单行文本的算术均值。支持单行文本和天正文本。") + (prompt "请选择一个或多个数字单行文本") (setq s1 (pickset:to-list (ssget '((0 . "text,tch_text"))))) (setq total (apply '+ (mapcar '(lambda(x)(filter-num (entity:getdxf x 1))) s1))) (print (setq @m:*result* (/ total (length s1)))) @@ -50,19 +50,19 @@ (princ) ) (defun @:probe-int (str) - "һֵַȡ" + "分析一个字符串数值,如果是整数则取整。" (if (= 0 (atoi (last (@:string-to-list str ".")))) (car (@:string-to-list str ".")) str)) ;;;;;;;;;;;;;;;;;;;;;;; -;;ıɸѡ -(@:add-menu "ѧ" "ɸѡ" "(@m:sx)") +;;文本数据筛选 +(@:add-menu "数学" "数据筛选" "(@m:sx)") (defun @m:sx ( / minnum1 s1 ti% ename e ) - (@:help - "ɸѡ,ȻҪɸֵ,ɺѡɫ") - (setq minnum1 (getint "Ҫɸֵֵ:")) + (@::prompt + "进行筛选操作,然后输入要筛除的最大数值,完成后选择的文字颜色区分") + (setq minnum1 (getint "请输入要筛分的数值:")) (setq s1 (ssget '((0 . "text")))) (mapcar '(lambda (x / str) @@ -74,15 +74,15 @@ (pickset:to-list s1)) (princ)) -;;"ֵ(ѡֵӻһֵ) -(@:add-menu "ѧ" "" "(@:multi-text-cal)") +;;"批量改数值(对所选数值加或减一定值) +(@:add-menu "数学" "批量运算" "(@:multi-text-cal)") (defun @:multi-text-cal( / cal-symble num s1 ti% fn ) - (@:help - "ֵ,ʽı + - * / һֵ.") + (@::prompt + "批量改数值,将数字式单行文本 + - * / 一个数值.") (initget 1 "+ - * /") - (setq cal-symble (getkword " (+ - * /): ")) + (setq cal-symble (getkword "请输入运算符 (+ - * /): ")) (setq s1 (pickset:to-list (ssget '((0 . "text"))))) - (setq num (getreal "ҪӼ˳ֵ:")) + (setq num (getreal "请输入要进行批量加减乘除的数值:")) (setq ti% 0) (mapcar '(lambda (x) (setq fn @@ -94,9 +94,9 @@ (princ) ) -(@:add-menu "ѧ" "ȡ" "(@:fix-number)") +(@:add-menu "数学" "批量取整" "(@:fix-number)") (defun @:fix-number( / num s1 ename ti% p11 p10 f en p11n p10n fn fn1) - "ȡ" + "批量取整" (setq s1 (ssget '((0 . "text")))) (setq num 1) (setq ti% 0) @@ -108,8 +108,8 @@ (- (sslength s1) 1) ) (setq ename(ssname s1 ti%)) - (setq p11 nil) ;p11ÿ - (setq e (entget ename)) ;ȡʵe + (setq p11 nil) ;将p11置空 + (setq e (entget ename)) ;取实体表e (setq fn (rtos (* (atof (cdr (assoc 1 e))) num) 2 0)) (setq fn1 (cons 1 fn)) (setq e (subst fn1 (assoc 1 e) e)) @@ -123,11 +123,11 @@ (princ) ) -(@:add-menu "ѧ" "1~20" "(@:insert-numbers)") +(@:add-menu "数学" "插编号1~20" "(@:insert-numbers)") (defun @:insert-numbers (/ mulu-path fp% mulu% i% insert-point% page-number% zhuanye ml-ruler) (push-var nil) - (@:help "һб,о 800 Ӽܿɷı༭š") - (setq insert-point% (getpoint "Ųʼ㣺")) + (@::prompt "插入一序列编号,行距 800 。配合批量加减功能可方便的编辑序号。") + (setq insert-point% (getpoint "请输入编号插入起始点:")) (setq i% 0)(setq page-number% 1) (setvar "osmode" 0) (setvar "autosnap" 0) @@ -141,7 +141,7 @@ (pop-var) (princ)) -(@:add-menu "ѧ" "" "(@m:column-cal)") +(@:add-menu "数学" "多列运算" "(@m:column-cal)") (defun @m:sort-by-x (ss-lst) (vl-sort ss-lst '(lambda (x y) (> (car (entity:getdxf x 10)) @@ -152,10 +152,10 @@ (cadr (entity:getdxf e2 10)))))) (defun @m:column-cal (/ cal-symble number-lst ss i% res-matrix) (initget 1 "+ - * /") - (setq cal-symble (getkword " (+ - * /): ")) + (setq cal-symble (getkword "请输入运算符 (+ - * /): ")) (setq number-lst '()) (setq i% 0) - (prompt (strcat "ѡ " (itoa (1+ i%)) " :")) + (prompt (strcat "请选择第 " (itoa (1+ i%)) " 列:")) (while (setq ss (ssget '((0 . "text")))) (if number-lst (setq number-lst @@ -163,7 +163,7 @@ (@m:sort-by-y (pickset:to-list ss))))) (setq number-lst (list (@m:sort-by-y (pickset:to-list ss))))) (setq i% (1+ i%)) - (prompt (strcat "ѡ " (itoa (1+ i%)) " :")) + (prompt (strcat "请选择第 " (itoa (1+ i%)) " 列:")) ) (setq res-matrix '()) (foreach matrix number-lst @@ -177,7 +177,7 @@ (mapcar '(lambda (x) (filter-num (entity:getdxf x 1))) matrix))) ) - ;; дͼ + ;; 写图 (mapcar '(lambda (x y) (entity:make-text (rtos x 2 2) @@ -190,12 +190,12 @@ (defun @math:select-number (/ str-fw entlst) (if (null amax) (setq amax 2.6)) (if (null amin) (setq amin 1.6)) - (if (/= "" (setq str-fw (getstring t (strcat "ַΧ( , ~ ոָ)< " (rtos amin 2 2)"~"(rtos amax 2 2)" >: ")))) + (if (/= "" (setq str-fw (getstring t (strcat "请输入数字范围(可用 , ~ 及空格分隔两个数)< " (rtos amin 2 2)"~"(rtos amax 2 2)" >: ")))) (progn (setq fw (vl-remove-if '(lambda(x)(equal 0.0 x 1e-8)) (mapcar 'atof (string:auto-split str-fw)))) (setq amin (apply 'min fw)) (setq amax (apply 'max fw)))) - (prompt "ѡֶ:") + (prompt "请选择文字对象:") (setq entlst (pickset:to-list (ssget '((0 . "*text"))))) (setq entlst diff --git a/at-math/unit-number.lsp b/at-math/unit-number.lsp index 9263aa1..ce7ccbb 100644 --- a/at-math/unit-number.lsp +++ b/at-math/unit-number.lsp @@ -1,5 +1,5 @@ (defun @math:unit-number (/ res lst-str) - (@:help "ȡ,@:tmp-result") + (@::prompt "从文字中提取有物理量的数据,结果保存至变量@:tmp-result") (setq txts (mapcar 'text:get-mtext (pickset:to-list(ssget '((0 . "*text")))))) (setq lst-str (apply 'append -- Gitee