平时用对话框用得很少,想编对程序,用对话框的方式输入图元的属性,同时也能修改.程序如下: (defun c:addd( ) (setq oldos (getvar "osmode")) (setq oldortho (getvar "orthomode")) (setq hh(car (entsel "\nSelect an object:")) vh (vlax-ename->vla-object hh) ) (setq ma (vlax-ldata-get vh "machining") depth (vlax-ldata-get vh "depth") chk 0.0 ) (if (= ma nil) (setq ma "0")) (if (= depth nil) (setq depth "0.0")) (setq dcl_id (load_dialog "e:/z/dcl/attribute.dcl") chk 0) (new_dialog "attribute" dcl_id) (add-addphrase) (set_tile "ma" ma) (set_tile "depth" depth ) ;(action_tile "use_up " "(setq up (atoi (get_tile \"use_up\")))(use-setc up)") ;(action_tile "ma" "(setq ma (get_tile \"ma\"))") (action_tile "accept" "(setq chk 1) (setq ma (get_tile \"ma\")) (setq depth (get_tile \"depth\"))(done_dialog)") (start_dialog) (unload_dialog dcl_id) (if (= chk 1) (progn (vlax-ldata-put vh "machining" ma) (vlax-ldata-put vh "depth" depth) (setq man (cond ((= ma 1) "MILL") ((= ma 2) "EDM") ((= ma 3) "BORE") ((= ma 4) "REAM") ((= ma 5) "PG") ((= ma 6) "CB") ((= ma 0) "") ) ) (setq end (strcat man depth)) (command "leader" (setq pt1 (getpoint "\nSelect source point:")) (getpoint pt1 "\nSelect text local point:") "" "" "" end "") ) ) (setvar "osmode" oldos) (setvar "orthomode" oldortho) (KKEE 3.0) (princ) (command "undo" "e" ) ) (defun add-addphrase() (setq sup nil) (setq f_id (open "e:/z/format/add.txt" "r")) (setq sup(read-line f_id) upgroup(list) ) (while (/= sup nil) (setq upgroup (cons sup upgroup)) (setq sup (read-line f_id)) ) (close f_id) (start_list "ma" 3 0) (setq upgroup (reverse upgroup)) (mapcar 'add_list upgroup) (end_list) ) DCL对话框如下: attribute: dialog{ label="Rectangle"; :popup_list { label="Machining"; key= "ma"; height=10; } :edit_box {label= "Machining depth:"; key = "depth"; width= 25; height =1; fixed_width=true; fixed_height=true; } ok_cancel;} 哪位高手有空帮我看一下程序错在哪里.POPUP_LIST的VALUE是1 还是"1". |