明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 913|回复: 5

[讨论] 新手 求帮助

[复制链接]
发表于 2013-3-12 11:52 | 显示全部楼层 |阅读模式
1明经币
defun c:test (/ dcl_id a b h *next* choice p1)
  (setvar "cmdecho" 0)
  (setq dcl_id (load_dialog "d:/1.DCL"))
  (setq *next* 5)
  (while (> *next* 2)
    (new_dialog "box" dcl_id)
    (if a (set_tile "edit_1" (rtos a 2 0)))
    (if b (set_tile "edit_2" (rtos b 2 0)))
    (if h (set_tile "edit_3" (rtos h 2 0)))
    (action_tile "edit_1" "(setq a (atof $value))")
    (action_tile "edit_2" "(setq b (atof $value))")
    (action_tile "edit_3" "(setq h (atof $value))")
    (action_tile "button_1" "(done_dialog 3)")
    (action_tile "accept" "(done_dialog 1)(setq choice T)")
    (action_tile "cancel" "(done_dialog 0)(setq choice nil)")
    (setq *next* (start_dialog))
    (if

 楼主| 发表于 2013-3-12 11:53 | 显示全部楼层
本帖最后由 retfjkl 于 2013-3-12 13:27 编辑

  (if (and choice p1 a b h)
    (box10)
  )
  (unload_dialog dcl_id)
  (setvar "cmdecho" 1)
  (princ)
)
  求解释下这程序


回复

使用道具 举报

发表于 2013-3-12 13:44 | 显示全部楼层
很好懂,(setq choice T)(setq choice nil)这句中对choice进行了赋值,(and choice p1 a b h)表示choice p1 a b h全部不为Nil时,返回T,执行(box10)子函数,如果为假,什么都不做。(unload_dialog dcl_id)缷载对话框,
回复

使用道具 举报

 楼主| 发表于 2013-3-12 15:48 | 显示全部楼层
defun c:test (/ dcl_id a b h *next* choice p1)
  (setvar "cmdecho" 0)
  (setq dcl_id (load_dialog "d:/1.DCL"))
  (setq *next* 5)
  (while (> *next* 2)
    (new_dialog "box" dcl_id)
    (if a (set_tile "edit_1" (rtos a 2 0)))
    (if b (set_tile "edit_2" (rtos b 2 0)))
    (if h (set_tile "edit_3" (rtos h 2 0)))
    (action_tile "edit_1" "(setq a (atof $value))")
    (action_tile "edit_2" "(setq b (atof $value))")
    (action_tile "edit_3" "(setq h (atof $value))")
    (action_tile "button_1" "(done_dialog 3)")
    (action_tile "accept" "(done_dialog 1)(setq choice T)")
    (action_tile "cancel" "(done_dialog 0)(setq choice nil)")
    (setq *next* (start_dialog))
     (if (and choice p1 a b h)
    (box10)
  )
  (unload_dialog dcl_id)
  (setvar "cmdecho" 1)
  (princ)
)

是一起的
回复

使用道具 举报

发表于 2013-3-12 18:46 | 显示全部楼层
缺少dcl文件.......
回复

使用道具 举报

 楼主| 发表于 2013-3-12 19:03 | 显示全部楼层
LLXXZZ 发表于 2013-3-12 18:46
缺少dcl文件.......

解释下这个程序就行
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-5-8 15:10 , Processed in 0.223563 second(s), 22 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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