偶的作品:飞诗CAD程序管理大一统~
内有两个源程序正是你想要的!:- ;;制作匿名组
- (defun c:mak_*group (/ ss)
- (princ "\n选取制作匿名组的对象:")
- (if (setq ss (ssget))
- (fsxm-add-group ss "*")
- )
- (princ)
- )
- ;;解散群组
- (defun C:EXPLODE_GROUP (/ allg data group ss)
- (if (setq ss (ssget))
- (foreach en (fsxm-ss->enlist ss)
- (setq data (entget en))
- (setq group
- (vl-remove-if
- '(lambda (a)
- (or (/= (car a) 330)
- (/= (fsxm-getdxf 0 (entget (cdr a))) "GROUP")
- )
- )
- data
- )
- )
- (setq allg (reverse (dictsearch (namedobjdict) "ACAD_GROUP")))
- (foreach a (mapcar 'cdr group)
- (princ "\nEXPLODE GROUP : ")
- (princ (cdadr (member (cons 350 a) allg)))
- (entdel a)
- )
- )
- )
- (princ)
- )
|