Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Undo LISP does not REGEN

1 view
Skip to first unread message

GTVic

unread,
Dec 7, 2004, 1:05:47 AM12/7/04
to
I have a LISP routine that modifies/redefines blocks. It works fine but if the user hits Undo after using the routine the result of the undo is not visible until they use the REGEN command.

The routine modifies the internal block entities using the entxxx functions and does a regen at the end to show the result.

Is there any way to get AutoCAD to regen when the user uses the UNDO command?

GTVic

unread,
Dec 7, 2004, 2:55:14 AM12/7/04
to
I forgot to mention that I have two other LISP routines that are very similar except they use the INSERT command to redefine the blocks.

Besides that the undo and regen stuff is all basically identical. For these other two routines the user can undo and autocad performs the undo and regenerates automatically.

Joe Burke

unread,
Dec 7, 2004, 6:13:01 AM12/7/04
to
Hard to comment without seeing the code.

Check the program structure in the one which doesn't regen, compared to one which
does.

Something like this should regen when undo is called.
start undo
code
regen
end undo

Command: regen
Regenerating model.

Command: _.undo Enter the number of operations to undo or
[Auto/Control/BEgin/End/Mark/Back] <1>: 1 REGEN

Joe Burke

"GTVic" <nos...@address.withheld> wrote in message
news:12640166.110240614...@jiveforum2.autodesk.com...

Kent Cooper, AIA

unread,
Dec 7, 2004, 8:41:13 AM12/7/04
to
Check out the REGENAUTO system variable.

--
Kent Cooper, AIA


"GTVic" wrote...

Tom Smith

unread,
Dec 7, 2004, 9:34:11 AM12/7/04
to
> REGENAUTO system variable.

That's a command, the actual variable is REGENMODE.

This is one of those oddballs that has a command to change a variable which
is different from the variable name -- I think a carryover from when you
couldn't enter a variable name at the command prompt without going through
SETVAR.


Tony Tanzillo

unread,
Dec 7, 2004, 2:28:40 AM12/7/04
to
Does your code enclose the operations it does
inside of an UNDO group?

E.g.:

(command "._undo" "_begin")

;; Modify objects here and redefine blocks

(command "._undo" "_end")


--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005
http://www.acadxtabs.com

"GTVic" <nos...@address.withheld> wrote in message news:19888022.110239957...@jiveforum2.autodesk.com...

GTVic

unread,
Dec 7, 2004, 9:53:52 PM12/7/04
to
REGENAUTO/REGENMODE is ON

See my reply to Tony's message above.

GTVic

unread,
Dec 7, 2004, 9:52:05 PM12/7/04
to
I don't think there is a problem with the code or REGENAUTO.

Tony, I modified my inital post to show info about the undo group. You must have posted before I updated it.

This works:
(command "undo" "begin")
;;; redefine blocks via INSERT command
(command "undo" "end")

This does not work
(command "undo" "begin")
;;; redefine blocks via ENTXXX functions
(command "regen")
(command "undo" "end")

The INSERT command has a built-in regen so the undo recognizes that and performs a regen on an undo.

The ENTXXX functions require a manual regen and the undo command skips manual regens.

Joe Burke

unread,
Dec 9, 2004, 9:37:46 AM12/9/04
to
I don't think you'll find an answer here, until you post the code.

Contrary to what you seem to expect, we ain't mind-readers. Something like this,
"redefine blocks via ENTXXX functions", is meaningless within the context of your
question.

I don't mean to be rude. But I do mean to say, a proper question will likey return a
proper answer. Similar to how the topic at hand behaves.

Joe Burke


Tom Smith

unread,
Dec 9, 2004, 9:50:03 AM12/9/04
to
> REGENAUTO/REGENMODE is ON
>
> See my reply to Tony's message above.

You'll need to post the code, per Joe's comments, or at least a small sample
that exhibits the behavior you describe.

I haven't seen this. I routinely run functions which redefine blocks by way
of entmod or entmake, and they behave as expected with respect to undo. I
don't force a regen, instead I do an entupd on the affected inserts, and of
course the whole function is wrapped in an undo group. If I undo afterwards,
the blocks return to their previous appearance, apparently without a regen,
regardless of the regenmode setting.


Tony Tanzillo

unread,
Dec 9, 2004, 5:15:39 PM12/9/04
to
There is a problem with UNDO and REGEN. It has nothing to do with
redefining blocks. It can also be seen when thawing layers and then
forcing a regen inside of an UNDO group. When AutoCAD undoes the
operation, the required regen does not happen.

Still haven't figured out what exactly causes it, but I'll venture to
guess that no amount of posted code is going to lead to a solution.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005
http://www.acadxtabs.com

"Tom Smith" <nospam> wrote in message news:41b865e0$1_1@newsprd01...

Tom Smith

unread,
Dec 10, 2004, 8:22:35 AM12/10/04
to
> There is a problem with UNDO and REGEN.

Interesting. I suppose I haven't created a situation in which the bug was
apparent.

0 new messages