The following code selects all the entities contained in a group.
(defun selgrp (grpname)
;; grpname is the group name, it accepts
;; unnamed groupnames, such as *A1
(setq grp (dictsearch (namedobjdict) "ACAD_GROUP"))
(setq a1 (dictsearch (cdr (assoc -1 grp)) grpname))
(setq ss (ssadd))
(while (/= (assoc 340 a1) nil)
(setq ent (assoc 340 a1))
(setq ss (ssadd (cdr ent) ss))
(setq a1 (subst (cons 0 "") ent a1))
)
ss
)