Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

VLisp code for ACAD GROUPS handling

2 REPLIES 2
Reply
Message 1 of 3
Anonymous
185 Views, 2 Replies

VLisp code for ACAD GROUPS handling

Is there in some place,
a good free VLisp code,
about acad Groups ?

. . . given an entity name, is it a member of a group and what is the name
of this group ?
. . . I want create a new group with a new name : "new_group_name_001".
Exists this group already ?
. . . I need to explode a group . . .
. . . to remove some entities . . .
. . . to add some entities . . .
. . . to rename it . . .
. . . given a group name I need to get the correspondent selection set . . .
and a lot of these questions . . .

thanks

Ciao
Domenico
2 REPLIES 2
Message 2 of 3
Anonymous
in reply to: Anonymous

This might help out:

;Returns a list of group names the entity is a child of, innermost first
in the list.
;Written By: Michael Puckett.
(defun gnames (ename / key dct rtn)
(setq key (cons 340 ename)
dct (dictsearch (namedobjdict) "acad_group")
)
(while (setq dct (member (assoc 3 dct) dct))
(if (member key (entget (cdadr dct)))
(setq rtn (cons (cdar dct) rtn))
)
(setq dct (cddr dct))
)
(reverse rtn)
)

-Jason

HSH CAD World wrote:
>
> Is there in some place,
> a good free VLisp code,
> about acad Groups ?
>
> . . . given an entity name, is it a member of a group and what is the name
> of this group ?
> . . . I want create a new group with a new name : "new_group_name_001".
> Exists this group already ?
> . . . I need to explode a group . . .
> . . . to remove some entities . . .
> . . . to add some entities . . .
> . . . to rename it . . .
> . . . given a group name I need to get the correspondent selection set . . .
> and a lot of these questions . . .
>
> thanks
>
> Ciao
> Domenico
Message 3 of 3
Anonymous
in reply to: Anonymous

Thanks
Jason Piercey wrote in message
3B38AF65.1A02087C@atreng.com...
> This might help out:
>
> ;Returns a list of group names the entity is a child of, innermost first
> in the list.
> ;Written By: Michael Puckett.
> (defun gnames (ename / key dct rtn)
> (setq key (cons 340 ename)
> dct (dictsearch (namedobjdict) "acad_group")
> )
> (while (setq dct (member (assoc 3 dct) dct))
> (if (member key (entget (cdadr dct)))
> (setq rtn (cons (cdar dct) rtn))
> )
> (setq dct (cddr dct))
> )
> (reverse rtn)
> )
>
> -Jason
>
> HSH CAD World wrote:
> >
> > Is there in some place,
> > a good free VLisp code,
> > about acad Groups ?
> >
> > . . . given an entity name, is it a member of a group and what is the
name
> > of this group ?
> > . . . I want create a new group with a new name : "new_group_name_001".
> > Exists this group already ?
> > . . . I need to explode a group . . .
> > . . . to remove some entities . . .
> > . . . to add some entities . . .
> > . . . to rename it . . .
> > . . . given a group name I need to get the correspondent selection set .
. .
> > and a lot of these questions . . .
> >
> > thanks
> >
> > Ciao
> > Domenico

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost