MaxCADWindow property example

Sub MaxAutoCADWindow_Example()
' This example returns the current setting of MaxAutoCADWindow.
' It then changes the value, and finally resets it it's original setting.
    Dim myPrefs As AcadPreferences
    Set myPrefs = ThisDrawing.Application.Preferences
    Dim bCurrMaximizedState As Boolean
    'Get the current MaxAutoCADWindow state
    bCurrMaximizedState = myPrefs.Display.MaxAutoCADWindow
    MsgBox "The current value for MaxAutoCADWindow is " & bCurrMaximizedState
    'Change the state of MaxAutoCADWindow
    myPrefs.Display.MaxAutoCADWindow = Not (bCurrMaximizedState)
    MsgBox "The new value for MaxAutoCADWindow is " & myPrefs.Display.MaxAutoCADWindow
    'Reset MaxAutoCADWindow to its original state
    myPrefs.Display.MaxAutoCADWindow = bCurrMaximizedState
    MsgBox "The MaxAutoCADWindow value is reset to " & myPrefs.Display.MaxAutoCADWindow
End Sub

© Bricsys NV. All rights reserved.