Tim, I am not sure an implied selection set will resolve the issue.
Either I am missing something or I am not explaining the issue correctly.
When the function is called to select objects, there is nothing selected, and there should be nothing selected. i.e. the user should select the items only when prompted to do so. The idea is that the user either enters a keyword OR begins selecting objects on the screen as prompted ..
Select Objects [Some/Arbitrary/Options/Go/Here]:
Since I cannot use option keywords with ssget, I must through necessity abandon the thought of using ssget for the selection mechanism. So, I use grread to track the mouse and filter all input. If a point is selected, the second corner is immediately prompted for ... but I want to be able to select multiple times before continuing the program .. since I couldn't use ssget for my first selection set, I have to emmulate a selection window. getcorner works well for that purpose ... so now I have 2 points from my first (emmulated) selection ... those points are passed to ssget "_W" or "_C" depending upon the order of the point selection, thus abiding by the default AutoCAD selection process of crossing or window depending upon the direction of the selection window.
Now I have a selection set ... maybe ... since I am filtering for specific items, the user may think they have selected something when in fact they have not ... if the user continues to select, the subsequent selections can be made with either the code I previously posted OR use a modified version of the code Tim provided. If the user does not attempt to select any further items, the selection set will be empty, but through necessity, since the "select" command is issued immediately following the first selection process, there is no way to know if the user selected anything in the second attempt .. thus I am forced to use ssget "_P" after the select command ends.
Now, keep in mind that the first selection set was empty, thus a new "previous" selection set isn't created ... and "select" didn't select anything ... so in reality there are no items selected, but ssget "_P" returns the items selected the last time a selection set was successfully created ... i.e. from whatever task was previously completed.
It appears as though I have use ssget the entire way, passing the points on the fly and grab selection sets each time, iterate through them, and add them back to the original selection set. This isn't really a problem on small drawings, but when you start having selection sets of 1000 items or more that have to be filtered AND added to another selection set, the process becomes painfully slow... another reason why I preferred to use the internal selection mechanism.
I have found a way to make the previous selection set go away ... but it isn't pretty and I don't like doing it ...
1) entmake a graphical entity in the drawing
2) erase it using (vl-cmdf "erase" (entlast) "")
for obvious reasons that could cause objects to disappear in the drawing ... but it does clear the "previous" selection set