What do you guys do when you want the user to be able to interactively select an entity?
Entsel in its raw form leaves me wanting something more. If the user misses their pick (easy to do), they don't get any second chances. I've tried using ssget with the ":S" option, but I wasn't really happy with that either. I honestly can't remember any longer what it did or didn't do that I didn't like.
I've tried wrapping up entsel in various looping constructs with tests for various conditions, and I've finally come up with something I can live with. I just wonder if there is a better way.
(defun getEntity (msg type / input ent)
(if
(vl-catch-all-error-p
(vl-catch-all-apply
'(lambda ()
(while
(and
(= 3 (car (setq input (grread nil (logior 2 4 8) 2))))
(or
(null (setq ent (nentselp (cadr input))))
(and
type
(/= (strcase type)
(cdr (assoc 0 (entget (car ent))))
)
)
)
)
)
)
)
)
nil
ent
)
)
My apologies if this has already been done to death. If it has, I'd love to see the canonical method.