0 Members and 1 Guest are viewing this topic.
it does not add new entities to the drawing database
you should instead examine the members of the group prior to ungrouping.
(setq ss(ssget))
(defun C:XG2 ( / SelSet) (princ "\nSelect GROUP to EXPLODE: ") (and (setq SelSet (ssget)) (vl-cmdf "_.UNGROUP" (ssname SelSet 0)) (vl-cmdf "_.SELECT" SelSet "") ))
Maybe this too:Code - Auto/Visual Lisp: [Select](defun c:foo (/ d e) (if (and (setq e (car (entsel))) (setq d (cdr (assoc 330 (entget e)))) (= "GROUP" (cdr (assoc 0 (entget d)))) ) (progn (setq s (ssadd)) (foreach x (entget d) (and (= 340 (car x)) (setq s (ssadd (cdr x) s)))) (sssetfirst nil s) (entdel d) ) ) (princ))
ronjonp thank you.Maybe for somebody it is obvious, but . . .. . .this means that(entdel d) deletes the group definitionbut doesn't delete the entities contained in the group !In other words, it explodes the group.Right ?