Sub GetGridSpacing_Example()
' This example turns on the grid for the current viewport.
' It then finds and displays a message with the current grid spacing.
Dim viewportObj As IntelliCAD.Viewport
Dim XGrid As Double
Dim YGrid As Double
Set viewportObj = ThisDocument.ActiveViewport
' Turn on the grid and reset the viewport to see it come on.
viewportObj.GridOn = True
ThisDocument.ActiveViewport = viewportObj
' Find the current grid spacing
viewportObj.GetGridSpacing XGrid, YGrid
MsgBox "X Grid spacing = " & XGrid & " Y Grid spacing = " & YGrid
End Sub