CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

AutoCAD 2025 开发者帮助

关于设置 AutoCAD 首选项 (ActiveX)

2024-5-18 19:18| 发布者: admin| 查看: 20| 评论: 0|原作者: admin|来自: AutoCAD

关于设置 AutoCAD 首选项 (ActiveX)

有 9 个与选项相关的对象,每个对象表示“选项”对话框中的一个选项卡。

这些对象提供对“选项”对话框中所有注册表存储选项的访问。您可以使用在这些对象上找到的特性来自定义许多 AutoCAD 设置。这些对象是

  • PreferencesDisplay
  • PreferencesDrafting
  • PreferencesFiles
  • PreferencesOpenSave
  • PreferencesOutput
  • PreferencesProfiles
  • PreferencesSelection
  • PreferencesSystem
  • PreferencesUser
注意:虽然该对象作为 AutoCAD LT 的 ActiveX 实现的一部分存在,但由于 AutoCAD LT 不支持配置文件,因此已删除其所有方法和特性。PreferencesProfiles

这些对象可通过对象访问。若要访问该对象,请使用该对象的属性:PreferencesPreferencesPreferencesApplication

AutoLISP
(setq acadObj (vlax-get-acad-object)
      acadPref (vla-get-Preferences acadObj))
VBA(仅限 AutoCAD)
Dim acadPref as AcadPreferences
Set acadPref = ThisDrawing.Application.Preferences

然后,您可以使用 、 、 、 、 和 属性访问任何特定对象。PreferencesDisplayDraftingFilesOpenSaveOutputProfileSelectionSystemUser

将十字准线设置为全屏

AutoLISP
(vl-load-com)
(defun c:Ch2_PrefsSetCursor ()
    ;; This example sets the crosshairs of the AutoCAD drawing cursor
    ;; to full screen.

    ;; Access the Preferences object
    (setq acadObj (vlax-get-acad-object)
          acadPref (vla-get-Preferences acadObj))

    ;; Use the CursorSize property to set the size of the crosshairs
    (vla-put-CursorSize (vla-get-Display acadPref) 100)
)
VBA(仅限 AutoCAD)
Sub Ch2_PrefsSetCursor()
  ' This example sets the crosshairs of the AutoCAD drawing cursor
  ' to full screen.

  ' Access the Preferences object
  Dim acadPref As AcadPreferences
  Set acadPref = ThisDrawing.Application.Preferences

  ' Use the CursorSize property to set the size of the crosshairs
  acadPref.Display.CursorSize = 100
End Sub

显示滚动条

AutoLISP
(vl-load-com)
(defun c:Ch2_PrefsSetDisplay ()
    ;; This example disables the scroll
    ;; bars with the DisplayScrollBars
    ;; property.

    ;; Access the Preferences object
    (setq acadObj (vlax-get-acad-object)
          acadPref (vla-get-Preferences acadObj))

    ;; Display the and disable scroll bars
    (vla-put-DisplayScrollBars (vla-get-Display acadPref) :vlax-false)
)
VBA(仅限 AutoCAD)
Sub Ch2_PrefsSetDisplay()
  ' This example disables the scroll
  ' bars with the DisplayScrollBars
  ' property.

  ' Access the Preferences object
  Dim acadPref As AcadPreferences
  Set acadPref = ThisDrawing.Application.Preferences

  ' Display the and disable scroll bars
  acadPref.Display.DisplayScrollBars = False
End Sub

路过

雷人

握手

鲜花

鸡蛋

最新评论

QQ|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 )

GMT+8, 2024-6-27 15:57

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部