Speaking of chewing, here I go making things more difficult than they absolutely need to be again. What I was ultimately trying to do besides understand recursion was to take the idea of filtering entsel that Chuck Gabriel started a topic on. I remembered 7's little
gem and thought it would be cool to make that more robust. I was thinking of using mapcar lambda functions to parse through each item of the string argument and compare it with the selected result. Funny thing is, I was planning on using wcmatch, but since I haven't done much with wcmatch in a long while, I forgot that it can take a comma delimited string and use it to compare the selected item. While this was a good learning experience, it was obviously unnecessary for what I really needed. However, here is the code with 7's original name intact so we know where it started.
(defun entse7 (wildcard / ent)
(cond ((setq ent (entsel (strcat "Get any " wildcard " type of object: ")))
(if (not (wcmatch (cdr (assoc 0 (entget (car ent)))) wildcard))
(entse7 wildcard)
)
)
(t (entse7 wildcard))
)
ent
)
To really tighten it up, I suppose it would be a good idea to gather a list of possible named items and compare the list with it, but I won't.
Now, you might still be asking, why do I need a filtered list of objects for a function that can only return one object? The intent here is to use entse7 in a loop to gather objects in a list, then manipulate that list according to order of selection. Ssget is just too loose for what I'm looking at. 'zat make sense?