为何我加了个处理选项就不行了呢? (defun MLA (layname laycolor) (vl-load-com) (SETVAR "CMDECHO" 0) (setq acadobject1 (vlax-get-acad-object) acaddocument1 (vla-get-activedocument acadobject1) mspace1 (vla-get-modelspace acaddocument1)) (setq LayerSel (vla-get-Layers AcadDocument1)) (setq LayerObj (vla-add LayerSel layname)) (if (/= nil (tblsearch "layer" layname)) (progn (vla-put-activelayer AcadDocument1 LayerObj) (if (/= nil laycolor) (vla-put-color LayerObj laycolor))) (progn (vla-get-activelayer AcadDocument1 LayerObj) (if (/= nil laycolor) (vla-put-color LayerObj laycolor))))) (defun c:GG ( / dcl_id txt dim hat txtcolor dimcolor hatcolor next) (setq dcl_id (load_dialog "tcgz.dcl")) (new_dialog "tcgz" dcl_id) (if (= txt nil) (set_tile "ss1" "文字") (set_tile "ss1" txt)) (if (= dim nil) (set_tile "ss2" "标注") (set_tile "ss2" dim)) (if (= hat nil) (set_tile "ss3" "填充") (set_tile "ss3" hat)) (if (= txtcolor nil) (setq txtcolor 3)) (fill_img "img1" txtcolor) (if (= dimcolor nil) (setq dimcolor 6)) (fill_img "img2" dimcolor) (if (= hatcolor nil) (setq hatcolor 8)) (fill_img "img3" hatcolor) (action_tile "ss1" "(setq txt $value)") (action_tile "ss2" "(setq dim $value)") (action_tile "ss3" "(setq hat $value)") (action_tile "img1" "(setq txtcolor (ACAD_COLORDLG txtcolor))(fill_img \"img1\" txtcolor)") (action_tile "img2" "(setq dimcolor (ACAD_COLORDLG dimcolor))(fill_img \"img2\" dimcolor)") (action_tile "img3" "(setq hatcolor (ACAD_COLORDLG hatcolor))(fill_img \"img3\" hatcolor)") (action_tile "cancel" "(done_dialog 0)") (action_tile "accept" "(get_w)(done_dialog 1)") (setq next (start_dialog)) (cond ((= next 01)(c:malay)) )) (defun get_w() (setq txt (get_tile "ss1")) (setq dim (get_tile "ss2")) (setq hat (get_tile "ss3")) ) (DEFUN c:malay ( / sst ssd ssh) (ZHL_mla txt txtcolor) (ZHL_mla dim dimcolor) (ZHL_mla hat hatcolor) (setq sst (ssget "X" '((0 . "*TEXT"))) ssd (ssget "X" '((0 . "DIMENSION"))) ssh (ssget "X" '((0 . "HATCH"))) ) (if sst (setq sst (ssget "X" '((0 . "*TEXT")))) (command "chprop" sst "" "la" TXT "")) (if ssd (setq ssd (ssget "X" '((0 . "DIMENSION")))) (command "chprop" ssd "" "la" dim "")) (if ssh (setq ssh (ssget "X" '((0 . "HATCH")))) (command "chprop" ssh "" "la" hat "")) )
|