Just out of interest, would this be quicker, using a WHILE instead of REPEAT?
(defun lmac-selectionSet->array (ss / e c r)
(setq c -1)
(while (setq e (ssname ss (setq c (1+ c))))
(setq r (cons (vlax-ename->vla-object e) r)))
(vlax-safeArray-fill
(vlax-make-safeArray
vlax-vbObject
(cons 0 (1- (length r))))
(reverse r)))