Hi Oak3s,
You will need to iterate through the acquired SelectionSet, operating on each entity in turn.
There are various ways to accomplish this (in all examples, 'ss' is the SelectionSet returned by ssget):
1) Using a While Loop:
(setq i -1)
(while (setq ent (ssname ss (setq i (1+ i))))
(setq p1 (cdr (assoc 10 (entget ent))))
...
)
2) Using a Repeat Expression:
(repeat (setq i (sslength ss))
(setq ent (ssname ss (setq i (1- i)))
p1 (cdr (assoc 10 (entget ent)))
)
...
)
3) Using a Foreach Expression (slower):
(foreach ent (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss)))
(setq p1 (cdr (assoc 10 (entget ent))))
...
)
Hope this gets you started!
Lee