スナップの状態を指定します。
サポートされているプラットフォーム: Windows のみ
読み込み専用: いいえ
タイプ: ブール型
SnapOn は、現在のスナップのグリッド解像度、回転角度、スタイルを使用して、スナップ モードをアクティブにします。スナップのグリッド解像度を変更するには、SetSnapSpacing メソッドを使用します。スナップの回転角度を変更するには、SnapRotationAngle プロパティを使用します。
スナップ グリッドは表示されません。GridOn プロパティを使用して個別の可視グリッドを表示します。
AutoCAD では、パース ビューでのスナップ モードは無視されます。
VBA:
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")))
)