Sub GetGridSpacing_Example() ' This example finds the current Snap spacing. ' First, find the current active viewport Dim viewportObj As AcadViewport Dim XGrid As Double Dim YGrid As Double Set viewportObj = ThisDrawing.ActiveViewport ' Turn on Snap and reset the viewport. viewportObj.GridOn = True ThisDrawing.ActiveViewport = viewportObj ' Find the current Snap spacing viewportObj.GetGridSpacing XGrid, YGrid MsgBox "X Grid Spacing = " & XGrid & " Y Grid Spacing = " & YGrid End Sub
© Bricsys NV. All rights reserved. |