ObjectSnapMode 属性 (ActiveX) 
指定对象捕捉模式的设置。 支持的平台:仅限 Windows 属性值只读:不 类型:布尔 
 言论没有其他评论。 例子VBA: Sub Example_ObjectSnapMode()
    ' This example toggles the setting of the Object Snap Mode.
    
    Dim currObjSnapMode As Boolean
    
    ' Get the current ObjectSnapMode value
    currObjSnapMode = ThisDrawing.ObjectSnapMode
    MsgBox "The object snap mode is currently " & IIf(ThisDrawing.ObjectSnapMode, "on.", "off."), , "ObjectSnapMode Example"
    
    ' Change the default ObjectSnapMode value
    ThisDrawing.ObjectSnapMode = Not (currObjSnapMode)
    MsgBox "The object snap mode is now " & IIf(ThisDrawing.ObjectSnapMode, "on.", "off."), , "ObjectSnapMode Example"
End Sub
可视化 LISP: (vl-load-com)
(defun c:Example_ObjectSnapMode()
    ;; This example toggles the setting of the Object Snap Mode.
    (setq acadObj (vlax-get-acad-object))
    (setq doc (vla-get-ActiveDocument acadObj))
    
    ;; Get the current ObjectSnapMode value
    (setq currObjSnapMode (vla-get-ObjectSnapMode doc))
    (alert (strcat "The object snap mode is currently " (if (= (vla-get-ObjectSnapMode doc) :vlax-true) "on." "off.")))
    
    ;; Change the default ObjectSnapMode value
    (vla-put-ObjectSnapMode doc (if (= (vla-get-ObjectSnapMode doc) :vlax-true) :vlax-false :vlax-true))
    (alert (strcat "The object snap mode is now " (if (= (vla-get-ObjectSnapMode doc) :vlax-true) "on." "off.")))
)
 | 
|Archiver|CAD开发者社区
( 苏ICP备2022047690号-1   苏公网安备32011402011833)
GMT+8, 2025-11-4 19:33
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.