' View.DGDialog ' Simple front end for View.DrawGrid '**** get default BndBox values theExt = av.GetActiveDoc.ReturnExtent MinX = theExt.GetLeft.AsString MinY = theExt.GetBottom.AsString MaxX = theExt.GetRight.AsString MaxY = theExt.GetTop.AsString '**** get default Int if (theExt.GetWidth > theExt.GetHeight) then axis_s = theExt.GetHeight else axis_s = theExt.GetWidth end exp = 10 ^ (axis_s.Log(10).Floor) n = 10 ^ (axis_s.Log(10) - axis_s.Log(10).Floor) if (n <= 1.5) then i = 0.25 * exp elseif (n <= 3.0) then i = 0.50 * exp elseif (n <= 4.5) then i = 0.75 * exp elseif (n <= 6.0) then i = 1.00 * exp elseif (n <= 7.5) then i = 1.25 * exp else i = 1.50 * exp end Int = i.AsString '**** set up user input labels = {"MinX:","MinY:","MaxX:","MaxY:","Interval:","Lines?","Box?","Labels?"} defaults = {MinX,MinY,MaxX,MaxY,Int,"yes","yes","yes"} result = MsgBox.MultiInput("Enter Parameters:","Draw Grid",labels,defaults) if (result.Count = 0) then return nil end '**** pass values to drawgrid routine MinX = result.Get(0).AsNumber MinY = result.Get(1).AsNumber MaxX = result.Get(2).AsNumber MaxY = result.Get(3).AsNumber BndBox = Rect.MakeXY(MinX,MinY,MaxX,MaxY) Int = result.Get(4).AsNumber DrawLine = (result.Get(5) = "yes") DrawBox = (result.Get(6) = "yes") DrawText = (result.Get(7) = "yes") result = av.Run("View.DrawGrid",{BndBox,Int,DrawLine,DrawBox,DrawText})