Discussion:
Flush undo stack from VBA
(too old to reply)
Anthony
2004-09-23 14:45:03 UTC
Permalink
Is there any way to flush the undo stack from VBA? There is a command I have
where the user runs a VBA routine, and I'd like to make it so the user can
not undo the actions taken by the VBA program (since it does database stuff
as well as edit autocad object's properties). Is this possible?

-Anthony F
VBA
2004-09-24 20:28:28 UTC
Permalink
No.
Post by Anthony
Is there any way to flush the undo stack from VBA? There is a command I have
where the user runs a VBA routine, and I'd like to make it so the user can
not undo the actions taken by the VBA program (since it does database stuff
as well as edit autocad object's properties). Is this possible?
-Anthony F
Anthony
2004-09-26 22:37:59 UTC
Permalink
Anthony, try this

ThisDrawing.StartUndoMark

your code here


ThisDrawing.EndUndoMark

Regards

Anthony
No.
Post by Anthony
Is there any way to flush the undo stack from VBA? There is a command I
have
Post by Anthony
where the user runs a VBA routine, and I'd like to make it so the user can
not undo the actions taken by the VBA program (since it does database
stuff
Post by Anthony
as well as edit autocad object's properties). Is this possible?
-Anthony F
Kevin Terry
2004-09-27 14:28:02 UTC
Permalink
that will still allow the undo in autocad, which will basically just undo
the vba command part within autocad (database changes won't be reversed)

Kevin
Post by Anthony
Anthony, try this
ThisDrawing.StartUndoMark
your code here
ThisDrawing.EndUndoMark
Regards
Anthony
No.
Post by Anthony
Is there any way to flush the undo stack from VBA? There is a command I
have
Post by Anthony
where the user runs a VBA routine, and I'd like to make it so the user can
not undo the actions taken by the VBA program (since it does database
stuff
Post by Anthony
as well as edit autocad object's properties). Is this possible?
-Anthony F
Laurie Comerford
2004-09-27 19:36:13 UTC
Permalink
Hi Kevin

What happens if you save the file after your program has run ?
--
Laurie Comerford
CADApps
www.cadapps.com.au
Post by Kevin Terry
that will still allow the undo in autocad, which will basically just undo
the vba command part within autocad (database changes won't be reversed)
Kevin
Post by Anthony
Anthony, try this
ThisDrawing.StartUndoMark
your code here
ThisDrawing.EndUndoMark
Regards
Anthony
No.
Post by Anthony
Is there any way to flush the undo stack from VBA? There is a command I
have
Post by Anthony
where the user runs a VBA routine, and I'd like to make it so the
user
Post by Kevin Terry
Post by Anthony
Post by Anthony
can
not undo the actions taken by the VBA program (since it does database
stuff
Post by Anthony
as well as edit autocad object's properties). Is this possible?
-Anthony F
Kevin Terry
2004-09-28 11:57:29 UTC
Permalink
Hi Laurie,
you can still undo.

i actually like how that works with autocad, as opposed to excel which won't
let you undo macros. with some programs here, we'll use that procedure to
see results of macros in different ways - in other words, run a macro that
generates a parts list, then undo to other changes made to the drawing by
the macro are reversed.

regards,
Kevin
Post by Laurie Comerford
Hi Kevin
What happens if you save the file after your program has run ?
--
Laurie Comerford
CADApps
www.cadapps.com.au
Post by Kevin Terry
that will still allow the undo in autocad, which will basically just undo
the vba command part within autocad (database changes won't be reversed)
Kevin
Post by Anthony
Anthony, try this
ThisDrawing.StartUndoMark
your code here
ThisDrawing.EndUndoMark
Regards
Anthony
No.
Post by Anthony
Is there any way to flush the undo stack from VBA? There is a
command
Post by Laurie Comerford
I
Post by Kevin Terry
Post by Anthony
have
Post by Anthony
where the user runs a VBA routine, and I'd like to make it so the
user
Post by Kevin Terry
Post by Anthony
Post by Anthony
can
not undo the actions taken by the VBA program (since it does database
stuff
Post by Anthony
as well as edit autocad object's properties). Is this possible?
-Anthony F
Jeff Mishler
2004-09-27 15:27:17 UTC
Permalink
You could use SendCommand and use Undo/Control/None......or, instead of
sendcommand, use the lisp (command "undo" "control" "none") in your lisp
wrapper to call the routine. You should check the current status of undo
first (via UNDOCTL sysvar), though, and end any active group, save the
setting and make sure to restore it when done.
--
Jeff
check out www.cadvault.com
Post by Anthony
Is there any way to flush the undo stack from VBA? There is a command I have
where the user runs a VBA routine, and I'd like to make it so the user can
not undo the actions taken by the VBA program (since it does database stuff
as well as edit autocad object's properties). Is this possible?
-Anthony F
Loading...