Author Topic: Disable UNDO command  (Read 2921 times)

0 Members and 1 Guest are viewing this topic.

Lupo76

  • Bull Frog
  • Posts: 343
Disable UNDO command
« on: June 16, 2018, 04:25:25 AM »
I made a small lisp that runs about 300-400 Boolean operations on a very very complex solid.
During AutoCAD processing it creates a "UNDB595A.ac$" file inside the Windows TEMP folder with huge dimensions (30-40 GB !!).

To remedy this, I thought to temporarily disable the UNDO command and then rehabilitate it at the end of the process.
Unfortunately UNDOCTL is a read-only variable :-(

Do you have any advice for doing this?
Thanks in advance


Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: Disable UNDO command
« Reply #1 on: June 16, 2018, 06:23:50 AM »
Have you tried UNDO > CONTROL > NONE ?

David Bethel

  • Swamp Rat
  • Posts: 656
Re: Disable UNDO command
« Reply #2 on: June 16, 2018, 06:25:09 AM »
Look into "_.UNDO"  "_Control"  options.

-David

Lee's too quick !
R12 Dos - A2K

Lupo76

  • Bull Frog
  • Posts: 343
Re: Disable UNDO command
« Reply #3 on: June 17, 2018, 01:46:43 AM »
I have verified UNDO> CONTROL> NONE options; this sets UNDOCTL = 48

Code: [Select]
(defun c:Test ()
  (alert (strcat "Befor = " (rtos (getvar "UNDOCTL") 2 0)))
  (command "_.undo" "_c" "_n")
  (alert (strcat "In the middle of the lisp = " (rtos (getvar "UNDOCTL") 2 0)))
  (command "_.undo" "_a") 
  (alert (strcat "End = " (rtos (getvar "UNDOCTL") 2 0)))
)


My doubt is this: at the end of the processing of the lisp how do I put the previous value of UNDOCTL back?
In the lisp above I used an approach that seems correct, but is it also safe over time with the various versions of AutoCAD and BricsCAD?  :?

Dlanor

  • Bull Frog
  • Posts: 263
Re: Disable UNDO command
« Reply #4 on: June 17, 2018, 04:23:21 AM »
Quote
My doubt is this: at the end of the processing of the lisp how do I put the previous value of UNDOCTL back?

Your already doing that with

Code - Auto/Visual Lisp: [Select]
  1. (command "_.undo" "_a")

which should reset it to 53

Quote
In the lisp above I used an approach that seems correct, but is it also safe over time with the various versions of AutoCAD and BricsCAD?  :?

It works now, which is all that matter. As to the future, if i knew that i'd be winning the LOTTO every week. :whistling:
« Last Edit: June 17, 2018, 04:38:29 AM by Dlanor »

Lupo76

  • Bull Frog
  • Posts: 343
Re: Disable UNDO command
« Reply #5 on: June 17, 2018, 06:08:58 AM »
It works now, which is all that matter. As to the future, if i knew that i'd be winning the LOTTO every week. :whistling:

Ok the joke is all there :-)

Marc'Antonio Alessi

  • Swamp Rat
  • Posts: 1453
  • Marco
Re: Disable UNDO command
« Reply #6 on: June 17, 2018, 03:30:30 PM »
Test if enabled before:
(if (= 1 (logand 1 (getvar "UNDOCTL"))) (command "_.UNDO" "_C" "_N"))