To obtain all the group names in an AutoLISP list variable, first get the “ACAD_GROUP” dictionary and then extract all the group names from it.
Here is a sample code :
(defun GetGroupList ()
(setq grp (dictsearch (namedobjdict) "ACAD_GROUP"))
(setq grpList (list))
(while (/= (assoc 3 grp) nil)
(setq grpList (cons (cdr (assoc 3 grp)) grpList ))
(setq grp (cdr (member (assoc 3 grp) grp)))
)
grpList
)

Leave a Reply