Update メソッド(ActiveX)

図面内のオブジェクトを更新します。

サポートされているプラットフォーム: Windows のみ

構文と要素

VBA:

object.Update
object

タイプ: すべての図形オブジェクトApplicationAttributeReferenceDimensionSelectionSet

このメソッドが適用されるオブジェクト。

戻り値(RetVal)

戻り値はありません。

注意

追加の注意はありません。

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)
)