yjr111 高手的图层状态管理器图层状态-快捷键问题
希望可以--实现--输入指定字母Q1 Q2再切换图层状态现在只支持首个字母(defun c:laman(/ ladict1 ladict n statenemelst num )
(setq ladict1(vla-GetExtensionDictionary (vla-get-layers (vla-get-ActiveDocument (vlax-get-acad-object)))))
(repeat (setq m(vla-get-count ladict1))
(setq ladict(vla-item ladict1 (setq m(1- m))))
(repeat (setq n(vla-get-count ladict))
(setq statenemelst(cons (vla-get-name(vla-item ladict(setq n(1- n))))statenemelst))
)
)
(xsdhk)
(if num(command "layer" "a" "r" (nth (atoi num) statenemelst) "" "" ))
(princ)
)
;;;******************************************
;;;添加列表框内列表
;;;******************************************
(defun adlst(key lst);;;仅对popup_list或list_box有效
(start_list key 3);;;处理列表开始
(mapcar 'add_listlst)
(end_list);;;添加列表结束
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun xsdhk (/ replace lsdcl fn dclid )
(setq fn (open (setq lsdcl (VL-FILENAME-MKTEMP "tmp" "" ".dcl")) "w"))
(foreach x '("yyy : dialog{"
"label=\"StateManager\";"
":list_box{key=\"9\";height=18;width=12;}"
":button{key=\"cancel\";label=\"Cancel\";is_cancel=true;width=1;height=2;}"
"}"
)
(write-line x fn)
)
(close fn)
(setq dclid (load_dialog lsdcl))
(vl-file-delete lsdcl)
(new_dialog "yyy" dclid "" screenpt)
(adlst "9"statenemelst)
(action_tile "9" "(setq num $value)(done_dialog)")
(start_dialog)
(unload_dialog dclid)
)
(princ"\n图层状态简易切换,命令LAMAN.")
(PRINC)
你解决了 哥哥 我也想实现这个功能
页:
[1]