Obtaining Group names as a list using AutoLISP

By Balaji Ramamoorthy

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

)


Comments

Leave a Reply

Discover more from Autodesk Developer Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading