Update Method (ActiveX)

Updates the object to the drawing screen.

Supported platforms: Windows only

Signature

VBA:

object.Update
object

Type: All drawing objects, Application, AttributeReference, Dimension, SelectionSet

The objects this method applies to.

Return Value (RetVal)

No return value.

Remarks

No additional remarks.

Examples

VBA:

Sub Example_Update()
    ' This example creates a line in model space. It displays a
    ' Msgbox immediately before the call to update the line and
    ' again after the call.
    Dim lineObj As AcadLine
    Dim startPoint(0 To 2) As Double
    Dim endPoint(0 To 2) As Double

    ' Create a Line object in model space
    startPoint(0) = 2#: startPoint(1) = 2#: startPoint(2) = 0#
    endPoint(0) = 4#: endPoint(1) = 4#: endPoint(2) = 0#
    Set lineObj = ThisDrawing.ModelSpace.AddLine(startPoint, endPoint)
    
    MsgBox "Before the update.", , "Update Example"
    ' The following code draws an object in AutoCAD window
    lineObj.Update
    MsgBox "After the update.", , "Update Example"
    
    ' The following call updates the entire drawing
    ThisDrawing.Application.Update
    
End Sub

Visual LISP:

(vl-load-com)
(defun c:Example_Update()
    ;; This example creates a line in model space. It displays a
    ;; Msgbox immediately before the call to update the line and
    ;; again after the call.
    (setq acadObj (vlax-get-acad-object))
    (setq doc (vla-get-ActiveDocument acadObj))

    ;; Create a Line object in model space
    (setq startPoint (vlax-3d-point 2 2 0)
          endPoint (vlax-3d-point 4 4 0))

    (setq modelSpace (vla-get-ModelSpace doc))
    (setq lineObj (vla-AddLine modelSpace startPoint endPoint))
    (vla-ZoomAll acadObj)

    (alert "Before the update.")

    ;; The following code draws an object in AutoCAD window
    (vla-Update lineObj)
    (alert "After the update.")
    
    ;; The following call updates the entire drawing
    (vla-Update acadObj)
)