Dan,
Something like this might work for you. Select the group with pickstyle set to 1 or 3, IOW group selection on. Isolate the group (selection set) with the ISO function and stretch. Restore the invisible objects with the USO function.
Of course the ISO and USO functions could be sub-functions within a program specifically designed to isolate a group, for whatever purpose.
Also keep in mind, they will not be fast with a drawing containing many objects in model space. Every object is examined by both functions.
;; Isolate selected objects in model space.
(defun c:ISO ( / doc vislst)
(setq doc (vla-get-ActiveDocument (vlax-get-acad-object)))
(and
(or
(= 1 (vlax-get doc 'ActiveSpace))
(prompt "\nIsolate works in model space. ")
)
(setq vislst (SSVLAList (ssget)))
(vlax-for x (vla-get-ModelSpace doc)
(if (not (vl-position x vislst))
(vla-put-visible x :vlax-false)
)
)
)
(princ)
) ;end
;; Unisolate objects in model space.
(defun c:USO ( )
(vlax-for x
(vla-get-ModelSpace
(vla-get-ActiveDocument
(vlax-get-acad-object)))
(vla-put-visible x :vlax-true)
)
(princ)
) ;end
;Argument: a selection set.
;Returns: a list of VLA objects.
(defun SSVLAList (ss / obj lst i)
(setq i 0)
(if ss
(repeat (sslength ss)
(setq obj (vlax-ename->vla-object (ssname ss i))
lst (cons obj lst)
i (1+ i)
)
)
)
(reverse lst)
) ;end
Joe Burke
EDIT: Wrapped your code in [ code ] tags, Joe