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
Note: While the
PreferencesProfiles object exists as part of the ActiveX implementation for AutoCAD LT, all of its methods and properties have been removed since Profiles are not supported in AutoCAD LT.
These objects are accessible with the Preferences object. To gain access to the Preferences object, use the Preferences property of the Application object:
- AutoLISP
-
(setq acadObj (vlax-get-acad-object) acadPref (vla-get-Preferences acadObj))
- VBA (AutoCAD Only)
-
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
- 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 Only)
-
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
Display the scroll bars
- 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 Only)
-
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