KeyboardPriority 属性 (ActiveX)
控制 AutoCAD 对坐标数据输入的响应方式。 支持的平台:仅限 Windows 属性值只读:不 类型:枚举acKeyboardPriority
言论此属性的初始值为 。acKeyboardEntryExceptScripts 注意:此属性的值存储在 OSNAPCOORD 系统变量中。
例子VBA: Sub Example_KeyboardPriority() ' This example returns the current setting of ' KeyboardPriority. It then changes the value, and finally ' it resets the value back to the original setting. Dim preferences As AcadPreferences Dim currKeyboardPriority As Integer Dim constant As String Dim newConstant As String Set preferences = ThisDrawing.Application.preferences ' Retrieve the current KeyboardPriority value currKeyboardPriority = preferences.User.KeyboardPriority constant = Choose(currKeyboardPriority + 1, "acKeyboardRunningObjSnap", "acKeyboardEntry", "acKeyboardEntryExceptScripts") MsgBox "The current value for KeyboardPriority is " & constant, vbInformation, "KeyboardPriority Example" ' Change the value for KeyboardPriority newConstant = "acKeyboardEntry" preferences.User.KeyboardPriority = acKeyboardEntry MsgBox "The new value for KeyboardPriority is " & newConstant, vbInformation, "KeyboardPriority Example" ' Reset KeyboardPriority to its original value preferences.User.KeyboardPriority = currKeyboardPriority MsgBox "The KeyboardPriority value is reset to " & constant, vbInformation, "KeyboardPriority Example" End Sub 可视化 LISP: (vl-load-com) (defun c:Example_KeyboardPriority() ;; This example returns the current setting of ;; KeyboardPriority. It then changes the value, and finally ;; it resets the value back to the original setting. (setq acadObj (vlax-get-acad-object)) (setq preferences (vla-get-Preferences acadObj)) ;; Retrieve the current KeyboardPriority value (setq currKeyboardPriority (vla-get-KeyboardPriority (vla-get-User preferences))) (setq constant (cond ((= currKeyboardPriority 0) "acKeyboardRunningObjSnap") ((= currKeyboardPriority 1) "acKeyboardEntry") ((= currKeyboardPriority 2) "acKeyboardEntryExceptScripts"))) (alert (strcat "The current value for KeyboardPriority is " constant)) ;; Change the value for KeyboardPriority (setq newConstant "acKeyboardEntry") (vla-put-KeyboardPriority (vla-get-User preferences) acKeyboardEntry) (alert (strcat "The new value for KeyboardPriority is " newConstant)) ;; Reset KeyboardPriority to its original value (vla-put-KeyboardPriority (vla-get-User preferences) currKeyboardPriority) (alert (strcat "The KeyboardPriority value is reset to " constant)) ) |
|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 苏公网安备32011402011833)
GMT+8, 2024-12-15 11:47
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.