You need to put your selection function within a while loop that tests to see if an object has been selected. Here's an example:
Now it's quite some time since I did any serious LISPing and so there may be a more modern way to go about this but it does work. The user will continue to be prompted until an object is selected.Code:(setq obj nil) (while (= obj nil) (setq obj (entsel "\nSelect object: ")) )
If you only want a single object, entsel is simpler than ssget because no selection set is required.