www.pudn.com > CADtool.rar > SetParameters.lsp, change:2009-12-18,size:1688b


;;;调用参数设置对话框进行参数设置 
(defun LoadDialog_SetParameters( / dcl_id ) 
   (defun set_data() ;Start Set function 
       (setvar "dimzin" 8) 
       (if #CDBL# (set_tile "editCDBL" (rtos #CDBL# 2 3))) 
       (if #ctbl# (set_tile "editCTBL" (rtos #ctbl# 2 3)))        
       (if #ZiGao# (set_tile "editZiGao" (rtos (/ (* #ZiGao# 1000.0) (* #ctbl# #CDBL#)) 2 3)))        
       (if #xiaoshu# (set_tile "editXiaoShu" (itoa #xiaoshu#))) 
       (if #LiChengXiaoShu# (set_tile "editLiChengXiaoShu" (itoa #LiChengXiaoShu#))) 
       (if #ZhuLiXiaoShu# (set_tile "editZhuLiXiaoShu" (itoa #ZhuLiXiaoShu#))) 
       (if #RJin# (set_tile "editRJin" (rtos #RJin# 2 3))) 
       (princ) 
   );End of Set function 
   (defun get_data() ;Start Get function 
       (setq #CDBL# (atof (get_tile "editCDBL" ))) 
       (setq #ctbl# (atof (get_tile "editCTBL" ))) 
       (setq #ZiGao# (atof (get_tile "editZiGao" ))) 
       (setq #ZiGao# (/ (* #cdbl# #ZiGao#) (/ 1000.0 #ctbl#))) 
       ;; 根据比例计算CAD图中的字高 
       (setq #xiaoshu# (atoi (get_tile "editXiaoShu" ))) 
       (setq #LiChengXiaoShu# (atoi (get_tile "editLiChengXiaoShu" ))) 
       (setq #ZhuLiXiaoShu# (atoi (get_tile "editZhuLiXiaoShu" ))) 
       (setq #RJin# (atof (get_tile "editRJin" ))) 
       (princ) 
   );End of Get function 
   (setq dcl_id (load_dialog "setparameters.dcl")) 
   (if (new_dialog "setparameters" dcl_id) 
        (progn               
           (set_data) 
           (action_tile "accept" "(get_data)(done_dialog)") 
           (start_dialog) 
           (unload_dialog dcl_id)               
         ) 
             
         (alert "创建对话框失败!") 
      )         
 
   (princ) 
)