I know I should, but I don't regularly use undo in my little macros; hence the booboo.
If the problem is to find the preceding object to a selected one, Here's a suggestion: An
object's handle never changes. But owing to deletions etc. there will be holes between
handles. So we can't look for (Handle - 1), we need the preceding object, which might be
(Handle -28). A binary search of the database will show the numerical index of the
selected object with an efficiency considerably better than simply examining each object.
How does one do a binary search in a selection set?
rs
You don't know where in the data base your selected object is.
wrote in message news:5155533@discussion.autodesk.com...
Bob, I don't think you got the undoing quite right -- you'd need to end the undo group,
then do a simple "u" to perform the undo.
Another approach, also untried, would be to use the double entdel trick to restore the
last entity.
(setq lastent (entdel (entlast)))
(setq nexttolastent (entlast))
(entdel lastent)