@ Stefan:
You are using:
(ssget ":E:S" ...)
I find that the selection set can contain more than 1 item with this code. For example if entities are superimposed.
:E Everything within the cursor's object selection pickbox.
Oh, no!! My whole life is a lie!! Seriously, I was convinced just one object is selected. Never tried to get another object other than (ssname ss 0) from a ":E:S" selection.
Well, trying your suggestion, "_+.:S", seems to solve the problem... But, as you do with every native command, when you want to select just a single object you make sure the selected object is the one you want by zooming the area.
Beside, if 2 objects are overlapping, your suggestion it does not guarantee that the selected object is the one you want.
Thanks for the heads up.