明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 796|回复: 6

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

[复制链接]
发表于 2016-1-21 17:30:40 | 显示全部楼层 |阅读模式
1,请问怎么控制对话框里限制非正整数字的输入?
比如:  ".1"   "0.1"  "你"

2,-plot命令如何编写打印份数的?
目前是这样做的,这个份数没有系统变量设置吗?
(repeat n
   (command "-plot" ……
"觉得好,就打赏"
还没有人打赏,支持一下
发表于 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
abs(getint)


这段代码具体怎么写的呢?
好像只能对话框结束后才会有提示吧?
 楼主| 发表于 2016-1-22 11:41:38 | 显示全部楼层
如果能像plot里面的提示那就强大了,好像这个不是DCL能做到的吧?

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

x
发表于 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
(defun chkreal (/ tile sym syms asc)
    (setq syms $value
          asc  (ascii syms)

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

有点缺憾就是不支持".5"在前,和负数"-.5" "-2.5" 这样的数值,如果输入这些数值CAD直接假死只能强退咯
 楼主| 发表于 2016-1-23 08:51:45 | 显示全部楼层
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2025-5-20 16:42 , Processed in 0.192082 second(s), 31 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表