啵浪鼓 发表于 2016-1-21 17:30:40

对话框里的限制非数字输入,及打打印份数

1,请问怎么控制对话框里限制非正整数字的输入?
比如:".1"   "0.1""你"

2,-plot命令如何编写打印份数的?
目前是这样做的,这个份数没有系统变量设置吗?
(repeat n
   (command "-plot" ……

aihuyujian 发表于 2016-1-21 17:44:55

abs(getint)

啵浪鼓 发表于 2016-1-22 11:39:06

本帖最后由 啵浪鼓 于 2016-1-22 11:42 编辑

aihuyujian 发表于 2016-1-21 17:44 http://bbs.mjtd.com/static/image/common/back.gif
abs(getint)

这段代码具体怎么写的呢?
好像只能对话框结束后才会有提示吧?

啵浪鼓 发表于 2016-1-22 11:41:38

如果能像plot里面的提示那就强大了,好像这个不是DCL能做到的吧?

chg 发表于 2016-1-22 12:39:43

(defun chkreal (/ tile sym syms asc)
    (setq syms $value
          asc(ascii syms)
          tile $key
          )
    (if syms
      (setq sym (read $value))
      (setq sym nil)
      )
    (if (or (not sym) (not (numberp sym)) (= asc 45))
      (progn
      (vlr-beep-reaction)
      (cond
          ((= tile "gaodu")
         (set_tile "comments" "工字钢的高度必须为正的实数!")
         )
          ((= tile "kuandu")
         (set_tile "comments" "工字钢的腿宽必须为正的实数!")
         )
          ((= tile "houdu")
         (set_tile "comments" "工字钢的腰厚必须为正的实数!")
         )
          ((= tile "nyh")
         (set_tile "comments" "内圆弧半径必须为正的实数!")
         )
          ((= tile "bdyh")
         (set_tile "comments" "腿端圆弧半径必须为正的实数!")
         )
          )
      (setq err nil)
      (mode_tile tile 2)
      (setq syms $value
            asc(ascii syms)
            sym(read $value)
            )
      )
      (setq err t)
      )
    )
.........
(action_tile "ckuandu" "(chkreal)......")

啵浪鼓 发表于 2016-1-22 17:16:21

chg 发表于 2016-1-22 12:39 static/image/common/back.gif
(defun chkreal (/ tile sym syms asc)
    (setq syms $value
          asc(ascii syms)


非常好,非常感谢chg大大!

有点缺憾就是不支持".5"在前,和负数"-.5" "-2.5" 这样的数值,如果输入这些数值CAD直接假死只能强退咯

啵浪鼓 发表于 2016-1-23 08:51:45

页: [1]
查看完整版本: 对话框里的限制非数字输入,及打打印份数