将对象更新到绘图屏幕。 支持的平台:仅窗口 返回值(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) ) |
|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 苏公网安备32011402011833)
GMT+8, 2025-1-8 19:45
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.