MaxAutoCADWindow Example

Using Programming Languages other than VBA

Sub Example_MaxAutoCADWindow()
	' This example returns the current setting of
	' MaxAutoCADWindow. It then changes the value, and finally
	' it resets the value back to the original setting.

	Dim preferences As AcadPreferences
	Dim currMaxAutoCADWindow As Boolean

	Set preferences = ThisDrawing.Application.preferences

	' Retrieve the current MaxAutoCADWindow value
	currMaxAutoCADWindow = preferences.DISPLAY.MaxAutoCADWindow
	MsgBox "The current value for MaxAutoCADWindow is " & preferences.DISPLAY.MaxAutoCADWindow, vbInformation, "MaxAutoCADWindow Example"

	' Change the value for MaxAutoCADWindow
	preferences.DISPLAY.MaxAutoCADWindow = Not (currMaxAutoCADWindow)
	MsgBox "The new value for MaxAutoCADWindow is " & preferences.DISPLAY.MaxAutoCADWindow, vbInformation, "MaxAutoCADWindow Example"

	' Reset MaxAutoCADWindow to its original value
	preferences.DISPLAY.MaxAutoCADWindow = currMaxAutoCADWindow
	MsgBox "The MaxAutoCADWindow value is reset to " & preferences.DISPLAY.MaxAutoCADWindow, vbInformation, "MaxAutoCADWindow Example"
End Sub

 

   Comments?