块产生的废组也能清理
;; pugroup.lsp<BR>(defun pugroup_error (s)<BR> (if (/= s ;|MSG1|;"Function cancelled")<BR> (princ (strcat ;|MSG2|;"\nError: " s))<BR> )<BR> (setq *error* old_error)<BR> (setvar ;|NOXLATE|;"tilemode" old_tilemode)<BR> (princ)<BR>)<BR>(defun Hasent(grpdict grpname)<BR> (setq group (dictsearch (cdar grpdict) grpname))<BR> (setq gromeb(cdr (assoc 340 group)))<BR> (if (= (cdr (assoc 70 group)) 3)<BR> nil<BR> t)<BR>)<BR>(defun C:pugroup ( / grpdict name echo0 tilemode0 pick0 count1 count2 count3 )<BR> (setq old_error *error*<BR> *error* pugroup)<BR> (setq echo0 (getvar ;|NOXLATE|;"cmdecho")<BR> tilemode0 (getvar ;|NOXLATE|;"tilemode")<BR> pick0 (getvar ;|NOXLATE|;"pickstyle")<BR> )<BR> (setvar ;|NOXLATE|;"cmdecho" 0)<BR> (setvar ;|NOXLATE|;"pickstyle" 0)<BR> (setq grpdict nil<BR> name nil<BR> count1 0<BR> count2 0<BR> count3 0<BR> )<BR> (setvar ;|NOXLATE|;"tilemode" 1)<BR> (setq grpdict (dictsearch ;|p300d|;(namedobjdict) ;|NOXLATE,p300f|;"ACAD_GROUP"))<BR> ;grpdict是包含所有group内容的容器<BR> (setq grpnew grpdict)<BR> (if (not (null grpdict))<BR> (foreach item grpdict ;start of foreach<BR> (progn ; progn 1<BR> (if (= (car item) 3); if 2<BR> (progn ; progn 2<BR> (setq name (cdr item ))<BR> (if (Hasent grpdict name); if 3<BR> (progn; progn 3<BR> (if (not gromeb)<BR> (progn<BR> (entdel (cdadr (member item grpnew))) <BR> (setq count2 (+ count2 1))<BR> ) <BR> )<BR> ) ;end of progn 3<BR> (progn<BR> (entdel (cdadr (member item grpnew)))<BR> (setq count3 (+ count3 1))<BR> ) <BR> ) ; end of if 3<BR> (setq count1 (+ count1 1))<BR> ) ;end of progn 2<BR> ) ;end of if 2 <BR> ) ;end of progn 1 <BR> ) ;end of foreach<BR> )<BR> (princ "\n")<BR> (princ count1)<BR> (princ " groups member foung.\n")<BR> (princ count2)<BR> (princ " groups without objects have be cleaned.\n")<BR> (princ count3)<BR> (princ " groups without listed have be cleaned.\n")<BR> (princ "\n")<BR> (princ (- count1 count2 count3))<BR> (princ " groups have be remened.\n")<BR> (setvar ;|NOXLATE|;"tilemode" tilemode0)<BR> (setvar ;|NOXLATE|;"cmdecho" echo0)<BR> (setvar ;|NOXLATE|;"pickstyle" pick0)<BR> (setq *error* old_error)<BR> (princ)<BR>)<BR>;为了为了表达我对超级版主meflying最崇高的敬意和谢意,<BR>;请所有使用了这个程序的人们别忘了感谢超级版主meflying<BR>;的功劳,正是他使我摆脱了插入块中的废组名产生程序中断。<BR>;如哪位大侠要对这个程序编制者表达谢意,请首先感谢<BR>;超级版主meflying,最好对meflyinge有一定的物质感谢,毕竟<BR>;人还是要有一定的爱心和现实主义。<BR> 好像写的长了些,看的我头晕 MEFLYING版主非常棒的! Thanks for sharing. Collected ^^ 没看懂为何程序查快会奔溃
页:
[1]