So what is a selection set?
A SelectionSet is a SelectionSet - SelectionSets have their own data type in LISP: PICKSET
Command: (setq ss (ssget))
Select objects: 2 found
Select objects:
<Selection set: 5>
Command: (type ss)
PICKSET
In a sense, a SelectionSet is an array of entities, with each entity residing at an index in the array. Formally, it cannot be called a 'LIST' since it is not of LIST type and cannot be manipulated as such.
Note also that when manipulating SelectionSets, the variable does not 'store' the SelectionSet, but rather 'points' to it (the same applies to Entity Names), hence, we can modify the SelectionSet using such functions as ssdel/ssadd without needing to change the value of the variable pointing to the SelectionSet:
Command: (sslength ss)
2
Command: (ssdel (ssname ss 0) ss)
<Selection set: 5>
Command: (sslength ss)
1
Notice we
didn't use:
(setq ss (ssdel (ssname ss 0) ss))
Also, the index of entities in a SelectionSet is dynamic - if you delete an entity at index 0 say, the indexes of all the other entities will be shifted down 1:
Command: (sslength ss)
2
Command: (ssdel (ssname ss 0) ss)
<Selection set: 5>
Command: (sslength ss)
1
Command: (ssname ss 0)
<Entity name: 7ef03a78>
Command: (ssname ss 1)
nil
While and repeat evaluate expressions, repeating a course of action over and over again till stopped somehow.
While: Loop expression evaluation until a test expression returns nil.
Repeat: Loop expression evaluation a set number of times.
Foreach: evaluate one or more expressions on every item of a list in turn.
Note that when we use such functions with SelectionSets, we are only constructing a loop in which to use
ssname.
I have seen vlax-for functions used on tables so this tells me that a selection set is not a table and it is not a list, so what is a selection set? Is it its own thing?
vlax-for is for use on VLA Collection Objects, i.e. the Layer Collection, Block Collection, but also Dictionaries.