std-enable-undo, std-disable-undo


Synopsis

(std-enable-undo) ; enables UNDO

(std-disable-undo) ; disables UNDO buffering at all

Description

These two complementing functions embrace AutoLISP code which performs a lot of unsafe but fast operations. It is generelly not a good idea to use (STD-DISABLE-UNDO), only for benchmarking or for creating a lot of entities for testing it might be useful. Without UNDO all drawing and changing operations generally perform much faster, because the undo information will not be updated.

STD-ENABLE-UNDO is almost the same as (AI_UNDO_ON) in AI_UTILS.LSP but it turns Menu Autogrouping off.

STD-DISABALE-UNDO turns UNDO buffering completely off, which is very dangerous and very very unsafe!

All operations done after (std-disable-undo) cannot NOT be undone!

Use the error handler with the key :UNDO to save the UNDO setting inside your function in case of errros or breaks!

Note

STD-SAVE-UNDO and STD-RESTORE-UNDO are also defined.

AI_UNDO_PUSH and AI_UNDO_POP group commands and let lisp functions behave like one AutoCAD command.

Example

;;; very dangerous code!
(std-var-init '((:UNDO)))
...
(progn
  (std-disable-undo)	; do very unsafe stuff here
  (repeat 10000

... ; this can not be undone!

  )
  (std-enable-undo)
)
...
(std-var-restore)

Arguments

undoctl: an integer number defining the state of the sytemvariable UNDOCTL.

Return Value

STD-SAVE-UNDO returns a number.

The return value of STD-RESTORE-UNDO is nil.

Side Effects

STD-RESTORE-UNDO changes the current VIEWPORT settings.

Module

(std-require 'STDTBL)

Defined in STDTBL