;快速建组
(defun c:gg(/ ss)
(setq ss(ssget))
(setvar "cmdecho" 0)
(command "-group" "" "*" "" ss "")
(setvar "cmdecho" 1)
(princ "\n选定对象已经组合。")
(princ)
)
(command "-group" "" "*" "" zss1 "");创建无名组(常用)
;;多选解组
(defun c:gv ( / s e g i)
(if (setq s (ssget))
(repeat (setq i (sslength s))
(setq e (ssname s (setq i (1- i))))
(if (= "GROUP" (cdr (assoc 0 (entget (setq g (cdr (assoc 330 (entget e)))))))) (entdel g))
)
)
(prin1)
)
(princ "\n程序加载完成,解组快捷命令:gv")
;;制作匿名组
(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)
)
(defun c:xx()
(if(setq en(entsel "选择要炸开的组: "))
(progn
(setq gr(cdr(assoc 0 (entget(cdr(assoc 330(entget(car en))))))))
(if (= "GROUP" gr)
(entdel (cdr(assoc 330(entget(car en)))))
(prompt "所选对象没有被分组!")
)
)
)
(princ)
)