指定快照的状态。 支持的平台:仅窗口 属性值只读:不 类型:布尔
言论SnapOn使用当前捕捉栅格分辨率、旋转和样式激活捕捉模式。若要更改捕捉网格分辨率,请使用该方法。若要更改捕捉旋转,请使用属性。SetSnapSpacingSnapRotationAngle 捕捉网格不可见。使用该属性显示单独的可见网格。GridOn AutoCAD 忽略透视视图中的捕捉模式。 注意:此属性的值存储在 SNAPMODE 系统变量中。要更改捕捉样式,请使用捕捉样式系统变量。
例子工 务 局: Sub Example_SnapOn() ' This example toggles the setting of SnapOn. Dim viewportObj As AcadViewport ' Set the viewportObj variable to the activeviewport Set viewportObj = ThisDrawing.ActiveViewport ' Display the current setting of SnapOn MsgBox "Snap mode is: " & IIf(viewportObj.SnapOn, "On", "Off"), , "SnapOn Example" ' Toggle the setting of SnapOn viewportObj.SnapOn = Not (viewportObj.SnapOn) ' Reset the active viewport to see the change on the AutoCAD status bar ThisDrawing.ActiveViewport = viewportObj MsgBox "Snap mode is now: " & IIf(viewportObj.SnapOn, "On", "Off"), , "SnapOn Example" End Sub Visual LISP: (vl-load-com) (defun c:Example_SnapOn() ;; This example toggles the setting of SnapOn. (setq acadObj (vlax-get-acad-object)) (setq doc (vla-get-ActiveDocument acadObj)) ;; Set the viewportObj variable to the activeviewport (setq viewportObj (vla-get-ActiveViewport doc)) ;; Display the current setting of SnapOn (alert (strcat "Snap mode is: " (if (= (vla-get-SnapOn viewportObj) :vlax-true) "On" "Off"))) ;; Toggle the setting of SnapOn (vla-put-SnapOn viewportObj (if (= (vla-get-SnapOn viewportObj) :vlax-true) :vlax-false :vlax-true)) ;; Reset the active viewport to see the change on the AutoCAD status bar (vla-put-ActiveViewport doc viewportObj) (alert (strcat "Snap mode is now: " (if (= (vla-get-SnapOn viewportObj) :vlax-true) "On" "Off"))) ) |
|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 苏公网安备32011402011833)
GMT+8, 2025-1-8 19:22
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.