CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

ActiveX 开发指南

相关分类

更新方法 (ActiveX)

2023-1-4 00:33| 发布者: admin| 查看: 353| 评论: 0|来自: AutoCAD

摘要: 将对象更新到绘图屏幕。

将对象更新到绘图屏幕。

支持的平台:仅窗口

签名

工 务 局:

object.Update
对象

类型:所有图形对象应用程序属性参考尺寸选择集

此方法适用的对象。

返回值(RetVal)

无返回值。

言论

没有额外的评论。

例子

工 务 局:

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

路过

雷人

握手

鲜花

鸡蛋

最新评论

QQ|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 )

GMT+8, 2024-5-12 00:53

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部