iCAx开思网

标题: cad二次开发的问题 [打印本页]

作者: alionroars    时间: 2004-12-13 12:09
标题: cad二次开发的问题
对话框无法嵌套调用。急。请各位帮忙。源程序如下(对话框部分):
(defun daolu();命令名称是daolu
  (setq id (load_dialog "d:/daolu/daolu.dcl"))
  (if(< id 0)(exit))
  (if(not(new_dialog "daolu" id))(exit))
  (setq x1 (dimx_tile "daolu"));启动图像
  (setq y1 (dimy_tile "daolu"))
  (start_image "daolu")
  (slide_image 0 0 x1 y1 "d:/daolu/img.sld")
  (end_image)                  ;启动图像完毕
  (action_tile "pick" "(done_dialog 5)");定义按钮
  (action_tile "A" "(getdata1)(done_dialog 1)")
  (action_tile "B" "(getdata2)(done_dialog 2)")
  (action_tile "C" "(getdata3)(done_dialog 3)")
  (action_tile "D" "(getdata4)(done_dialog 4)");定义按钮完毕
)
  
(defun pick()
       (initget 1)
       (setq o (getpoint"\n点取道路中心点:"))
       (setq x0 (car o) y0 (cadr o))
)
  
(defun getdata0();从父对话框中获取数据
  (setq v1(atof(get_tile "v1")))
  (setq n1(atof(get_tile "n1")))
  (setq v2(atof(get_tile "v2")))
  (setq n2(atof(get_tile "n2")))
)
  
(defun getdata1();从子对话框1中获取数据
  (setq bA(atof(get_tile "b")))
  (setq nlA(atof(get_tile "nl")))
  (setq nrA(atof(get_tile "nr")))
  (action_tile "yes" (setq nA 1));互锁按钮
  (action_tile "no" (setq nA 0))
  (setq bA1(atof(get_tile "b1")))
  (setq lA(atof(get_tile "l")))
  (setq rA(atof(get_tile "r")))
)
  
(defun getdata2();从子对话框2中获取数据
  (setq bB(atof(get_tile "b")))
  (setq nlB(atof(get_tile "nl")))
  (setq nrB(atof(get_tile "nr")))
  (action_tile "yes" (setq nB 1));互锁按钮
  (action_tile "no" (setq nB 0))
  (setq bB1(atof(get_tile "b1")))
  (setq lB(atof(get_tile "l")))
  (setq rB(atof(get_tile "r")))
)
  
(defun getdata3();从子对话框3中获取数据
  (setq bC(atof(get_tile "b")))
  (setq nlC(atof(get_tile "nl")))
  (setq nrC(atof(get_tile "nr")))
  (action_tile "yes" (setq nC 1));互锁按钮
  (action_tile "no" (setq nC 0))
  (setq bC1(atof(get_tile "b1")))
  (setq lC(atof(get_tile "l")))
  (setq rC(atof(get_tile "r")))
)
  
(defun getdata4();从子对话框4中获取数据
  (setq bD(atof(get_tile "b")))
  (setq nlD(atof(get_tile "nl")))
  (setq nrD(atof(get_tile "nr")))
  (action_tile "yes" (setq nD 1));互锁按钮
  (action_tile "no" (setq nD 0))
  (setq bD1(atof(get_tile "b1")))
  (setq lD(atof(get_tile "l")))
  (setq rD(atof(get_tile "r")))
)
  
(defun dlg1()
  (if(not(new_dialog "d:/daolu/A.dcl" id))(exit))
  (action_tile "accept" "(getdata1)(done_dialog 6)")
  (action_tile "cancel" "(done_dialog 6)")
)
  
(defun dlg2()
  (if(not(new_dialog "d:/daolu/B.dcl" id))(exit))
  (action_tile "accept" "(getdata2)(done_dialog 6)")
  (action_tile "cancel" "(done_dialog 6)")
)
  
(defun dlg3()
  (if(not(new_dialog "d:/daolu/C.dcl" id))(exit))
  (action_tile "accept" "(getdata3)(done_dialog 6)")
  (action_tile "cancel" "(done_dialog 6)")
)
  
(defun dlg4()
  (if(not(new_dialog "d:/daolu/D.dcl" id))(exit))
  (action_tile "accept" "(getdata4)(done_dialog 6)")
  (action_tile "cancel" "(done_dialog 6)")
)
  
(defun c:cross(/ sdt)
  (setvar "cmdecho" 0)
  (setvar "osmode" 0)
  (setq id (load_dialog "d:/daolu/daolu.dcl"))
  (if (< id 0)(exit))
  (setq sdt 5)
  (while (> sdt 0)
    (daolu)
    (if (= sdt 1)(dlg1))
    (if (= sdt 2)(dlg2))
    (if (= sdt 3)(dlg3))
    (if (= sdt 4)(dlg4))
    (if (= sdt 5)(pick))
   )
  (unload_dialog id)
)




欢迎光临 iCAx开思网 (https://www.icax.org/) Powered by Discuz! X3.3