(sslength sname)
The sslength function retrieves the number of entities in a given selection set sname.
Examples
: (setq selset1 (ssget "_W" '(0 0) '(100 100)))
<Selset: 4b1f1360:00000030>
: (sslength selset1)
17