jxphklibin 发表于 2009-1-17 11:24:00
晕倒,老子看不到代码xyp1964 发表于 2009-1-29 12:46:00
<p>;|<br/>超級隱藏/顯示工具<br/>;;这是无痕的思路(不会用就找他)<br/>;;超级隐藏/显示工具<br/>;;By LUCAS(龙龙仔)</p><p>(prompt "\n超级隐藏/显示工具-------------龙龙仔.2004.1")<br/>(alert<br/> (strcat<br/> "\n\n--------------------------------------------------------------------------"<br/> "\n\n----------------超级隐藏/显示工具(测试版V0)-------------------"<br/> "\n\n---------------------------龙龙仔.2004.1-----------------------------"<br/> "\n\n--------------------------------------------------------------------------"<br/> "\n\nE-显示所有/D-隐藏所有/V-显示记录/C-隐藏记录"<br/> "\n\nS-显示上个/F-显示下个/空格-显示锁定/R-显示解锁"<br/> "\n\nB-显示记录/X-退出/Q-删除标记/Z-清空记录/A-增加隐藏:"<br/> "\n\n--------------------------------------------------------------------------"<br/> "\n\n--------------------(XSHOW_LAI <词典名称>)--------------------"<br/> "\n\n----------------------------C:XSHOWALL----------------------------"<br/> "\n\n----------------------------C:XHIDEALL-----------------------------"<br/> )<br/>)<br/>|;<br/>;;这是无痕的思路(不会用就找他)<br/>;;超级隐藏/显示工具<br/>;;By LUCAS(龙龙仔)<br/>;;写好就没有用过.......<br/>(vl-load-com)<br/>(defun C:XSHOWALL (/ SSOBJ ENT)<br/> (if<br/> (and (ssget "X" (list (cons 60 1) (cons 410 (getvar "CTAB"))))<br/> (setq SSOBJ (ssget "X" (list (cons 410 (getvar "CTAB")))))<br/> )<br/> (progn<br/> (setq<br/> SSOBJ (vla-get-activeselectionset<br/> (vla-get-activedocument (vlax-get-acad-object))<br/> )<br/> )<br/> (vlax-for ENT SSOBJ<br/> (vla-put-visible ENT :vlax-true)<br/> )<br/> (prompt "\n显示所有物件!")<br/> )<br/> (prompt "\n无隐藏物件!")<br/> )<br/> (princ)<br/>)</p><p>(defun C:XHIDEALL (/ SSOBJ ENT)<br/> (if (setq SSOBJ (ssget "X" (list (cons 410 (getvar "CTAB")))))<br/> (progn<br/> (setq<br/> SSOBJ (vla-get-activeselectionset<br/> (vla-get-activedocument (vlax-get-acad-object))<br/> )<br/> )<br/> (vlax-for ENT SSOBJ<br/> (vla-put-visible ENT :vlax-false)<br/> )<br/> (prompt "\n隐藏所有物件!")<br/> )<br/> )<br/> (princ)<br/>)</p><p>;;(CHECK "LUNG")<br/>(defun CHECK (DICT / DICT_KEY ENT LL N)<br/> (setq DICT_KEY (vlax-ldata-list DICT)<br/> N 0<br/> )<br/> (repeat (length DICT_KEY)<br/> (setq LL (cons (car (nth N DICT_KEY)) LL))<br/> (setq N (1+ N))<br/> )<br/> LL<br/>)</p><p>;;(DICT_OFF "LUNG" "1")<br/>(defun DICT_OFF (DICT KEY / SS ENT)<br/> (setq SS (cdr (assoc KEY (vlax-ldata-list DICT))))<br/> (foreach ENT SS<br/> (if (and (setq ENT (handent ENT)) (entget ENT))<br/> (vla-put-visible (vlax-ename->vla-object ENT) :vlax-false)<br/> )<br/> )<br/> (princ)<br/>)</p><p>;;(DICT_ON "LUNG" "1")<br/>(defun DICT_ON (DICT KEY / SS ENT)<br/> (setq SS (cdr (assoc KEY (vlax-ldata-list DICT))))<br/> (foreach ENT SS<br/> (if (and (setq ENT (handent ENT)) (entget ENT))<br/> (vla-put-visible (vlax-ename->vla-object ENT) :vlax-true)<br/> )<br/> )<br/> (princ)<br/>)</p><p>;;(MAKE_DICT "LUNG" "1" (SSGET))<br/>(defun MAKE_DICT (DICT KEY SS / ENAME_LIST N)<br/> (setq N 0)<br/> (repeat (sslength SS)<br/> (setq ENAME_LIST<br/> (cons (cdr (assoc 5 (entget (ssname SS N))))<br/> ENAME_LIST<br/> )<br/> )<br/> (setq N (1+ N))<br/> )<br/> (vlax-ldata-put DICT KEY ENAME_LIST)<br/>)</p><p>;;主程序<br/>;;(XSHOW_LAI "LUNG")<br/>(defun XSHOW_LAI (DICT / KEY N LEN LIS LIS1 LOOP MSG MODE S1 TMPKEY)</p><p> (if (not (setq N (vlax-ldata-get (strcat DICT "_N") "N")))<br/> (progn<br/> (setq N 1)<br/> (vlax-ldata-put (strcat DICT "_N") "N" 1)<br/> )<br/> )<br/> (if (not (setq LIS (vlax-ldata-get (strcat DICT "_LIS") "LIS")))<br/> (progn<br/> (setq LIS '())<br/> (vlax-ldata-put (strcat DICT "_LIS") "LIS" LIS)<br/> )<br/> )</p><p> (setq LOOP t)<br/> (setq MSG<br/> "\nE-显示所有/D-隐藏所有/V-显示记录/C-隐藏记录/S-显示上个/F-显示下个/空格-显<br/>示锁定/R-显示解锁/B-显示记录/X-退出/Q-删除标记/Z-清空记录/A-增加隐藏:"<br/> )<br/> (while LOOP<br/> (setq MODE (grread t 4 2))<br/> (prompt MSG)<br/> (cond</p><p> ((member MODE '((2 13) (2 88) (2 120) (11 0)))<br/> (setq LOOP NIL)<br/> )</p><p> ((member MODE '((2 65) (2 97))) ;A<br/> (if (CHECK DICT)<br/> (setq KEY (rtos (1+ (last (setq KEY_LIST<br/> (vl-sort (mapcar 'atof (CHECK DICT)) '<)<br/> )<br/> )<br/> )<br/> )<br/> )<br/> (setq KEY "1")<br/> )<br/> (setq LEN (length (vlax-ldata-list DICT)))<br/> ;;(vlax-ldata-put "LUNG" "KEY_LIST" KEY_LIST)<br/> ;;(setq KEY (rtos (1+ (apply 'max (mapcar 'atof (CHECK "LUNG"))))))<br/> (prompt "\n增选隐藏物件:")<br/> (setq S1 (ssget))<br/> (if S1<br/> (MAKE_DICT DICT KEY S1)<br/> )<br/> )</p><p> ((member MODE '((2 69) (2 101))) ;E<br/> (C:XSHOWALL)<br/> )</p><p> ((member MODE '((2 100) (2 68))) ;D<br/> (C:XHIDEALL)<br/> )</p><p> ((member MODE '((2 67) (2 99))) ;C<br/> (setq CHECK_LIST (CHECK DICT))<br/> (mapcar '(lambda (X)<br/> (DICT_OFF DICT X)<br/> )<br/> CHECK_LIST<br/> )<br/> (prompt "\n隐藏所有标记物件!")<br/> )</p><p> ((member MODE '((2 86) (2 118))) ;V<br/> (setq CHECK_LIST (CHECK DICT))<br/> (mapcar '(lambda (X)<br/> (DICT_ON DICT X)<br/> )<br/> CHECK_LIST<br/> )<br/> (prompt "\n显示所有标记物件!")<br/> )</p><p> ((member MODE '((2 83) (2 115))) ;S<br/> (if (not (setq N (vlax-ldata-get (strcat DICT "_N") "N")))<br/> (progn<br/> (setq N 1)<br/> (vlax-ldata-put (strcat DICT "_N") "N" 1)<br/> )<br/> )<br/> (if (setq LIS1 (CHECK DICT))<br/> (progn<br/> (setq LEN (length LIS1))<br/> (if (= N (1- LEN))<br/> (setq N 0)<br/> (setq N (1+ N))<br/> )<br/> (DICT_ON DICT (nth N LIS1))<br/> (if (= N 0)<br/> (setq TMPKEY (nth (1- LEN) LIS1))<br/> (setq TMPKEY (nth (1- N) LIS1))<br/> )<br/> (if (not (member TMPKEY LIS))<br/> (DICT_OFF DICT TMPKEY)<br/> )<br/> (vlax-ldata-put (strcat DICT "_N") "N" N)<br/> (prompt (strcat "\n显示第"<br/> (nth N LIS1)<br/> "笔物件,锁定串列="<br/> (vl-prin1-to-string LIS)<br/> )<br/> )<br/> )<br/> )<br/> )</p><p> ((member MODE '((2 102) (2 70))) ;F<br/> (if (not (setq N (vlax-ldata-get (strcat DICT "_N") "N")))<br/> (progn<br/> (setq N 1)<br/> (vlax-ldata-put (strcat DICT "_N") "N" 1)<br/> )<br/> )<br/> (if (setq LIS1 (CHECK DICT))<br/> (progn<br/> (setq LEN (length LIS1))<br/> (if (= N 0)<br/> (setq N (1- LEN))<br/> (setq N (1- N))<br/> )<br/> (DICT_ON DICT (nth N LIS1))<br/> (if (= N (1- LEN))<br/> (setq TMPKEY (nth 0 LIS1))<br/> (setq TMPKEY (nth (1+ N) LIS1))<br/> )<br/> (if (not (member TMPKEY LIS))<br/> (DICT_OFF DICT TMPKEY)<br/> )<br/> (vlax-ldata-put (strcat DICT "_N") "N" N)<br/> (prompt (strcat "\n显示第"<br/> (nth N LIS1)<br/> "笔物件,锁定串列="<br/> (vl-prin1-to-string LIS)<br/> )<br/> )<br/> )<br/> )<br/> )</p><p> ((member MODE '((2 32))) ;""<br/> (if (setq LIS1 (CHECK DICT))<br/> (progn<br/> (if<br/> (not (setq LIS (vlax-ldata-get (strcat DICT "_LIS") "LIS"))<br/> )<br/> (progn<br/> (setq LIS '())<br/> (vlax-ldata-put (strcat DICT "_LIS") "LIS" LIS)<br/> )<br/> )<br/> (if (not (member (nth N LIS1) LIS))<br/> (setq LIS (append LIS (list (nth N LIS1))))<br/> )<br/> (vlax-ldata-put (strcat DICT "_LIS") "LIS" LIS)<br/> (prompt (strcat "\n显示锁定串列"<br/> (vl-prin1-to-string LIS)<br/> ",目前显示第"<br/> (nth N LIS1)<br/> "笔物件"<br/> )<br/> )<br/> )<br/> )<br/> )</p><p> ((member MODE '((2 114) (2 82))) ;R<br/> (if (setq LIS1 (CHECK DICT))<br/> (progn<br/> (if<br/> (not (setq LIS (vlax-ldata-get (strcat DICT "_LIS") "LIS"))<br/> )<br/> (progn<br/> (setq LIS '())<br/> (vlax-ldata-put (strcat DICT "_LIS") "LIS" LIS)<br/> )<br/> )<br/> (if (member (nth N LIS1) LIS)<br/> (setq LIS (vl-remove (nth N LIS1) LIS))<br/> )<br/> (vlax-ldata-put (strcat DICT "_LIS") "LIS" LIS)<br/> (prompt (strcat "\n显示锁定串列"<br/> (vl-prin1-to-string LIS)<br/> ",目前显示第"<br/> (nth N LIS1)<br/> "笔物件"<br/> )<br/> )<br/> )<br/> )<br/> )</p><p> ((member MODE '((2 122) (2 90))) ;Z<br/> ;|<br/> (setq<br/> KEY_LIST1 (mapcar 'rtos<br/> (vl-sort (mapcar 'atof (CHECK "LUNG")) '<)<br/> )<br/> )|;<br/> ;|<br/> (setq CHECK_LIST (CHECK "LUNG"))<br/> (mapcar '(lambda (X)<br/> (vlax-ldata-delete "LUNG" X)<br/> )<br/> CHECK_LIST<br/> )|;<br/> (initget "Y ")<br/> (if (getkword "\n真的要清除所有标记物件!<N>:")<br/> (progn<br/> (dictremove (namedobjdict) DICT)<br/> (dictremove (namedobjdict) (strcat DICT "_N"))<br/> (dictremove (namedobjdict) (strcat DICT "_LIS"))<br/> (prompt "\n已清除所有标记物件!")<br/> )<br/> (prompt "\n保留标记物件!")<br/> )<br/> )</p><p> ((member MODE '((2 113) (2 81))) ;Q<br/> (if (setq LIS1 (CHECK DICT))<br/> (progn<br/> (DICT_ON DICT (nth N LIS1))<br/> (vlax-ldata-delete DICT (nth N LIS1))<br/> (prompt (strcat "\n已删除"<br/> (nth N LIS1)<br/> "标记,目前标记"<br/> (vl-prin1-to-string (CHECK DICT))<br/> )<br/> )<br/> (setq N 1)<br/> )<br/> )<br/> )<br/> ((member MODE '((2 66) (2 98)))<br/> (prompt<br/> (strcat "\n目前标记" (vl-prin1-to-string (CHECK DICT)))<br/> )<br/> )<br/> )<br/> )<br/> (princ)<br/>)</p>小神仙 发表于 2009-2-25 12:37:00
好东西,可惜要威望,看不了,zark 发表于 2009-9-25 00:06:00
龙龙仔,强!yzys 发表于 2009-11-23 00:10:00
学习学习xyh2006 发表于 2010-6-23 11:10:00
下來 試試看~~~~kkt123 发表于 2010-8-23 07:46:00
人谦虚,东西实在qingtao210 发表于 2010-9-23 23:44:00
看不到nuts26173802 发表于 2010-9-26 13:50:00
看看什么东西popomo 发表于 2010-9-30 07:10:00
支持