autoCAD 设置 AutoCAD 系统配置 您所在的位置:网站首页 cad的系统配置命令 autoCAD 设置 AutoCAD 系统配置

autoCAD 设置 AutoCAD 系统配置

2024-01-07 23:28| 来源: 网络整理| 查看: 265

.NET API 没有包含所有访问选项的类或方法,这些选项是通过 AutoCAD 选项对话框存储的。访问这些选项是通过 ActiveX® Automation 库来完成的。用户使用COM 对象从 Application 对象的 Preferences 属性返回系统配置。

只要用户获得 Preferences COM 对象,就可以访问属于选项的九个对象,每个对象分别代表“选项”对话框中的一个选项卡。通过这些对象可以访问“选项”对话框中所有存储在注册表中的选项,可以使用这些对象的属性来自定义许多 AutoCAD 设置。这些对象包括

PreferencesDisplayPreferencesDraftingPreferencesFilesPreferencesOpenSavePreferencesOutputPreferencesProfilesPreferencesSelectionPreferencesSystemPreferencesUser

访问 Preferences 对象

下面的示例说明如果通过 COM Interop 访问 Preferences 对象。

Dim acPrefComObj As AcadPreferences = Application.Preferences

将十字光标设置为全屏

''添加引用 ''COM选项卡 ''AutoCAD 2012 Type Library ''AutoCAD/ObjectDBX Common18.0 Type Library Imports Autodesk.AutoCAD.ApplicationServices Imports Autodesk.AutoCAD.Runtime Imports Autodesk.AutoCAD.Interop _ Public Sub PrefsSetCursor() '' 本例将 AutoCAD 图形十字光标设置为全屏 '' 访问 Preferences 对象 Dim acPrefComObj As AcadPreferences = Application.Preferences '' 使用 CursorSize 属性设置十字光标的尺寸 acPrefComObj.Display.CursorSize = 100 End Sub

显示屏幕菜单和滚动条

Imports Autodesk.AutoCAD.ApplicationServices Imports Autodesk.AutoCAD.Runtime Imports Autodesk.AutoCAD.Interop _ Public Sub PrefsSetDisplay() '' 本例启动屏幕菜单并禁用滚动条 This example enables the screen menu and disables the scrolls '' 访问 Preferences 对象 Access the Preferences object Dim acPrefComObj As AcadPreferences = Application.Preferences '' 显示屏幕菜单 Display the screen menu acPrefComObj.Display.DisplayScreenMenu = True '' 禁用滚动条 Disable the scroll bars acPrefComObj.Display.DisplayScrollBars = False End Sub

数据库系统配置

除应用程序级别的 Preferences 对象外,还有基于图形的 Preferences,它可以使用选项对话框访问且存储在图形文件中。若要访问这些存储的设置,请使用数据库对象合适的属性或使用 Application 对话的 GetSystemVariable 和 SetSystemVariable 方法。

设置和获取系统变量

Application 对象提供了 SetSystemVariable 和 GetSystemVariable 方法设置和获得 AutoCAD 系统变量。例如,若要指定一个整数级 MAXSORT 系统变量,请使用如下代码:

'' 从一个系统变量获得一个当前值 Dim nMaxSort as Integer = Application.GetSystemVariable("MAXSORT") '' 为系统变量设置一个新值 Application.SetSystemVariable("MAXSORT", 100)



【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有