Set AutoCAD Preferences
From AutoCAD ActiveX
There are nine objects pertaining to options, each representing a tab in the Options dialog box. These objects provide access to all of the registry-stored options in the Options dialog box. You can customize many of the AutoCAD settings by using properties found on these objects. These objects are
- PreferencesDisplay
- PreferencesDrafting
- PreferencesFiles
- PreferencesOpenSave
- PreferencesOutput
- PreferencesProfiles
- PreferencesSelection
- PreferencesSystem
- PreferencesUser
These objects are accessible with the Preferences object. To gain access to the Preferences object, use the Preferences property of the Application object:
Dim acadPref as AcadPreferences
Set acadPref = ThisDrawing.Application.Preferences
You can then access any of the specific Preferences objects using the Display, Drafting, Files, OpenSave, Output, Profile, Selection, System, and User properties.
Set the crosshairs to full screen
Sub Ch2_PrefsSetCursor()
' This example sets the crosshairs of the AutoCAD drawing cursor
' to full screen.
' Access the Preferences objectDim acadPref As AcadPreferencesSet acadPref = ThisDrawing.Application.Preferences' Use the CursorSize property to set the size of the crosshairsacadPref.Display.CursorSize = 100End Sub
Display the screen menu and scroll bars
Sub Ch2_PrefsSetDisplay()
' This example enables the screen menu and disables the scroll
' bars with the DisplayScreenMenu and DisplayScrollBars
' properties.
' Access the Preferences objectDim acadPref As AcadPreferencesSet acadPref = ThisDrawing.Application.Preferences' Display the screen menu and disable scroll barsacadPref.Display.DisplayScreenMenu = TrueacadPref.Display.DisplayScrollBars = FalseEnd Sub