取值的方法是对的,不过地方不对,你这样取的是对话框的初始值,以后的操作对这两个变量没有任何影响。如果想操作后将值传给变量,则必须在相应控件的动作函数中取值。
你只有一个退出对话框的动作,就是说这个对话框显示后你什么都没做就退出了(即使你做了什么也等于没做),
给你的程序做如下修改:
- (princ "\n applicatiion")
- (defun c:be (/ dcl_id)
-
- ;**********store the setting*****
- (setq oldcmd (getvar "cmdecho"))
- (setvar "cmdecho" 0)
- (setq oldblip (getvar "blipmode"))
- (setvar "blipmode" 0)
- (setq oldsnap (getvar "osmode"))
- (setvar "osmode" 0)
- ; diaplay beam1.dcl
- (setq dcl_id (load_dialog "beam1"))
- (if (not (new_dialog "Beam1" dcl_id))
- (exit)
- )
- (setq ldm (get_tile "ldm" ))
- (setq lwm (get_tile "lwm" ))
- (action_tile "ldm" "(setq ldm (get_tile "ldm")) (setq lwm (get_tile "lwm"))")
- (action_tile "lwm" "(setq lwm (get_tile "lwm")) (setq ldm (get_tile "ldm"))")
- (action_tile "accept" "(done_dialog)")
- (start_dialog)
- (unload_dialog dcl_id)
-
- (alert (strcat ldm lwm))
- (setvar "cmdecho" oldcmd)
- (setvar "blipmode" oldblip)
- (setvar "osmode" oldsnap)
- )
- (princ " has been load ,please type “be” run it")
|