3
20
17
初来乍到
使用道具 举报
114
1万
中流砥柱
;///////////// 05-01-2010 \\\\\\\\\\\\\\\\\;//////////// Drawing Generator\\\\\\\\\\\\\\\\\;;AUTOLISP CODING STARTS HERE *** ASSOCIATED DCL FILE <DG.DCL****(defun c:dg (/ Dcl_Id% NAMES$ NAMESQ$ ) (setq DGVersion "DG v1.0") ; this is the DCL title string(vl-cmdf "-layer" "ON" "*" "") ; turn on all layers to begin ;; This is the Master List for DCL variables ;; VarName TileName DefValue TileType listAssoc (setq MasterList '( (Q1 "Q1" 0 0 NAMESQ) (Q2 "Q2" 0 0 NAMESQ) (Q3 "Q3" 0 0 NAMESQ)));; TileType 0 = PopUp_List;; 1 = Toggle ;; ;; ********************* Start of get_data function *********************** ;; ;; Compressor Count, Subcooling & Liquid Injection Options ;; (defun get_data () (foreach itm MasterList (set (car itm) (get_tile (eval (cadr itm)))) )) ; defun get_data (defun Q(cnt) (setq cnt (atoi cnt)) (mode_tile "Q1" (if (> cnt 0) 0 1)) (mode_tile "Q2" (if (> cnt 0) 0 1)) (mode_tile "Q3" (if (> cnt 0) 0 1)) ) ;; ///////////////////// End of get_data function \\\\\\\\\\\\\\\\\\\\\\\\\ ;; ********************* Start of Pull Down List Define Section *********************** (setq NAMESQ '("None" "One" "Two" "Three" "Four" "Five")) ;; ;; ///////////////////// End of Pull Down List Define Section \\\\\\\\\\\\\\\\\\\\\\\\\ ;; ;; Locate DCL file & prepare to start it (setq dcl_id (load_dialog "DG.dcl")) ;load dialog (if (not (new_dialog "DG" dcl_id)) ;test for dialog (exit) ;exit if no dialog ) ;End if ;; ;; ********************* Start of List Box Build Section *********************** ;; (defun AddList (tile lst) (start_list tile) (mapcar 'add_list lst) (end_list) ) (foreach itm MasterList (if (zerop (cadddr itm)) (AddList (eval (cadr itm)) (eval (last itm))) ; debug CAB ) ) ;;=============================================================== (cond (*DGGlobal* ; recover last used settings (foreach itm MasterList (if (setq value (cdr (assoc (car itm) *DGGlobal*))) (set (car itm) value) ) ) ) (t ; set to default values (foreach itm MasterList (set (car itm) (itoa(caddr itm))) ) ) ) (Q Q1);;; (CompQtyS compqty2) ;; ///////////////////// End of List Box Build Section \\\\\\\\\\\\\\\\\\\\\\\\\ ;; Set all tiles (foreach itm MasterList (set_tile (cadr itm) (eval (car itm))) ) (set_tile "title" DGVersion) ; add title to DCL ;; ///////////////////// Begin Button Actions Definitions \\\\\\\\\\\\\\\\\\\\\\\\\ (action_tile "Q1" "(Q $value)");;; (action_tile "Q2" "(CompQtyS $value)")