- ;¿ì½Ý¼ü---ͼ²ã¿ØÖÆ
- (defun c:ww ()
- (mainpaneldcl
- (list
- (list "ͼ²ã¿ØÖÆtcg"
- (list "ͼ²ã¹Ø±Õ/l-" "layoff")
- (list "ͼ²ã¹Ø±Õ(·´)/tcgbf" "tcgbf")
- (list "È«²¿ÏÔʾ/`" "layon")
- (list "¹ÂÁ¢Í¼²ã/q" "layiso")
- (list "Í˳ö¹ÂÁ¢/qq" "layuniso")
- )
- ))
- (princ))
- ;Ãæ°åÖ÷³ÌÐò
- (vl-load-com)
- (defun mainpaneldcl (strklst / maxl keylst n nn lcmd ff f id cmd)
- (setq ff(vl-filename-mktemp "temp_pannel.dcl") f(open ff "w"))
- (write-line "MYbutton:button{width =10;vertical_margin=none;horizontal_margin=none;}" f)
- (write-line "MYpanel:dialog{label="xx¹¤¾ß";:row{" f)
- (setq n 0 nn(mapcar 'length (mapcar 'cdr strklst)) maxl(apply 'max nn));±í³¤
- (mapcar (function(lambda(x / l1)
- (write-line(strcat ":column{label=" (vl-prin1-to-string(car x))";")f)
- (setq x(cdr x) x(append x(repeat(- maxl(length x))(setq l1(cons '("" "")l1)))));±í²¹³¤
- (mapcar (function(lambda(y / k)
- (setq k(strcat "key" (itoa(setq n(1+ n)))))
- (write-line(strcat
- ":MYbutton{label="(vl-prin1-to-string(car y))";key= "(vl-prin1-to-string k)
- (if(= (setq y(cadr y)) "")";is_enabled = false;}" ";}");Ìî³äµÄ¿Õ°×¼ü
- )f)
- (setq keylst(cons k keylst) lcmd(cons y lcmd));¼ü±íkey1¿ªÊ¼/ÃüÁî±í
- ))x)
- (write-line "}" f)
- ))strklst)
- (write-line "}:row{" f)
- (write-line(if(> (length nn)2)":text{label="Ê¢Äê²»ÔÙÀ´!ËêÔ²»´ýÈË!";is_enabled = false;}" "spacer_0;")f)
- (write-line":button{label="¹Ø±Õ"; key="cancel";is_cancel=true;width=6;fixed_width=true;}" f)
- (write-line "spacer_0;}}" f)
- (close f)
- (setq id(load_dialog ff))(vl-file-delete ff)
- (new_dialog "MYpanel" id "3" P_MYpaneldcl)
- (mapcar (function(lambda(x)(action_tile x(strcat "(setq P_MYpaneldcl(done_dialog "(substr x 4)"))"))))keylst)
- (setq n (start_dialog))(unload_dialog id)
- (if(> n 0)(if(wcmatch(setq cmd(nth(1- n)(reverse lcmd))) "(*)")(eval(read cmd));(º¯Êý)·½Ê½
- (vla-SendCommand(vla-get-ActiveDocument(vlax-get-acad-object))(strcat cmd "\n"));c:ÃüÁʽ,·½±ãÖظ´Ö´ÐÐ
- ));µã»÷°´Å¥µÄÖµ
- )
ÎҵijÌÐò ºº×ÖÃæ°åΪʲôÊÇ ÂÒÂëµÄ°¡£¿ |