明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1696|回复: 4

求助:对话框无法隐藏以拾取屏幕坐标

[复制链接]
发表于 2012-1-16 11:45 | 显示全部楼层 |阅读模式
本帖最后由 gingko_sf 于 2012-1-18 11:22 编辑

    本人制作了一个简单的画圆对话框,其中可能需要隐藏对话框以拾取屏幕坐标,但就是不隐藏,“确定”和“取消”按钮功能倒是正常。一直找不出问题出在哪儿,这里高人多,请教。



LISP代码

(defun getdata ()  ;从对话框获取数据的子程序   ;子程序
            (setq xc (atof (get_tile "X")))
            (setq yc (atof (get_tile "Y")))
             (setq r (atof (get_tile "R")))
        )

(defun yuan ( )      ;子程序
    (command "circle" (list  xc yc) r)

  )
(defun c:drawcircle ( / p xc yc r id x1 y1 sdt id)
  (setq xc 50.0 yc 50 r 25)
  (setq sdt 2)
(while (> sdt 1)
  (setq id (load_dialog "C:\\drawcircle.dcl"))
  (if (< id 0)(exit))
  (if (not (new_dialog "drawcircle" id))(exit))  

  (set_tile "X" (rtos xc 2 2))  
  (set_tile "Y" (rtos yc 2 2))
  (set_tile "R" (rtos r 2 2))  
  (action_tile "hide" "(getdata)(done_dialog 4)")   
  (action_tile "accept" "(getdata)(done_dialog 1)")  
  (action_tile "cancel" "(done_dialog 0)")   
  (setq sdt (start_dialog))   

   (if (= sdt 2 )
         (progn
              
               (setq p (getpoint "圆心坐标拾取:" ) )
               (setq xc (car p) yc (cadr p) )
          ) ;end of progn
           
    ) ;end of lower if


)  ;end of while

        (if (= sdt 1 ) (yuan)
         )  ;end of upper if


  (unload_dialog id)

  (princ)
  )






本帖子中包含更多资源

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

x
发表于 2012-1-16 11:50 | 显示全部楼层
有书吗?看一下书,需要while循环的
发表于 2012-1-16 11:50 | 显示全部楼层

点评

很好的例子,谢谢!  发表于 2020-11-11 12:59
 楼主| 发表于 2012-1-16 14:30 | 显示全部楼层
谢谢andyhon长老的例子。
我解决了。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-5-17 10:30 , Processed in 0.223769 second(s), 34 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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