TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: domenicomaria on May 24, 2021, 03:12:29 AM
-
I need to catch all the objects that were member of an exploded group . . .
Does somebody know a simple way to get this ?
(defun C:K ( / ent-lst x-el x-en)
(setq x-el (LM:entlast (entlast) ) )
(setq x-en (entsel "\nselect GROUP to EXPLODE :") )
(vl-cmdf "ungroup" x-en)
(setq ent-lst (LM:entnexttoend x-el) )
)
(setq ent-lst (LM:entnexttoend x-el) ) does not work !
-
Ungrouping is not the same action as exploding - it does not add new entities to the drawing database; you should instead examine the members of the group prior to ungrouping.
-
it does not add new entities to the drawing database
I supposed that . . .
-
you should instead examine the members of the group prior to ungrouping.
Does somebody know a simple way to get this ?
"simple" means not elegant, but working ! :whistling:
-
Why not as Lee sugusted use code like
(setq ss(ssget))
to select the group which puts all the group entities into a selection set?
Maybe if you posted what code you're working on someone here would offer a simple elegant solution.
-
(defun :GROUP
-GET
-DATA
(e
/ l r
) )
r
)
)
l
)
)
)
(defun c:XG
( / grp
-data grp
-ss x
-en
) (setq x
-en
(entsel "\nselect GROUP to EXPLODE :") ) (setq grp
-data
(:GROUP
-GET
-DATA
(car x
-en
) ) ) )
grp-ss
)
it seems to work . . .
-
Only an example from tombu suggestion:
(defun C:XG2 ( / SelSet)
(princ "\nSelect GROUP to EXPLODE: ")
(and
(setq SelSet (ssget))
(vl-cmdf "_.UNGROUP" (ssname SelSet 0))
(vl-cmdf "_.SELECT" SelSet "")
)
)
-
(defun C:XG2 ( / SelSet)
(princ "\nSelect GROUP to EXPLODE: ")
(and
(setq SelSet (ssget))
(vl-cmdf "_.UNGROUP" (ssname SelSet 0))
(vl-cmdf "_.SELECT" SelSet "")
)
)
8-)
e si ...
-
Maybe this too:
*localized 's'
-
Maybe this too:
very nice and interesting !
-
ronjonp thank you.
Maybe for somebody it is obvious, but . . .
. . .
this means that
(entdel d)
deletes the group definition
but doesn't delete the entities contained in the group !
In other words, it explodes the group.
Right ?
-
ronjonp thank you.
Maybe for somebody it is obvious, but . . .
. . .
this means that
(entdel d)
deletes the group definition
but doesn't delete the entities contained in the group !
In other words, it explodes the group.
Right ?
Yes :-) .. well it deletes the group the entities are contained in.