明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1434|回复: 1

能人快帮忙呀!AUTOLISP问题

[复制链接]
发表于 2002-11-19 12:50:00 | 显示全部楼层 |阅读模式
我的问题是在窗体中选择一个单选按钮后再点击确定后怎么完成确定后的工作 ,希望帮助更改后发上来,谢谢
/////////////现在有一个窗体文件DCL
guanjian_radio : boxed_radio_column {
    label = "请选择其中的一个标高类型:";
//    fixed_height = true;
    : radio_button {
        key = "yiban";
        label = "一般标高";
        value="1";
    }
    : radio_button {
        key = "guanxin";
        label = "管心标高";
    }
    : radio_button {
        key = "guandi";
        label = "管底标高";
    }
    : radio_button {
        key = "guanding";
        label = "管顶标高";
    }
}
guanjian : dialog {
    label = "管件类:--标高";
    guanjian_radio;
//    ok_cancel;
    :row{
:spacer {width=1;}
:button{
label="确定";
is_default = true;
key="accept";
width=8;
fixed_width = true;
}
:button{
label="取消";
is_cancel = true;
key="cancel";
width=8;
fixed_width = true;
}
:spacer {width=1;}
    }
}
//////////////////////////////////////////////////////////////////////////
/////////////////////////下面是调用的LSP文件(这里有问题,如何修改)///
(defun C:guanjian( / dcl_id )
(setq dcl_id (load_dialog "guanjian.dcl")) ; Load the DCL file.
  (if (not (new_dialog "guanjian" dcl_id))   ; Initialize the dialog.
    (exit)                                ; Exit if this doesn't
  )
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

  (action_tile
   "yiban"
   "(setq sle \"(OG12 3)\")"
  )
  (action_tile
   "guanxin"
   "(setq sle \"(OG12 4)\")"
  )
  (action_tile
   "guandi"
   "(setq sle \"(OG12 5)\")"
  )
  (action_tile
   "guanding"
   "(setq sle \"(OG12 5)\")"
  )
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  (start_dialog)                          ; Display the dialog
    (action_tile "accept"            //关键在这里怎么继续实现下去
      (strcat("(done_dialog)"))
      )
  (action_tile "cancle" "(done_dialog 0)");退出按钮
    (unload_dialog dcl_id)   ; Unload the DCL file.
  (princ)
)
发表于 2002-11-19 13:40:00 | 显示全部楼层

我将你最后一段LISP程序做了一点点改动,运行通过

(action_tile "accept" "(done_dialog)" ) ;确定钮
  (action_tile "cancle" "(done_dialog 0)");退出钮
    (start_dialog)
    (princ sle)
  (unload_dialog dcl_id)   ; Unload the DCL file.
这样,变量sle在命令行输出,当然,你也可以在(start_dialog)语句后对sle的不同值进行处理。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-9-23 04:30 , Processed in 0.838171 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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