Probably what is confusing is thinking of the objects as a selectionset as opposed to the AcadSelectionset object. The Selectionsets collection cannot accept duplicate names in its index, as is true with any collection or hash table. Thus, you need to handle the error that would be generated if you try to add a new ss to the collection using a name that already exists. If no ss with that name exists, you can add it. Once you do, you can add objects to its collection. This is what you probably are thinking of as a "selectionset", the acad entities themselves. But a selectionset can be empty, its the container that's the selectionset. If you use Selectionset.Erase, you delete the objects in the ss, but not the ss. If you use Selectionset.Delete, you delete the ss, but not the entities in it.
Ed
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
How to
post your code.