Regen Method (ActiveX)

Regenerates the entire drawing and recomputes the screen coordinates and view resolution for all objects.

Supported platforms: Windows only

Signature

VBA:

object.Regen WhichViewports
object

Type: Document

The object this method applies to.

WhichViewports

Access: Input-only

Type: AcRegenType enum

  • acActiveViewport: Regenerates only the active viewport.
  • acAllViewports: Regenerates all viewports on the document.

Return Value (RetVal)

No return value.

Remarks

Regen also reindexes the drawing database for optimum display and better object selection performance.

Examples

VBA:

Sub Example_Regen()
    ' The following example regenerates the complete drawing
    ThisDrawing.Regen acAllViewports
    
    ' The following example regenerates the active viewport in the current drawing
    ThisDrawing.Regen acActiveViewport
    
End Sub

Visual LISP:

(vl-load-com)
(defun c:Example_Regen()
    (setq acadObj (vlax-get-acad-object))
    (setq doc (vla-get-ActiveDocument acadObj))
  
    ;; The following example regenerates the complete drawing
    (vla-Regen doc acAllViewports)
    
    ;; The following example regenerates the active viewport in the current drawing
    (vla-Regen doc acActiveViewport)
)