/3.1 (Extension.1 Name: "Graticules and Measured Grids" Dependencies: "$AVBIN/avdlog.dll\n" FirstRootClassName: "Butn" Roots: 2 Roots: 4 Roots: 5 Roots: 128 Roots: 129 Roots: 130 Roots: 131 Roots: 132 Roots: 133 Roots: 134 Roots: 135 Roots: 136 Roots: 137 Roots: 138 Roots: 139 Roots: 140 Version: 31 About: "Contains a Tool for making graticules and measured grids on viewframes in a layout. (v3.1)" CanUnloadScript: 141 UnloadScript: 142 InstallScript: 143 UninstallScript: 144 ExtVersion: 1 ) (Butn.2 Help: "Graticules and Grids//Use this to place a graticule around the selected viewframe" Update: "GratGrids.LayoutGraticule Update" Icon: 3 Click: "GratGrids.LayoutGraticule Show" ) (AVIcon.3 Name: "Graticule/Grid" Res: "Icons.Graticule/Grid" ) (Choice.4 Help: "Use this to place a graticule around the selected viewframe" HelpTopic: "Layout_Graticule_and_Grid" Update: "GratGrids.LayoutGraticule Update" Label: "Add Graticule or Grid" Click: "GratGrids.LayoutGraticule Show" Shortcut: "Keys.None" ) (AVDLog.5 Name: "Grat Grids Layout Grids and Graticules" X: 39 Y: 131 W: 564 H: 312 HelpTopic: "Layout_Graticule_and_Grid" ConstrainedControlNames: 6 ConstrainedControlNames: 7 ConstrainedControlNames: 8 ConstrainedControlNames: 9 ConstrainedControlNames: 10 Constraints: 11 Constraints: 12 Constraints: 13 Constraints: 14 Constraints: 15 Server: 16 ControlPanel: 17 Title: "Graticule and Grid Wizard" EscapeEnabled: 1 AlwaysOnTop: 1 HasTitleBar: 1 Closeable: 1 Close: "GratGrids.LayoutGraticule Close" Open: "GratGrids.LayoutGraticule Open" DefaultButton: 127 ) (AVStr.6 S: "Finish" ) (AVStr.7 S: "Next" ) (AVStr.8 S: "Back" ) (AVStr.9 S: "Cancel" ) (AVStr.10 S: "aLabelButton1" ) (Numb.11 N: 85.00000000000000 ) (Numb.12 N: 85.00000000000000 ) (Numb.13 N: 85.00000000000000 ) (Numb.14 N: 85.00000000000000 ) (Numb.15 N: 85.00000000000000 ) (Nil.16 InternalName: "MapTool" ) (CPanel.17 Child: 18 Child: 22 Child: 34 Child: 59 Child: 90 Child: 91 Child: 92 Child: 93 Child: 94 Child: 116 ResBox: 117 ResBox: 118 ResBox: 119 ResBox: 120 ResBox: 121 ResBox: 122 ResBox: 123 ResBox: 124 ResBox: 125 ResBox: 126 Listening: 1 ) (CPanel.18 InternalName: "BackPanel" Child: 19 Constraints: 0x55 ResBox: 21 VisibleBorder: 1 Listening: 1 ) (AVIBox.19 InternalName: "WizImage" Constraints: 0x55 Icon: 20 Listening: 1 ) (AVIcon.20 Name: "Check" Res: "Icons.Check" ) (RectD.21 Left: 8.00000000000000 Top: 264.00000000000000 Right: 174.00000000000000 Bottom: 8.00000000000000 ) (CPanel.22 InternalName: "OptionPanel" Child: 23 Child: 25 Child: 26 Child: 27 Child: 28 Constraints: 0x55 ResBox: 29 ResBox: 30 ResBox: 31 ResBox: 32 ResBox: 33 VisibleBorder: 1 Listening: 1 ) (AVCBBox.23 InternalName: "viewFrames" Help: "Choose a which viewframe you want to place a graticule or grid on" NextControl: 24 ContentKind: 4 Constraints: 0x55 Listening: 1 Select: "GratGrids.LayoutGraticule Change View" ) (Nil.24 InternalName: "MapTool" ) (AVCBox.25 InternalName: "SelectGrid" Help: "When you check this, the wizard will show options for measured grids" Listening: 1 Label: "Create a measured grid" Click: "GratGrids.LayoutGraticule Select Option" Constraints: 0x55 ) (TextLabel.26 InternalName: "aTextLabel39" Constraints: 0x55 Label: "Choose the view frame that you want \nto place a grid or graticule on:" Listening: 1 ) (AVCBox.27 InternalName: "SelectGrat" Help: "When you check this, the wizard will show options for graticules" Listening: 1 Selected: 1 Label: "Create a graticule" Click: "GratGrids.LayoutGraticule Select Option" Constraints: 0x55 ) (TextLabel.28 InternalName: "aTextLabel12" Constraints: 0x55 Label: "This wizard will help you place a graticule or a \nmeasured grid on a viewframe in your layout.\nAs you progress through the wizard, you can\nverify how the settings you've customized so\nfar look by clicking the Preview button." Listening: 1 ) (RectD.29 Left: 8.00000000000000 Top: 292.00000000000000 Right: 252.00000000000000 Bottom: 177.00000000000000 ) (RectD.30 Left: 29.00000000000000 Top: 241.00000000000000 Right: 244.00000000000000 Bottom: 222.00000000000000 ) (RectD.31 Left: 8.00000000000000 Top: 165.00000000000000 Right: 261.00000000000000 Bottom: 132.00000000000000 ) (RectD.32 Left: 29.00000000000000 Top: 225.00000000000000 Right: 230.00000000000000 Bottom: 202.00000000000000 ) (RectD.33 Left: 8.00000000000000 Top: 133.00000000000000 Right: 346.00000000000000 Bottom: 9.00000000000000 ) (CPanel.34 InternalName: "graphicoptions" Child: 35 Child: 36 Child: 37 Child: 38 Child: 47 Constraints: 0x55 ResBox: 54 ResBox: 55 ResBox: 56 ResBox: 57 ResBox: 58 VisibleBorder: 1 Listening: 1 ) (TextLabel.35 InternalName: "aTextLabel78" Constraints: 0x55 Label: "Choose options for your border:" Listening: 1 ) (AVCBox.36 InternalName: "BorderAroundMap" Help: "Places a border around the viewframe" Listening: 1 Selected: 1 Label: "Border around the viewframe" Click: "GratGrids.LayoutGraticule Border Display Option" Constraints: 0x55 ) (AVCBox.37 InternalName: "BorderAroundLabels" Help: "Places a border around the graticule/grid and its labels" Listening: 1 Label: "Border around the graticule/grid" Click: "GratGrids.LayoutGraticule Border Display Option" Constraints: 0x55 ) (CPanel.38 InternalName: "MapBorderOptions" Child: 39 Child: 40 Child: 41 Child: 42 Constraints: 0x55 ResBox: 43 ResBox: 44 ResBox: 45 ResBox: 46 Label: "Viewframe border options" VisibleBorder: 1 Listening: 1 ) (AVCBBox.39 InternalName: "MapBorderColor" Help: "Choose a line color for the viewframe border" NextControl: 24 ContentKind: 4 Constraints: 0x55 Listening: 1 Label: "Line color:" ) (AVCBBox.40 InternalName: "MapBorderStyle" Help: "Choose a line style for the viewframe border" NextControl: 24 ContentKind: 4 Constraints: 0x55 Listening: 1 ) (TextLabel.41 InternalName: "mbsText" Constraints: 0x55 Label: "Line style:" Listening: 1 ) (AVCBox.42 InternalName: "AlignLabels" Listening: 1 Label: "Align labels to border" Constraints: 0x55 ) (RectD.43 Left: 36.00000000000000 Top: 172.00000000000000 Right: 267.00000000000000 Bottom: 52.00000000000000 ) (RectD.44 Left: 108.00000000000000 Top: 196.00000000000000 Right: 266.00000000000000 Bottom: 76.00000000000000 ) (RectD.45 Left: 36.00000000000000 Top: 102.00000000000000 Right: 111.00000000000000 Bottom: 76.00000000000000 ) (RectD.46 Left: 33.00000000000000 Top: 39.00000000000000 Right: 264.00000000000000 Bottom: 21.00000000000000 ) (CPanel.47 InternalName: "LabelBorderOptions" Child: 48 Child: 49 Child: 50 Constraints: 0x55 ResBox: 51 ResBox: 52 ResBox: 53 Label: "Graticule/grid border options" VisibleBorder: 1 Listening: 1 ) (AVCBBox.48 InternalName: "LabelBorderStyle" Help: "Choose a line style for the graticule/grid border" NextControl: 24 ContentKind: 4 Constraints: 0x55 Listening: 1 ) (AVCBBox.49 InternalName: "LabelBorderColor" Help: "Choose a color for the label border" NextControl: 24 ContentKind: 4 Constraints: 0x55 Listening: 1 Label: "Line color:" ) (TextLabel.50 InternalName: "aTextLabel8" Constraints: 0x55 Label: "Line style:" Listening: 1 ) (RectD.51 Left: 109.00000000000000 Top: 169.00000000000000 Right: 266.00000000000000 Bottom: 49.00000000000000 ) (RectD.52 Left: 36.00000000000000 Top: 145.00000000000000 Right: 266.00000000000000 Bottom: 25.00000000000000 ) (RectD.53 Left: 36.00000000000000 Top: 69.00000000000000 Right: 109.00000000000000 Bottom: 49.00000000000000 ) (RectD.54 Left: 8.00000000000000 Top: 33.00000000000000 Right: 260.00000000000000 Bottom: 14.00000000000000 ) (RectD.55 Left: 41.00000000000000 Top: 46.00000000000000 Right: 279.00000000000000 Bottom: 30.00000000000000 ) (RectD.56 Left: 41.00000000000000 Top: 65.00000000000000 Right: 280.00000000000000 Bottom: 46.00000000000000 ) (RectD.57 Left: 8.00000000000000 Top: 169.00000000000000 Right: 296.00000000000000 Bottom: 67.00000000000000 ) (RectD.58 Left: 8.00000000000000 Top: 251.00000000000000 Right: 296.00000000000000 Bottom: 175.00000000000000 ) (CPanel.59 InternalName: "GratOptions" Child: 60 Child: 61 Child: 62 Child: 63 Child: 64 Child: 65 Child: 66 Child: 67 Child: 68 Child: 69 Child: 70 Child: 71 Child: 72 Child: 73 Child: 74 Constraints: 0x55 ResBox: 75 ResBox: 76 ResBox: 77 ResBox: 78 ResBox: 79 ResBox: 80 ResBox: 81 ResBox: 82 ResBox: 83 ResBox: 84 ResBox: 85 ResBox: 86 ResBox: 87 ResBox: 88 ResBox: 89 VisibleBorder: 1 Listening: 1 ) (RButn.60 InternalName: "LabOnly" Help: "Choose this to just show graticule labels and tic marks at the edge of the viewframe" Constraints: 0x55 Listening: 1 Label: "Labels only" Click: "GratGrids.LayoutGraticule Grat Display Option" ) (RButn.61 InternalName: "GratandLab" Help: "Choose this to show graticule lines and labels" Constraints: 0x55 Listening: 1 Label: "Graticule and Labels" Click: "GratGrids.LayoutGraticule Grat Display Option" ) (AVCBBox.62 InternalName: "GratLabFont" Help: "Choose the font for the graticule labels" NextControl: 24 ContentKind: 4 Constraints: 0x55 Listening: 1 Label: "Label font:" Select: "GratGrids.LayoutGraticule Font Changed" ) (AVCBBox.63 InternalName: "GratLabelSize" Help: "Choose the size for the graticule labels" NextControl: 24 ContentKind: 4 Constraints: 0x55 Listening: 1 Label: "Label size (pts):" ) (AVCBBox.64 InternalName: "GratLabelStyle" Help: "Choose the style for the graticule labels" NextControl: 24 ContentKind: 4 Constraints: 0x55 Listening: 1 Label: "Label text style:" ) (AVCBBox.65 InternalName: "GratLineWt" Help: "Choose the line width for the graticule lines" NextControl: 24 ContentKind: 4 Constraints: 0x55 Listening: 1 Label: "Graticule line width (pts):" ) (AVCBBox.66 InternalName: "GratColor" Help: "Choose the color for the graticule lines, tics, and labels" NextControl: 24 ContentKind: 4 Constraints: 0x55 Listening: 1 Label: "Graticule color:" ) (TextLabel.67 InternalName: "aTextLabel60" Constraints: 0x55 Label: "Choose options for your graticule:" Listening: 1 ) (TextLabel.68 InternalName: "aTextLabel61" Constraints: 0x55 Label: "Choose latitude and longitude intervals:" Listening: 1 ) (AVCBBox.69 InternalName: "Degrees" Help: "Choose the number of degrees minutes and seconds that will separate each graticule line/tic" NextControl: 24 ContentKind: 4 Constraints: 0x55 Listening: 1 Label: "Degrees:" ) (AVCBBox.70 InternalName: "Minutes" Help: "Choose the number of degrees minutes and seconds that will separate each graticule line/tic" NextControl: 24 ContentKind: 4 Constraints: 0x55 Listening: 1 Label: "Minutes:" ) (AVCBBox.71 InternalName: "Seconds" NextControl: 24 ContentKind: 4 Constraints: 0x55 Listening: 1 Label: "Seconds:" ) (AVCBBox.72 InternalName: "longsec" NextControl: 24 ContentKind: 4 Constraints: 0x55 Listening: 1 Label: "Seconds:" ) (AVCBBox.73 InternalName: "longmin" Help: "Choose the number of degrees minutes and seconds that will separate each graticule line/tic" NextControl: 24 ContentKind: 4 Constraints: 0x55 Listening: 1 Label: "Minutes:" ) (AVCBBox.74 InternalName: "longdeg" Help: "Choose the number of degrees minutes and seconds that will separate each graticule line/tic" NextControl: 24 ContentKind: 4 Constraints: 0x55 Listening: 1 Label: "Degrees:" ) (RectD.75 Left: 37.00000000000000 Top: 53.00000000000000 Right: 136.00000000000000 Bottom: 30.00000000000000 ) (RectD.76 Left: 188.00000000000000 Top: 53.00000000000000 Right: 361.00000000000000 Bottom: 30.00000000000000 ) (RectD.77 Left: 9.00000000000000 Top: 309.00000000000000 Right: 239.00000000000000 Bottom: 189.00000000000000 ) (RectD.78 Left: 9.00000000000000 Top: 331.00000000000000 Right: 239.00000000000000 Bottom: 211.00000000000000 ) (RectD.79 Left: 9.00000000000000 Top: 353.00000000000000 Right: 239.00000000000000 Bottom: 233.00000000000000 ) (RectD.80 Left: 9.00000000000000 Top: 263.00000000000000 Right: 239.00000000000000 Bottom: 143.00000000000000 ) (RectD.81 Left: 9.00000000000000 Top: 285.00000000000000 Right: 239.00000000000000 Bottom: 165.00000000000000 ) (RectD.82 Left: 8.00000000000000 Top: 38.00000000000000 Right: 250.00000000000000 Bottom: 11.00000000000000 ) (RectD.83 Left: 9.00000000000000 Top: 70.00000000000000 Right: 361.00000000000000 Bottom: 54.00000000000000 ) (RectD.84 Left: 28.00000000000000 Top: 195.00000000000000 Right: 172.00000000000000 Bottom: 75.00000000000000 ) (RectD.85 Left: 28.00000000000000 Top: 217.00000000000000 Right: 172.00000000000000 Bottom: 97.00000000000000 ) (RectD.86 Left: 28.00000000000000 Top: 239.00000000000000 Right: 172.00000000000000 Bottom: 119.00000000000000 ) (RectD.87 Left: 194.00000000000000 Top: 239.00000000000000 Right: 338.00000000000000 Bottom: 119.00000000000000 ) (RectD.88 Left: 194.00000000000000 Top: 217.00000000000000 Right: 338.00000000000000 Bottom: 97.00000000000000 ) (RectD.89 Left: 194.00000000000000 Top: 195.00000000000000 Right: 338.00000000000000 Bottom: 75.00000000000000 ) (LButn.90 InternalName: "Finish" Help: "Previews the graticule or grid using the current settings" Label: "Preview" Click: "GratGrids.LayoutGraticule Create" ) (LButn.91 InternalName: "Next" Help: "Shows the next panel of the graticule and grid wizard" Label: "Next >>" Click: "GratGrids.LayoutGraticule Update Panels" ) (LButn.92 InternalName: "Back" Help: "Shows the previous panel of the graticule and grid wizard" Label: "<< Back" Click: "GratGrids.LayoutGraticule Update Panels" ) (LButn.93 InternalName: "Cancel" Help: "Closes the graticule and grid wizard without adding anything to your layout" Label: "Cancel" Click: "GratGrids.LayoutGraticule Update Panels" ) (CPanel.94 InternalName: "gridpanel" Child: 95 Child: 96 Child: 98 Child: 99 Child: 100 Child: 101 Child: 102 Child: 103 Child: 104 Child: 105 Constraints: 0x55 ResBox: 106 ResBox: 107 ResBox: 108 ResBox: 109 ResBox: 110 ResBox: 111 ResBox: 112 ResBox: 113 ResBox: 114 ResBox: 115 VisibleBorder: 1 Listening: 1 ) (TextLabel.95 InternalName: "aTextLabel67" Constraints: 0x55 Label: "Choose options for your grid:" Listening: 1 ) (TextLine.96 InternalName: "GridInt" Help: "Enter a grid interval in meters" Label: "Enter a grid interval:" Constraints: 0x55 Listening: 1 TextType: 97 Size: 3 NextControl: 24 ) (AVEnum.97 Name: "TEXTLINE_TYPE_INTEGER" ) (TextLabel.98 InternalName: "aTextLabel69" Constraints: 0x55 Label: "Display grid as:" Listening: 1 ) (RButn.99 InternalName: "GridTics" Help: "Choose this to display the grid as tick marks that look like this: +" Constraints: 0x55 Listening: 1 Label: "tic marks" ) (RButn.100 InternalName: "GridLines" Help: "Check this to display the grid as lines" Constraints: 0x55 Listening: 1 Label: "lines" ) (AVCBBox.101 InternalName: "GridColor" Help: "Choose a color for the grid labels and lines or tics" NextControl: 24 ContentKind: 4 Constraints: 0x55 Listening: 1 Label: "Grid and label color:" ) (AVCBBox.102 InternalName: "GridLineWt" Help: "Choose the line width for the grid lines or tics" NextControl: 24 ContentKind: 4 Constraints: 0x55 Listening: 1 Label: "Grid line width (pts):" ) (AVCBBox.103 InternalName: "GridLabFont" Help: "Choose the font for the grid labels" NextControl: 24 ContentKind: 4 Constraints: 0x55 Listening: 1 Label: "Label font:" Select: "GratGrids.LayoutGraticule Font Changed" ) (AVCBBox.104 InternalName: "GridLabelSize" Help: "Choose the size for the grid labels" NextControl: 24 ContentKind: 4 Constraints: 0x55 Listening: 1 Label: "Label size (pts):" ) (AVCBBox.105 InternalName: "GridLabelStyle" Help: "Choose the style for the grid labels" NextControl: 24 ContentKind: 4 Constraints: 0x55 Listening: 1 Label: "Label text style:" ) (RectD.106 Left: 8.00000000000000 Top: 32.00000000000000 Right: 231.00000000000000 Bottom: 13.00000000000000 ) (RectD.107 Left: 20.00000000000000 Top: 59.00000000000000 Right: 260.00000000000000 Bottom: 39.00000000000000 ) (RectD.108 Left: 20.00000000000000 Top: 97.00000000000000 Right: 129.00000000000000 Bottom: 76.00000000000000 ) (RectD.109 Left: 126.00000000000000 Top: 84.00000000000000 Right: 250.00000000000000 Bottom: 68.00000000000000 ) (RectD.110 Left: 126.00000000000000 Top: 107.00000000000000 Right: 230.00000000000000 Bottom: 85.00000000000000 ) (RectD.111 Left: 20.00000000000000 Top: 258.00000000000000 Right: 260.00000000000000 Bottom: 138.00000000000000 ) (RectD.112 Left: 20.00000000000000 Top: 236.00000000000000 Right: 260.00000000000000 Bottom: 116.00000000000000 ) (RectD.113 Left: 20.00000000000000 Top: 293.00000000000000 Right: 260.00000000000000 Bottom: 173.00000000000000 ) (RectD.114 Left: 20.00000000000000 Top: 315.00000000000000 Right: 260.00000000000000 Bottom: 195.00000000000000 ) (RectD.115 Left: 20.00000000000000 Top: 337.00000000000000 Right: 260.00000000000000 Bottom: 217.00000000000000 ) (LButn.116 InternalName: "aLabelButton1" Label: "Help..." Click: "GratGrids.Help" ) (RectD.117 Left: 9.00000000000000 Top: 275.00000000000000 Right: 558.00000000000000 Bottom: 3.00000000000000 ) (RectD.118 Left: 36.00000000000000 Top: 585.00000000000000 Right: 401.00000000000000 Bottom: 326.00000000000000 ) (RectD.119 Left: 589.00000000000000 Top: 675.00000000000000 Right: 954.00000000000000 Bottom: 417.00000000000000 ) (RectD.120 Left: 589.00000000000000 Top: 416.00000000000000 Right: 954.00000000000000 Bottom: 158.00000000000000 ) (RectD.121 Left: 476.00000000000000 Top: 305.00000000000000 Right: 558.00000000000000 Bottom: 280.00000000000000 ) (RectD.122 Left: 390.00000000000000 Top: 305.00000000000000 Right: 472.00000000000000 Bottom: 280.00000000000000 ) (RectD.123 Left: 304.00000000000000 Top: 305.00000000000000 Right: 386.00000000000000 Bottom: 280.00000000000000 ) (RectD.124 Left: 218.00000000000000 Top: 305.00000000000000 Right: 299.00000000000000 Bottom: 280.00000000000000 ) (RectD.125 Left: 589.00000000000000 Top: 158.00000000000000 Right: 954.00000000000000 Bottom: -101.00000000000000 ) (RectD.126 Left: 9.00000000000000 Top: 305.00000000000000 Right: 90.00000000000000 Bottom: 280.00000000000000 ) (Nil.127 ) (Script.128 Name: "GratGrids.LayoutGraticule Border Display Option" SourceCode: "MTD = av.FindDialog(\"Grat Grids Layout Grids and Graticules\")\n\n\nCancelButton = MTD.FindByName(\"Cancel\")\nBackButton = MTD.FindByName(\"Back\")\nNextButton = MTD.FindByName(\"Next\")\nFinishButton = MTD.FindByName(\"Finish\")\nOptionPanel = MTD.FindByName(\"OptionPanel\")\nGratPanel = MTD.FindByName(\"GratOptions\")\nGridPanel = MTD.FindByName(\"gridpanel\")\nBorderPanel = MTD.FindByName(\"graphicoptions\")\nMapBorderStyle = MTD.FindByName(\"MapBorderStyle\")\nMapBorderColor = MTD.FindByName(\"MapBorderColor\")\nLabelBorderColor = MTD. FindByName(\"LabelBorderColor\")\nLabelBorderStyle = MTD.FindByName(\"LabelBorderStyle\")\nLabelBorderOptions = MTD.FindByName(\"LabelBorderOptions\")\nMapBorderOptions = MTD.FindByName(\"MapBorderOptions\")\nBorderAroundMap = MTD.FindByName(\"BorderAroundMap\")\nBorderAroundLabels = MTD.FindByName(\"BorderAroundLabels\")\n\nif (BorderAroundMap.IsSelected) then\n MapBorderStyle.SetEnabled(true)\n MapBorderColor.SetEnabled(true)\n MapBorderOptions.SetEnabled(true)\nelse\n MapBorderStyle.SetEnabled(false)\n MapBorderColor.SetEna bled(false)\n MapBorderOptions.SetEnabled(false)\nend\n\nif (BorderAroundLabels.IsSelected) then\n LabelBorderColor.SetEnabled(true)\n LabelBorderStyle.SetEnabled(true)\n LabelBorderOptions.SetEnabled(true)\nelse\n LabelBorderColor.SetEnabled(false)\n LabelBorderStyle.SetEnabled(false)\n LabelBorderOptions.SetEnabled(false)\nend" ) (Script.129 Name: "GratGrids.LayoutGraticule Change View" SourceCode: "theLayout = av.GetActiveDoc\nif ( Not (theLayout.is(Layout))) then\n Msgbox.Info(\"Please make your layout active again.\",\"Oops\")\n return nil\nend\ntheGraphics = theLayout.GetGraphics\nMTD = av.FindDialog(\"Grat Grids Layout Grids and Graticules\")\nViewFrames = MTD.FindByName(\"viewFrames\")\n\n\ntheView = av.GetProject.FindDoc(ViewFrames.GetSelection)\nvfs = av.GetActiveDoc.GetGraphics.FindAllByClass(ViewFrame)\nvfl = {}\nHasPrjData = false\nthisPrj = theView.GetProjection\nif (thisPrj.IsNull) then\n for each t in theVi ew.GetThemes\n te = t.ReturnExtent.AsPolygon\n br = Rect.MakeXY(-181,-90,181,90).AsPolygon\n if (br.Contains(te).Not) then\n MTD.FindByName(\"SelectGrat\").SetSelected(false)\n MTD.FindByName(\"SelectGrat\").SetEnabled(false)\n HasPrjData = true\n break\n end\n end\nend\n\nif ((HasPrjData.Not) and (MTD.FindByName(\"SelectGrat\").IsEnabled.Not)) then\n MTD.FindByName(\"SelectGrat\").SetSelected(true)\n MTD.FindByName(\"SelectGrat\").SetEnabled(true)\nend\n\nfor each vf in vfs\n tV = vf.GetFillObject. GetName\n if (tV = theView.GetName) then\n theGraphic = vf\n end\nend\n\nMTD = av.FindDialog(\"Grat Grids Layout Grids and Graticules\")\n\nxyRect = theGraphic.GetMapDisplay.ReturnExtent\nxyOrigin = xyrect.ReturnOrigin\nxySize = xyrect.ReturnSize\nminLength = xySize.GetX Min xySize.GetY\nxyIntervals = {20000000,10000000,5000000,2000000,1000000,500000,200000,100000,50000,20000,10000,5000,2000,1000,500,200,100,50,20,10,5,2,1 }\nrawInterval = minLength / 4 ' 4 is the default number of lines\ntheInterval = xyInterva ls.Get( xyIntervals.Count - 1 )\nfor each val in xyIntervals\n if (rawInterval >= val) then\n theInterval = val\n break\n end\nend\ntheInt = theInterval.SetFormat(\"d\")\nMTD.FindByName(\"GridInt\").SetText(theInt.AsString)" ) (Script.130 Name: "GratGrids.LayoutGraticule Create" SourceCode: "MTD = av.FindDialog(\"Grat Grids Layout Grids and Graticules\")\ntheLayout = av.GetActiveDoc\nif ( Not (theLayout.is(Layout))) then\n Msgbox.Info(\"Please make your layout active again.\",\"Oops\")\n return nil\nend\ntheGraphics = theLayout.GetGraphics\nif (Self.GetLabel = \"Finish\") then\n theGraphics.UnSelectAll\n tests = theGraphics.FindAllByName(\"Preview_GratGrid\")\n if (tests <> nil) then\n for each gsgx in tests\n gsgx.SetSelected(true)\n gsgx.SetName(\"Final\")\n end\n theGraphics.GroupSelected\n theGraphics.GroupSelected\n theGraphics.GetSelected.Get(0).SetName(\"Final\")\n end\n MTD.Close\n return nil\nend\n\ntheGraphics = theLayout.GetGraphics\nlAdj = 0\n\nBackButton = MTD.FindByName(\"Back\")\nNextButton = MTD.FindByName(\"Next\")\nFinishButton = MTD.FindByName(\"Finish\")\nOptionPanel = MTD.FindByName(\"OptionPanel\")\nGratPanel = MTD.FindByName(\"GratOptions\")\nGridPanel = MTD.FindByName(\"gridpanel\")\nBorderPanel = MTD.FindByName(\"graphicoptions\")\nViewFrames = MTD.FindByName(\"viewFrames\")\nSelGrat = MTD.FindByName (\"SelectGrat\")\nSelGrid = MTD.FindByName(\"SelectGrid\")\nDegrees = MTD.FindByName(\"Degrees\").GetCurrentValue.AsNumber \nMinutes = MTD.FindByName(\"Minutes\").GetCurrentValue.AsNumber \nSeconds = MTD.FindByName(\"Seconds\").GetCurrentValue.AsNumber \nlongdeg = MTD.FindByName(\"longdeg\").GetCurrentValue.AsNumber\nlongmin = MTD.FindByName(\"longmin\").GetCurrentValue.AsNumber\nlongsec = MTD.FindByName(\"longsec\").GetCurrentValue.AsNumber\nGratLabFont = MTD.FindByName(\"GratLabFont\").GetCurrentValue\nGridLabFont = MTD.FindByName( \"GridLabFont\").GetCurrentValue\nLabelBorderColor = MTD.FindByName(\"LabelBorderColor\").GetCurrentValue\nMapBorderColor = MTD.FindByName(\"MapBorderColor\").GetCurrentValue\nGridColor = MTD.FindByName(\"GridColor\").GetCurrentValue\nGratColor = MTD.FindByName(\"GratColor\").GetCurrentValue\nGratAndLab = MTD.FindByName(\"GratandLab\")\nLabOnly = MTD.FindByName(\"LabOnly\").IsSelected\nGridInt = MTD.FindByName(\"GridInt\").GetText\nGridLines = MTD.FindByName(\"GridLines\").IsSelected\nGridTics = MTD.FindByName(\"GridTics\").IsSelected\n GridLineWt = MTD.FindByName(\"GridLineWt\").GetCurrentValue.AsNumber\nGratLineWt = MTD.FindByName(\"GratLineWt\").GetCurrentValue.AsNumber\nMapBorderLineWt = 3\nLabelBorderLineWt = 3\nMapBorderStyle = MTD.FindByName(\"MapBorderStyle\").GetCurrentValue.GetName\nLabelBorderStyle = MTD.FindByName(\"LabelBorderStyle\").GetCurrentValue.GetName\nGridLabelSize = MTD.FindByName(\"GridLabelSize\").GetCurrentValue.AsNumber\nGratLabelSize = MTD.FindByName(\"GratLabelSize\").GetCurrentValue.AsNumber\nGridLabelStyle = MTD.FindByName(\"GridL abelStyle\").GetCurrentValue\nGratLabelStyle = MTD.FindByName(\"GratLabelStyle\").GetCurrentValue\nLabelBorderOptions = MTD.FindByName(\"LabelBorderOptions\")\nMapBorderOptions = MTD.FindByName(\"MapBorderOptions\")\nBorderAroundMap = MTD.FindByName(\"BorderAroundMap\").IsSelected\nBorderAroundLabels = MTD.FindByName(\"BorderAroundLabels\").IsSelected\nAlignLabels = MTD.FindByName(\"AlignLabels\").IsSelected\n\nvAdj = GratLabelSize/(720) \n\n'*******************************************************************\n'* Set variables tha t tell which graphical options are to be used. *\n'*******************************************************************\n\ndoXYGrid = false\ndoGridLines = false\ndoGraticule = false\ndoLatLongs = false \nif (SelGrat.IsSelected) then\n doGraticule = true\n if (GratAndLab.IsSelected) then\n doLatLongs = true \n end \nend\nif (SelGrid.IsSelected) then\n doXYGrid = true\n if (GridLines) then\n doGridLines = true\n end\nend\n\ntheView = av.GetProject.FindDoc(ViewFrames.GetSelection)\nvfs = av.GetActiveDoc.GetGraphics.Find AllByClass(ViewFrame)\nvfl = {}\nIsProj = true\nfor each vf in vfs\n tV = vf.GetFillObject.GetName\n if (tV = theView.GetName) then\n theGraphic = vf\n end\nend\n\ntheView = theGraphic.GetFillObject\nthisPrj = theView.GetProjection\nif (thisPrj.IsNull) then\n isProj = false\nend\n\n' Extent of view frame in page units (inches)\ndOrigin = theGraphic.GetOrigin\ndSize = theGraphic.GetExtent\ndRect = Rect.Make( dOrigin, dSize )\n\n' Extent of view frame in map units to solve a feature in \n' ReturnExtents that gives erroniou s results when extentpreserved \n' is set to true set extent preserved to false, get the extent, \n' and set it back to its original value.\ncurSetting = theGraphic.IsExtentPreserved \ntheGraphic.SetExtentPreserved(false)\nxyRect = theGraphic.GetMapDisplay.ReturnExtent \nxyOrigin = xyrect.ReturnOrigin \nxySize = xyrect.ReturnSize\ntheGraphic.SetExtentPreserved(curSetting) \n\n' This is how to translate a point from map coords to page coords\n'aPt = dOrigin + ( ((p - xyOrigin) / xySize) * dSize)\n\nxMin = xyOrigin.GetX\ny Min = xyOrigin.GetY\nxMax = xMin + xySize.GetX\nyMax = yMin + xySize.GetY\n\nif ( doGraticule ) then\n point1= Point.Make(xMin,yMin)\n point2= Point.Make(xMax,yMin)\n point3= Point.Make(xMax,yMax)\n point4= Point.Make(xMin,yMax)\n point5= Point.Make((xMin+(xMax-xMin)/2),yMin)\n point6= Point.Make(xMax,(yMin+(yMax-yMin)/2))\n point7= Point.Make((xMin+(xMax-xMin)/2),yMax)\n point8= Point.Make(xMin,(yMin+(yMax-yMin)/2))\n if (IsProj) then\n a = thisPrj.UnProjectPt(point1)\n b = thisPrj.UnProjectPt(point2)\n c = thisPrj.UnProjectPt(point3)\n d = thisPrj.UnProjectPt(point4)\n e = thisPrj.UnProjectPt(point5)\n f = thisPrj.UnProjectPt(point6)\n g = thisPrj.UnProjectPt(point7)\n h = thisPrj.UnProjectPt(point8)\n else\n a = true\n b = true\n c = true\n d = true\n e = true\n f = true\n g = true\n h = true\n end\n if (((d) and (h) and (a)) and (a <> false)) then\n minlon= (Point1.GetX)Min(Point4.GetX)Min(Point8.GetX)Max(-180)\n else\n minlon = -180\n end\n if (((a) and (b) and (e)) and ( a <> false)) then\n minlat= (Point1.GetY)Min(Point2.GetY)Min(Point5.GetY)Max(-90)\n else\n minlat = -90\n end\n if (((b) and (c) and (f)) and (b <> false)) then\n maxlon= (Point2.GetX)Max(Point3.GetX)Max(Point6.GetX)Min(180)\n else\n maxlon = 180\n end\n if (((c) and (d) and (g)) and (c <> false)) then\n maxlat= (Point3.GetY)Max(Point4.GetY)Max(Point7.GetY)Min(90)\n else\n maxlat = 90\n end\n lonInterval = longdeg + ( longmin / 60) + ( longsec / 3600)\n latInterval = degrees + ( Minutes / 60) + ( Seconds / 3600)\nend\n\nif ( doXYGrid ) then \n metresInt = GridInt\n gratdx = metresInt.AsNumber\n gratdy = gratdx\n gratxs= (xMin/gratdx).Floor * gratdx - gratdx\n gratys= (yMin/gratdy).Floor * gratdy - gratdy\n gratxe= (xMax/gratdx).Ceiling * gratdx + gratdx\n gratye= (yMax/gratdy).Ceiling * gratdy + gratdy\nend\n\ncolorNames = {\"Black\",\"Red\",\"Blue\",\"Dark Green\",\"White\",\"Dark Gray\"}\ncolorDefs = {{0,0,0},{255,0,0},{0,0,255},{0,150,0},{255,255,255},{100,100,100}}\nfor each cn in colorNames\n if (GratColor = cn) then\n GraticuleColor = Color.Make\n GraticuleColor.SetRGBList(ColorDefs.Get(colorNames.FindByValue(cn)))\n end\n if (GridColor = cn) then\n XYGridColor = Color.Make\n XYGridColor.SetRGBList(ColorDefs.Get(colorNames.FindByValue(cn)))\n end\n if (MapBorderColor = cn) then\n MBColor = Color.Make\n MBColor.SetRGBList(ColorDefs.Get(colorNames.FindByValue(cn)))\n end\n if (LabelBorderColor = cn) then\n LBColor = Color.Make\n LBColor.SetRGBList(ColorDefs.Get(colorNames.FindByValue(cn)))\n e nd\nend\n\n\ngeolfont= Font.Make(GratLabFont,GratLabelStyle)\ngeolSymbol= TextSymbol.Make\ngeolSymbol.SetFont(geolfont)\ngeolSymbol.SetColor(GraticuleColor)\ngeolsymbol.SetSize(GratLabelSize)\n\nxyfont= Font.Make(GridLabFont,GridLabelStyle)\nxySymbol= TextSymbol.Make\nxySymbol.SetFont(xyfont)\nxySymbol.SetColor(XYGridColor)\nxysymbol.SetSize(GridLabelSize)\n\n'** XYGrid Line Symbol\nblackLine= Symbol.Make(#SYMBOL_PEN)\nblackLine.SetColor(XYGridColor)\nblackLine.SetSize(GridLineWt)\n\n\n'** Map Border Symbol\nthickblackLine= Symbo l.Make(#SYMBOL_PEN)\nthickblackLine.SetColor(MBColor)\nthickblackLine.SetSize(MapBorderLineWt)\n\n'** Graticule Line Symbol\ngratLine= Symbol.Make(#SYMBOL_PEN)\ngratLine.SetColor(GraticuleColor)\ngratLine.SetSize(GratLineWt)\n\n\nLabelsmade = {}\n\n'** Draw the lat/long graticule, with labels all around\n'** Collect graticule lines clipped to the window\n\nif ( doGraticule ) then\n\n latStartActual = -90\n latEndActual = 90\n lonStartActual = -180\n lonEndActual = 180\n \n if (((maxlat - minlat) > 10) and ((maxlat - minlat ) <= 20)) then\n latStartNice = (minlat/2).Floor * 2\n latEndNice = (maxlat/2).Ceiling * 2\n lonStartNice = (minlon/2).Floor * 2\n lonEndNice = (maxlon/2).Ceiling * 2\n elseif (((maxlat - minlat) > 20) and ((maxlat - minlat) <= 50)) then\n latStartNice = (minlat/5).Floor * 5\n latEndNice = (maxlat/5).Ceiling * 5\n lonStartNice = (minlon/5).Floor * 5\n lonEndNice = (maxlon/5).Ceiling * 5\n elseif((maxlat - minlat) > 50) then\n latStartNice = (minlat/10).Floor * 10\n latEndNice = (maxlat/1 0).Ceiling * 10\n lonStartNice = (minlon/10).Floor * 10\n lonEndNice = (maxlon/10).Ceiling * 10\n else\n latStartNice = minlat.Floor\n latEndNice = maxlat.Ceiling\n lonStartNice = minlon.Floor\n lonEndNice = maxlon.Ceiling \n end\n \n \n latList = {}\n for each lat in latStartNice .. latEndNice by latInterval\n aLine = Line.Make( lonStartActual@lat, lonEndActual@lat )\n if (IsProj) then\n prjLine = aLine.ReturnProjected( thisPrj ).ReturnClipped( xyRect )\n else\n prjLine = aLi ne.AsPolyLine.ReturnClipped( xyRect ) \n end\n if ( prjLine <> nil ) then\n latList = latList.Add( {lat, prjLine} )\n end\n end\n lonList = {}\n for each lon in lonStartNice .. lonEndNice by lonInterval\n aLine = Line.Make( lon@latStartActual, lon@latEndActual )\n if (IsProj) then\n prjLine = aLine.ReturnProjected( thisPrj ).ReturnClipped( xyRect )\n else\n prjLine = aLine.AsPolyLine.ReturnClipped( xyRect ) \n end\n if ( prjLine <> nil ) then\n lonList = lonList.A dd( {lon, prjLine} )\n end\n end\n\n for each aList in latList\n lat = aList.Get(0)\n prjLine = aList.Get(1)\n gPolyLine = {}\n for each ptList in prjLine.AsList\n gPtList = {}\n for each aPt in ptList\n thePt = dOrigin + ( ((aPt - xyOrigin) / xySize) * dSize)\n gPtList = gPtList.Add( thePt )\n end\n gPolyLine = gPolyLine.Add( gPtList )\n end\n theGratLine = GraphicShape.Make( PolyLine.Make(gPolyLine) )\n theGratLine.SetDisplay(theLayout.GetDisplay)\n the GratLine.SetName(\"Preview_GratGrid\")\n theGratLine.SetSymbol( gratLine )\n if (LabOnly.Not) then\n theGraphics.AddBatch( theGratLine )\n end\n for each ptList in prjLine.AsList\n for each endPt in { ptList.Get(0), ptList.Get(ptList.Count-1) }\n deg = lat.Abs.Truncate.SetFormat(\"d\")\n labelString = deg.AsString+\"°\"\n t = ( lat.Abs - deg ) * 60\n minute = t.Truncate.SetFormat(\"d\")\n if ( (t - minute) >= 0.9998 ) then\n minute = minute + 1\n end\n if ( minute > 0 ) then\n labelString = labelString+minute.AsString+\"'\"\n elseif (Minutes > 0) then\n labelString = labelString+\"00'\" \n end\n if ( (t - minute) > 0.0002 ) then\n sec = ((t - minute) * 60).Round\n sec = sec.Truncate.SetFormat(\"d\")\n if (sec > 9) then\n labelString = labelString+sec.AsString+\"\"\"\"\n else\n labelString = labelString+\"0\"+sec.AsString+\"\"\"\" \n end\n elseif ( Seconds > 0) then\n labelString = labelString + \"00\"\"\"\n end\n ' ... put latitude label\n aPt = dOrigin + ( ((endPt - xyOrigin) / xySize) * dSize)\n mygText= GraphicText.Make(labelString,aPt)\n mygText.setobjecttag(\"mygText\")\n mygText.SetSymbol(geolsymbol)\n mygText.SetDisplay(theLayout.GetDisplay)\n gpoint2 = GraphicShape.Make(aPt)\n tph= TextPositioner.Make(gpoint2.GetClass)\n Gt = 0.06\n if (doXYGrid) then\n Gt = 0.2\n e nd\n\n if ( (aPt.GetX - 0.05) <= dRect.GetLeft ) then\n theGratLine = GraphicShape.Make( Line.Make( aPt-(0.05@0), aPt ) )\n o = aPt.Clone - ((mygText.GetExtent.GetX + 0.06)@(mygText.GetExtent.GetY/2))\n if (AlignLabels) then\n mygText.SetAngle(90)\n o = aPt.Clone - ((mygText.GetExtent.GetX + Gt)@(mygText.GetExtent.GetY/2))\n end\n elseif ( (aPt.GetX + 0.05) >= dRect.GetRight ) then\n theGratLine = GraphicShape.Make( Line.Make( aPt+(0 .05@0), aPt ) )\n o = aPt.Clone + ((0.06)@(-(mygText.GetExtent.GetY/2)))\n if (AlignLabels) then\n mygText.SetAngle(-90)\n o = aPt.Clone + ((Gt)@(-(mygText.GetExtent.GetY/2)))\n end\n elseif ( (aPt.GetY -0.05) <= dRect.GetBottom ) then\n theGratLine = GraphicShape.Make( Line.Make( aPt-(0@0.05), aPt ) )\n o = aPt.Clone - ((mygText.GetExtent.GetX/2)@(mygText.GetExtent.GetY + (Gt - 0.03)))\n elseif ( (aPt.GetY + 0.05) >= dRect.GetTop ) then\n theGratLine = GraphicShape.Make( Line.Make( aPt+(0@0.05), aPt ) )\n o = aPt.Clone - ((mygText.GetExtent.GetX/2)@(-Gt))\n else\n continue\n end\n\n mygText.SetOrigin(o)\n addTheLab = true\n for each l in LabelsMade\n if (mygText.GetBounds.Intersects(l.GetBounds.Clone.InsetBy(0.03))) then\n addTheLab = false\n end\n end\n if (addTheLab) then\n mygText.setobjecttag(\"mygText\")\n theGraphics.Addbatc h(mygText) \n mygText.SetName(\"Preview_GratGrid\") \n theGratLine.SetSymbol( gratLine )\n theGratLine.SetName(\"Preview_GratGrid\")\n theGraphics.Addbatch(theGratLine)\n LabelsMade.Add(mygText)\n end\n end\n end\n end\n\n for each aList in lonList\n lon = aList.Get(0)\n prjLine = aList.Get(1)\n gPolyLine = {}\n for each ptList in prjLine.AsList\n gPtList = {}\n for each aPt in ptList\n thePt = dOrigin + ( ((aPt - xyOrigin) / xySize) * dSize)\n gPtList = gPtList.Add( thePt )\n end\n gPolyLine = gPolyLine.Add( gPtList )\n end\n theGratLine = GraphicShape.Make( PolyLine.Make(gPolyLine) )\n theGratLine.SetDisplay(theLayout.GetDisplay)\n theGratLine.SetSymbol( gratLine )\n theGratLine.SetName(\"Preview_GratGrid\")\n if (LabOnly.Not) then\n theGraphics.Addbatch( theGratLine )\n end\n\n for each ptList in prjLine.AsList\n for each endPt in { ptList.Get(0), ptList.Get(ptList.Count-1) }\n deg= lon.Abs .Truncate.SetFormat(\"d\")\n labelString = deg.AsString+\"°\"\n t= ( lon.Abs - deg ) * 60\n minute= t.Truncate.SetFormat(\"d\")\n if ( (t - minute) >= 0.9998 ) then\n minute = minute + 1\n end\n if ( minute > 0 ) then\n labelString = labelString+minute.AsString+\"'\"\n elseif (longmin > 0) then\n labelString = labelString+\"00'\" \n end\n if ( (t - minute) > 0.0002 ) then\n sec = ((t-minute) * 60).Round\n sec = sec.Truncate.SetFormat(\"d\")\n if (sec > 9) then\n labelString = labelString+sec.AsString+\"\"\"\"\n else\n labelString = labelString+\"0\"+sec.AsString+\"\"\"\" \n end\n elseif (longsec > 0) then\n labelString = labelString + \"00\"\"\"\n end\n ' ... put longitude label\n aPt = dOrigin + ( ((endPt - xyOrigin) / xySize) * dSize)\n mygText= GraphicText.Make(labelString,aPt)\n mygText.setobjecttag(\"mygtext\")\n mygText.SetSym bol(geolsymbol)\n mygText.SetDisplay(theLayout.GetDisplay)\n Gt = 0.06\n if (doXYGrid) then\n Gt = 0.2\n end \n\n if ( (aPt.GetX + 0.05) <= dRect.GetLeft ) then\n theGratLine = GraphicShape.Make( Line.Make( aPt-(0.05@0), aPt ) )\n o = aPt.Clone - ((mygText.GetExtent.GetX + 0.06)@(mygText.GetExtent.GetY/2))\n if (AlignLabels) then\n mygText.SetAngle(90)\n o = aPt.Clone - ((mygText.GetExtent.GetX + Gt)@(mygText.GetExtent .GetY/2))\n end\n elseif ( (aPt.GetX+0.05) >= dRect.GetRight ) then\n theGratLine = GraphicShape.Make( Line.Make( aPt+(0.05@0), aPt ) )\n o = aPt.Clone + ((0.06)@(-(mygText.GetExtent.GetY/2)))\n if (AlignLabels) then\n mygText.SetAngle(-90)\n o = aPt.Clone + ((Gt)@(-(mygText.GetExtent.GetY/2)))\n end\n elseif ( (aPt.GetY - 0.05) <= dRect.GetBottom ) then\n theGratLine = GraphicShape.Make( Line.Make( aPt-(0@0.05), aPt ) )\n o = aPt.Clone - ((mygText.GetExtent.GetX/2)@(mygText.GetExtent.GetY + (Gt - 0.03)))\n elseif ( (aPt.GetY + 0.05) >= dRect.GetTop) then\n theGratLine = GraphicShape.Make( Line.Make( aPt+(0@0.05), aPt ) )\n o = aPt.Clone - ((mygText.GetExtent.GetX/2)@(-Gt))\n else\n continue\n end\n\n mygText.SetOrigin(o)\n addTheLab = true\n for each l in LabelsMade\n if (mygText.GetBounds.Intersects(l.GetBounds.Clone.InsetBy(0.03))) then\n addTheLab = false\n end\n end\n if (addTheLab) then\n mygText.setobjecttag(\"mygText\")\n theGraphics.Addbatch(mygText) \n mygText.SetName(\"Preview_GratGrid\")\n theGratLine.SetSymbol( gratLine )\n theGraphics.AddBatch( theGratLine )\n theGratLine.SetName(\"Preview_GratGrid\")\n LabelsMade.Add(mygText)\n end\n end\n end ' of foreach in prjLine\n end ' of foreach in lonList\nend ' of if (doLatLongs)\n\nif ( doXYGrid ) the n\n'** Draw metres graticule as lines, with coordinates all around vertical lines\n if (GridLines) then\n xoffset = (gratxe/2)@0\n yoffset = 0@(gratye/2)\n else\n xoffset = 0.0625@0\n yoffset = 0@0.0625\n end\n for each x in gratxs .. gratxe by gratdx\n if ( (x < xMin) or (x > xMax) ) then\n continue\n end\n for each y in gratys .. gratye by gratdy\n if ( (y < yMin) or (y > yMax) ) then\n continue\n end\n aPt = dOrigin + ( ((x@y - xyOrigin) / xySize) * dSize)\n aP olyLine = PolyLine.Make( {\n { aPt-xoffset, aPt+xoffset, aPt, aPt-yoffset, aPt+yoffset } } )\n ggLine = aPolyLine.ReturnClipped( dRect )\n gLine = GraphicShape.Make( ggLine )\n theGraphics.Addbatch( gLine )\n gline.SetName(\"Preview_GratGrid\")\n gLine.SetSymbol(blackline)\n end\n end\n for each x in gratxs .. gratxe by gratdx\n if ( (x < xMin) or (x > xMax) ) then\n continue\n end\n ' put easting label at ymax\n aPt = dOrigin + ( ((Point.Make(x,yMax) - xyOrigin) / xySize) * dSize)\n if (doGraticule) then\n gLine = GraphicShape.Make( Line.Make( aPt, aPt-(0@0.05) ) )\n else\n gLine = GraphicShape.Make( Line.Make( aPt, aPt+(0@0.055) ) )\n end\n theGraphics.Addbatch( gLine )\n gline.SetName(\"Preview_GratGrid\")\n gLine.SetSymbol( blackLine )\n aPt = aPt + Point.Make(0,0.07)\n mygText= GraphicText.Make(x.SetFormat(\"d\").AsString, aPt)\n mygText.setobjecttag(\"mygText\")\n mygText.SetDisplay(theLayout.GetDisplay)\n theGraphics.Addbatch(mygText )\n mygText.SetName(\"Preview_GratGrid\")\n mygText.SetSymbol(xySymbol)\n mygText.SetDisplay(theLayout.GetDisplay)\n o = aPt - ( (mygText.GetExtent.GetX/2)@(0))\n mygText.SetOrigin(o)\n'** put easting label at ymin\n aPt = dOrigin + ( ((Point.Make(x,yMin) - xyOrigin) / xySize) * dSize)\n if (doGraticule) then\n gLine = GraphicShape.Make( Line.Make( aPt, aPt+(0@0.05) ) )\n else\n gLine = GraphicShape.Make( Line.Make( aPt, aPt-(0@0.055) ) ) \n end\n theGraphics.Addbatch( gLine ) \n gline.SetName(\"Preview_GratGrid\")\n gLine.SetSymbol( blackLine )\n mygText= GraphicText.Make(x.SetFormat(\"d\").AsString, aPt)\n mygText.setobjecttag(\"mygText\")\n theGraphics.Addbatch(mygText)\n mygText.SetName(\"Preview_GratGrid\")\n mygText.SetSymbol(xySymbol)\n mygText.SetDisplay(theLayout.GetDisplay)\n o = aPt - ( (mygText.GetExtent.GetX/2)@(mygText.GetExtent.GetY + 0.03))\n mygText.SetOrigin(o)\n end ' of for each x\n for each y in gratys .. gratye by gratdy\n if ( (y < yMin) or ( y > yMax) ) then\n continue\n end\n'** put northing label at xmin\n aPt = dOrigin + ( ((Point.Make(xMin,y) - xyOrigin) / xySize) * dSize)\n if (doGraticule) then\n gLine = GraphicShape.Make( Line.Make( aPt+(0.05@0), aPt ) )\n else\n gLine = GraphicShape.Make( Line.Make( aPt-(0.055@0), aPt ) ) \n end\n theGraphics.Addbatch( gLine )\n gline.SetName(\"Preview_GratGrid\")\n gLine.SetSymbol( blackLine )\n aPt = aPt - (0.07@0)\n mygText= GraphicText.Make(y.SetFormat(\"d\").AsStr ing, aPt )\n mygText.setobjecttag(\"mygText\")\n theGraphics.Addbatch(mygText)\n mygText.SetName(\"Preview_GratGrid\")\n mygText.SetSymbol(xySymbol)\n mygText.SetDisplay(theLayout.GetDisplay)\n tph= PointTextPositioner.Make\n if (AlignLabels) then\n mygText.SetAngle(90)\n o = aPt.Clone - ((mygText.GetExtent.GetX)@(mygText.GetExtent.GetY / 2))\n else\n o = aPt.Clone - ((mygText.GetExtent.GetX)@(mygText.GetExtent.GetY / 3)) \n end\n mygText.SetOrigin(o)\n'** put northing label at xmax\n aPt = dOrigin + ( ((Point.Make(xMax,y) - xyOrigin) / xySize) * dSize) \n if (doGraticule) then\n gLine = GraphicShape.Make( Line.Make( aPt-(0.05@0), aPt ) )\n else\n gLine = GraphicShape.Make( Line.Make( aPt+(0.055@0), aPt ) ) \n end\n theGraphics.Addbatch( gLine )\n gline.SetName(\"Preview_GratGrid\")\n gLine.SetSymbol( blackLine )\n aPt = aPt + (0.07@0) \n mygText= GraphicText.Make(y.SetFormat(\"d\").AsString, aPt)\n mygText.setobjecttag(\"mygText\")\n theGraphics.Ad dbatch(mygText)\n mygText.SetName(\"Preview_GratGrid\")\n mygText.SetSymbol(xySymbol)\n mygText.SetDisplay(theLayout.GetDisplay)\n if (AlignLabels) then\n mygText.SetAngle(-90)\n o = aPt.Clone - (0@(mygText.GetExtent.GetY / 2))\n else\n o = aPt.Clone - (0@(mygText.GetExtent.GetY / 5))\n end\n mygText.SetOrigin(o)\n end ' of foreach y\nend ' of if (doXYGrid)\n\n\n\n'** Draw the border ...\nif (BorderAroundMap) then\n theBorder = GraphicShape.Make( dRect)\n theBorder.SetSymbol(thickblac kline)\n theBorder.SetName(\"Preview_GratGrid\")\n if (MapBorderStyle = \"Single\") then\n theGraphics.AddBatch( theBorder )\n elseif (MapBorderStyle.Contains(\"Double\")) then\n if (MapBorderStyle.Contains(\"Thick\")) then\n theBorder.GetSymbol.SetWidth ( (MapBorderLineWt * 0.75) )\n else\n theBorder.GetSymbol.SetWidth (0.2)\n end\n theGraphics.AddBatch( theBorder )\n eRect = dRect.Clone\n eRect.ExpandBy(0.05)\n thinLine = BasicPen.Make\n thinLine.SetColor(MBColor)\n thinLine.SetSize(0. 2)\n theDoubleBorder = GraphicShape.Make(eRect)\n theDoubleBorder.SetSymbol(thinLine)\n theGraphics.addBatch(theDoubleBorder)\n theDoubleBorder.SetName(\"Preview_GratGrid\")\n elseif (MapBorderStyle.Contains(\"Triple\")) then\n theBorder.GetSymbol.SetWidth (0.2)\n theGraphics.AddBatch( theBorder )\n eeRect = dRect.Clone\n eeRect.ExpandBy(0.025)\n eRect = dRect.Clone\n eRect.ExpandBy(0.05)\n thinLine = BasicPen.Make\n thinLine.SetColor(MBColor)\n thinLine.SetSize(0.2)\n theDoubleBorde r = GraphicShape.Make(eRect)\n theDoubleBorder.SetSymbol(thinLine)\n theGraphics.addBatch(theDoubleBorder)\n theDoubleBorder.SetName(\"Preview_GratGrid\")\n theTripleBorder = GraphicShape.Make(eeRect)\n if (MapBorderStyle.Contains(\"Thick\")) then\n thickerLine = BasicPen.Make\n thickerLine.SetColor(MBColor)\n thickerLine.SetSize((MapBorderLineWt * 0.66))\n theTripleBorder.SetSymbol(thickerLine)\n else\n theTripleBorder.SetSymbol(thinLine.Clone)\n end\n theGraphics.addBatch(t heTripleBorder)\n theTripleBorder.SetName(\"Preview_GratGrid\")\n end\nend\n\nif (nil<>thegraphics.findbyobjecttag(\"mygText\")) then\n for each agraphic in thegraphics.findallbyobjecttag(\"mygtext\")\n agraphic.setselected(true)\n agraphic.setobjecttag(nil)\n end\n if (BorderAroundLabels) then\n brect = theGraphics.ReturnSelectedExtent\n cDrect = dRect.ReturnCenter\n cBrect = brect.ReturnCenter\n if ((doXYGrid) and (not doGraticule)) then\n DAdj = cDrect - cBrect\n brectO = brect.ReturnOrigin\n newO = brectO + DAdj\n brect.SetOrigin(newO)\n end\n ebrect1 = brect.Clone.ExpandBy(0.04)\n nn = ebrect1.ReturnOrigin\n nnn = nn - (0@vAdj)\n ebrect1.SetOrigin(nnn)\n lbsym = BasicPen.make\n lbsym.SetSize(LabelBorderLineWt)\n lbsym.SetColor(LBColor)\n lBorder = GraphicShape.Make(ebrect1)\n lBorder.SetSymbol(lbsym)\n lBorder.SetName(\"Preview_GratGrid\")\n if (LabelBorderStyle = \"Single\") then\n theGraphics.AddBatch(lBorder)\n elseif (LabelBorderStyle.Contains(\"Double\") ) then\n if (LabelBorderStyle.Contains(\"Thick\")) then\n lBorder.GetSymbol.SetWidth ( (LabelBorderLineWt * 0.75) )\n else\n lBorder.GetSymbol.SetWidth (0.2)\n end\n theGraphics.AddBatch(lBorder)\n lBorder.SetName(\"Preview_GratGrid\")\n ebrect2 = ebrect1.Clone.ExpandBy(0.05)\n lbsym2 = BasicPen.Make\n lbsym2.SetColor(LBCOlor)\n lbsym2.SetSize(0.2)\n lBorder2 = GraphicShape.Make(ebrect2)\n lBorder2.SetSymbol(lbsym2)\n theGraphics.AddBatch(lBorder2)\n lBorder2.SetName(\"Preview_GratGrid\")\n elseif (LabelBorderStyle.Contains(\"Triple\")) then\n \n lBorder.GetSymbol.SetWidth (0.2)\n theGraphics.AddBatch( lBorder )\n eeRect = ebrect1.Clone\n eeRect.ExpandBy(0.025)\n eRect = ebrect1.Clone\n eRect.ExpandBy(0.05)\n thinLine = BasicPen.Make\n thinLine.SetColor(LBColor)\n thinLine.SetSize(0.2)\n theDoubleBorder = GraphicShape.Make(eRect)\n theDoubleBorder.SetSymbol(thinLine)\n theGraphics.addBatch(theDoubleBord er)\n theDoubleBorder.SetName(\"Preview_GratGrid\")\n theTripleBorder = GraphicShape.Make(eeRect)\n if (LabelBorderStyle.Contains(\"Thick\")) then\n thickerLine = BasicPen.Make\n thickerLine.SetColor(MBColor)\n thickerLine.SetSize((MapBorderLineWt * 0.66))\n theTripleBorder.SetSymbol(thickerLine)\n else\n theTripleBorder.SetSymbol(thinLine.Clone)\n end\n theGraphics.addBatch(theTripleBorder)\n theTripleBorder.SetName(\"Preview_GratGrid\")\n \n end\n en d\nend\ntheGraphics.EndBatch\n\n\ntheGraphics.UnSelectAll\nif (nil<>thegraphics.FindAllByName(\"GratGrid\")) then\n for each agraphic in thegraphics.FindAllByName(\"Preview_GratGrid\")\n agraphic.setselected(true)\n end\n thegraphics.groupselected\n theGraphics.getSelected.Get(0).SetName(\"Preview_GratGrid\")\nend\n\ntheGraphics.Invalidate\n\nFinishButton = MTD.FindByName(\"Finish\")\nFinishButton.SetHelp(\"Keep this preview and close the graticule and grid wizard\")\nFinishButton.SetLabel(\"Finish\")\nNextButton = MTD.FindByName( \"Next\")\nNextButton.SetLabel(\"Remove\")\nNextButton.SetHelp(\"Remove this preview of the graticule or grid and continue working in the wizard\")\nNextButton.SetEnabled(true)\nBackButton = MTD.FindByName(\"Back\")\nBackButton.SetEnabled(false)\n\n" ) (Script.131 Name: "GratGrids.LayoutGraticule Default Intervals" SourceCode: "MTD = av.FindDialog(\"Grat Grids Layout Grids and Graticules\")\ntheGraphic = Self.Get(0)\nif (TheGraphic.Is(String)) then\n theView = av.GetProject.FindDoc(theGraphic)\n xyRect = Self.Get(1)\nelse\n ViewFrames = MTD.FindByName(\"viewFrames\")\n theLayout = av.GetActiveDoc\n if ( Not (theLayout.is(Layout))) then\n Msgbox.Info(\"Please make your layout active again.\",\"Oops\")\n return nil\n end\n theView = theGraphic.GetView\n theGraphics = theLayout.GetGraphics\n xyRect = theGraphic.GetMapDisplay.ReturnExtent\n end\n\nthisPrj = theView.GetProjection\nxyOrigin = xyrect.ReturnOrigin\nxySize = xyrect.ReturnSize\nminLength = xySize.GetX Min xySize.GetY\nxyIntervals = {20000000,10000000,5000000,2000000,1000000,500000,200000,100000,50000,20000,10000,5000,2000,1000,500,200,100,50,20,10,5,2,1 }\nrawInterval = minLength / 4 ' 4 is the default number of lines\ntheInterval = xyIntervals.Get( xyIntervals.Count - 1 )\nfor each val in xyIntervals\n if (rawInterval >= val) then\n theInterval = val\n break\n end\nend\ntheInt = theInterval.SetFormat(\"d\")\nMTD.FindByName(\"GridInt\").SetText(theInt.AsString)\n\nxMin = xyOrigin.GetX\nyMin = xyOrigin.GetY\nxMax = xMin + xySize.GetX\nyMax = yMin + xySize.GetY\npoint1= Point.Make(xMin,yMin)\npoint2= Point.Make(xMax,yMin)\npoint3= Point.Make(xMax,yMax)\npoint4= Point.Make(xMin,yMax)\npoint5= Point.Make((xMin+(xMax-xMin)/2),yMin)\npoint6= Point.Make(xMax,(yMin+(yMax-yMin)/2))\npoint7= Point.Make((xMin+(xMax-xMin)/2),yMax)\npoint8= Point.Make(xMin,(yMin+(yMax-yMin)/2))\na = thisPrj.UnProjectPt(point1)\nb = thisPrj.UnProjectPt(point2)\nc = thisPrj.UnProjectPt(point3)\nd = thisPrj.UnProjectPt(point4)\ne = thisPrj.UnProjectPt(point5)\nf = thisPrj.UnProjectPt(point6)\ng = thisPrj.UnProjectPt(point7)\nh = thisPrj.UnProjectPt(point8)\n\nif (((d) and (h) and (a)) and (a <> false)) then\n minlon= (Point1.GetX)Min(Point4.GetX)Min(Point8.GetX)Max(-180)\nelse\n minlon = -180\nend\nif (((a) and (b) and (e)) and (a <> false)) then\n minlat= (Point1.GetY)Min(Point2.GetY)Min(Point5.GetY)Max(-90)\nelse\n minlat = -90\nend\nif (((b) and (c) and (f)) and (b <> false)) then\n maxlon= (Point2.GetX)Max(Point3.GetX)Max(Point6.GetX)Min(180)\nelse\n maxlon = 180\nend\nif (((c) and (d) and (g)) and (c <> false)) then\n maxlat= (Point3.GetY)Max(Point4.GetY)Max(Point7.GetY)Min(90)\nelse\n maxlat = 90\nend\nminlon = minlon.SetFormat(\"d\")\nminlat = minlat.SetFormat(\"d\")\nmaxlon = maxlon.SetFormat(\"d\")\nmaxlat = maxlat.SetFormat(\"d\")\n\n\nminLength = (maxlon-minlon) Min (maxlat-minlat)\nllIntervals = {60,30,20,10,5,2,1,0.5,0.3333333333,0.25,0.1666666666,0.083333 33333,0.03333333333,0.01666666666 }\nrawInterval = minLength / 3\ntheInterval = llIntervals.Get( llIntervals.Count - 1 )\nfor each val in llIntervals\n if (rawInterval >= val) then\n theInterval = val\n break\n end\nend\ndegr = theInterval.Abs.Truncate\nt = ( theInterval.Abs - degr ) * 60\nminu = t.Truncate\nsec = (t-minu) * 60\nsec = sec.Truncate\n\nSecList = {sec.AsString}\nminList = {minu.AsString}\ndegList = {degr.AsString}\nfor each x in 0..60\n SecList.Add(x.AsString)\n minList.Add(x.AsString)\n degLis t.Add(x.AsString)\nend\n\nDegrees = MTD.FindByName(\"Degrees\")\nMinutes = MTD.FindByName(\"Minutes\")\nSeconds = MTD.FindByName(\"Seconds\")\nDegrees.DefineFromList(degList)\nMinutes.DefineFromList(minList)\nSeconds.DefineFromList(secList)\nDegrees.SetCurrentValue(degList.Get(0))\nMinutes.SetCurrentValue(minList.Get(0))\nSeconds.SetCurrentValue(secList.Get(0))\nlongdeg = MTD.FindByName(\"longdeg\")\nlongmin = MTD.FindByName(\"longmin\")\nlongsec = MTD.FindByName(\"longsec\")\nlongdeg.DefineFromList(degList.DeepClone)\nlongmin.DefineF romList(minList.DeepClone)\nlongsec.DefineFromList(secList.DeepClone)\nlongdeg.SetCurrentValue(degList.Get(0))\nlongmin.SetCurrentValue(minList.Get(0))\nlongsec.SetCurrentValue(secList.Get(0))\n\n" ) (Script.132 Name: "GratGrids.LayoutGraticule Font Changed" SourceCode: "MTD = av.FindDialog(\"Grat Grids Layout Grids and Graticules\")\n \nOptionPanel = MTD.FindByName(\"OptionPanel\")\nGratPanel = MTD.FindByName(\"GratOptions\")\nGridPanel = MTD.FindByName(\"gridpanel\")\nBorderPanel = MTD.FindByName(\"graphicoptions\")\nGratLabFont = MTD.FindByName(\"GratLabFont\")\nGridLabFont = MTD.FindByName(\"GridLabFont\")\nGridLabelStyle = MTD.FindByName(\"GridLabelStyle\")\nGratLabelStyle = MTD.FindByName(\"GratLabelStyle\")\n\nfontName = nil\n\nif (GratPanel.IsEnabled) then\n fontName = GratLabFont.GetSelection\nen d\nif (GridPanel.IsEnabled) then\n fontName = GridLabFont.GetSelection\nend\n\nif (fontName <> nil) then\n Styles = FontManager.The.ReturnStyles(fontName)\n \n if (GratPanel.IsEnabled) then\n GratLabelStyle.DefineFromList(Styles.DeepClone)\n end\n if (GridPanel.IsEnabled) then\n GridLabelStyle.DefineFromList(Styles.DeepClone)\n end\n\nend" ) (Script.133 Name: "GratGrids.LayoutGraticule Grat Display Option" SourceCode: "MTD = av.FindDialog(\"Grat Grids Layout Grids and Graticules\")\n\nGratLabFont = MTD.FindByName(\"GratLabFont\")\nGridLabFont = MTD.FindByName(\"GridLabFont\")\nLabelBorderColor = MTD.FindByName(\"LabelBorderColor\")\nMapBorderColor = MTD.FindByName(\"MapBorderColor\")\nGratAndLab = MTD.FindByName(\"GratandLab\")\nLabOnly = MTD.FindByName(\"LabOnly\")\nGratColor = MTD.FindByName(\"GratColor\")\nGratLineWt = MTD.FindByName(\"GratLineWt\")\n\nif (GratAndLab.IsSelected) then\n 'GratColor.SetEnabled(true)\n GratLineWt.SetEnabled(true)\nend\n if (LabOnly.IsSelected) then\n 'GratColor.SetEnabled(false)\n GratLineWt.SetEnabled(false)\nend" ) (Script.134 Name: "GratGrids.LayoutGraticule Open" SourceCode: "MTD = av.FindDialog(\"Grat Grids Layout Grids and Graticules\")\n\nCancelButton = MTD.FindByName(\"Cancel\")\nBackButton = MTD.FindByName(\"Back\")\nNextButton = MTD.FindByName(\"Next\")\nNextButton.SetLabel(\"Next >>\")\nNextButton.SetHelp(\"Shows the next panel of the graticule and grid wizard\")\nFinishButton = MTD.FindByName(\"Finish\")\nFinishButton.SetLabel(\"Preview\")\nFinishButton.SetHelp(\"Previews the graticule or grid using the current settings\")\nOptionPanel = MTD.FindByName(\"OptionPanel\")\nGratPanel = MTD.FindByName(\"Gra tOptions\")\nGridPanel = MTD.FindByName(\"gridpanel\")\nBorderPanel = MTD.FindByName(\"graphicoptions\")\nViewFrames = MTD.FindByName(\"viewFrames\")\nSelGrat = MTD.FindByName(\"SelectGrat\")\nSelGrid = MTD.FindByName(\"SelectGrid\")\nDegrees = MTD.FindByName(\"Degrees\")\nMinutes = MTD.FindByName(\"Minutes\")\nSeconds = MTD.FindByName(\"Seconds\")\nGratLabFont = MTD.FindByName(\"GratLabFont\")\nGridLabFont = MTD.FindByName(\"GridLabFont\")\nLabelBorderColor = MTD.FindByName(\"LabelBorderColor\")\nMapBorderColor = MTD.FindByName(\"MapBorderCo lor\")\nGridColor = MTD.FindByName(\"GridColor\")\nGratColor = MTD.FindByName(\"GratColor\")\nGratAndLab = MTD.FindByName(\"GratandLab\")\nLabOnly = MTD.FindByName(\"LabOnly\")\nGridLines = MTD.FindByName(\"GridLines\")\nGridTics = MTD.FindByName(\"GridTics\")\nGridLineWt = MTD.FindByName(\"GridLineWt\")\nGratLineWt = MTD.FindByName(\"GratLineWt\")\nMapBorderStyle = MTD.FindByName(\"MapBorderStyle\")\nLabelBorderStyle = MTD.FindByName(\"LabelBorderStyle\")\nGridLabelSize = MTD.FindByName(\"GridLabelSize\")\nGratLabelSize = MTD.FindByName(\"Gr atLabelSize\")\nGridLabelStyle = MTD.FindByName(\"GridLabelStyle\")\nGratLabelStyle = MTD.FindByName(\"GratLabelStyle\")\nLabelBorderOptions = MTD.FindByName(\"LabelBorderOptions\")\nMapBorderOptions = MTD.FindByName(\"MapBorderOptions\")\nBorderAroundMap = MTD.FindByName(\"BorderAroundMap\")\nBorderAroundLabels = MTD.FindByName(\"BorderAroundLabels\")\nWizImage = MTD.FindByName(\"WizImage\")\n\nIf (System.GetLook = #SYSTEM_LOOK_MSW) then\n ii = Icon.MakeFromResName(\"Icons.Graticule/Grid\")\nelse\n AnIconFile = \"$AVHOME/tools/bitmap s/gratwiz1.bmp\".AsFileName\n if (File.Exists(AnIconFile)) then\n ii = Icon.Make(AnIconFile)\n WizImage.SetIcon(ii)\n end\nend\n\nGratLabFont.DefineFromList(FontManager.The.ReturnFamilies)\nGridLabFont.DefineFromList(FontManager.The.ReturnFamilies)\nGratAndLab.Select\nGratLineWt.SetEnabled(true)\nGridTics.Select\n\nLineWeights1 = {\"0.1\",\"0.2\",\"0.25\",\"0.5\",\"0.75\",\"1.0\",\"1.25\",\"1.5\",\"2.0\",\"2.5\",\"3.0\"}\nLineWeights2 = {\"3.0\",\"2.5\",\"2.0\",\"1.5\",\"1.25\",\"1.0\",\"0.75\",\"0.5\",\"0.25\",\"0.2\",\"0.1\"}\nGridLineWt.DefineFromList(Lin eWeights1.DeepClone)\nGratLineWt.DefineFromList(LineWeights1.DeepClone)\n\ncolors = {\"Black\",\"Red\",\"Blue\",\"Dark Green\",\"White\",\"Dark Gray\"}\nLabelBorderColor.DefineFromList(colors.DeepClone)\nMapBorderColor.DefineFromList(colors.DeepClone)\nGridColor.DefineFromList(colors.DeepClone)\nGratColor.DefineFromList(colors.DeepClone)\n\nifn1 = \"$AVHOME/tools/bitmaps/solid.bmp\".AsFileName\nifn2 = \"$AVHOME/tools/bitmaps/double.bmp\".AsFileName\nifn3 = \"$AVHOME/tools/bitmaps/dtt.bmp\".AsFileName\nifn4 = \"$AVHOME/tools/bitmaps/tripl e.bmp\".AsFileName\nifn5 = \"$AVHOME/tools/bitmaps/ttt.bmp\".AsFileName\n\nif (File.Exists(ifn1)) then\n Icon1 = Icon.Make(ifn1)\n Icon2 = Icon.Make(ifn2)\n Icon3 = Icon.Make(ifn3)\n Icon4 = Icon.Make(ifn4)\n Icon5 = Icon.Make(ifn5)\n Icon1.SetName(\"Single\")\n Icon2.SetName(\"Double\")\n Icon3.SetName(\"DoubleThick\")\n Icon4.SetName(\"Triple\")\n Icon5.SetName(\"TripleThick\")\n lineStyles = {Icon1,Icon2,Icon3,Icon4,Icon5}\nend\nMapBorderStyle.DefineFromList(lineStyles.DeepClone)\nLabelBorderStyle.DefineFromList(lineStyles .DeepClone)\nMapBorderStyle.GoFirst\nLabelBorderStyle.GoFirst\nMapBorderStyle.SetVisible(false)\nMapBorderStyle.SetVisible(true)\nLabelBorderStyle.SetVisible(false)\nLabelBorderStyle.SetVisible(true)\n\nLabelSizes = {\"10\"}\nfor each h in 6..24\n LabelSizes.Add(h.AsString)\nend\nGridLabelSize.DefineFromList(LabelSizes.DeepClone)\nGratLabelSize.DefineFromList(LabelSizes.DeepClone)\n\nGratLabFont.Select\nGridLabFont.Select\n\nMapBorderStyle.SetEnabled(true)\nMapBorderColor.SetEnabled(true)\nMapBorderOptions.SetEnabled((BorderAro undMap.IsSelected))\n\nLabelBorderColor.SetEnabled(false)\nLabelBorderStyle.SetEnabled(false)\nBorderAroundLabels.SetSelected(false)\nLabelBorderOptions.SetEnabled(false)\n\nVert = 9\nHorz = 187\n\nFinishButton.SetEnabled(true)\nBackButton.SetEnabled(false)\nCancelButton.SetEnabled(true)\nNextButton.SetEnabled(true)\n\nOptionPanel.MoveTo(Horz,Vert)\nOptionPanel.SetEnabled(true)\nGratPanel.MoveTo(300,800)\nGridPanel.MoveTo(700,800)\nBorderPanel.MoveTo(1100,800)\n\nif (SelGrat.IsEnabled) then\n SelGrat.SetSelected(true)\nend\nSelGr id.SetSelected(true)\n\nGratPanel.SetEnabled(false)\nGridPanel.SetEnabled(false)\nBorderpanel.SetEnabled(false)" ) (Script.135 Name: "GratGrids.Help" SourceCode: "av.Help.SetAVFile\nav.Help.ShowTopic(\"Layout_Graticule_and_Grid\")" ) (Script.136 Name: "GratGrids.LayoutGraticule Select Option" SourceCode: "MTD = av.FindDialog(\"Grat Grids Layout Grids and Graticules\")\n\nCancelButton = MTD.FindByName(\"Cancel\")\nBackButton = MTD.FindByName(\"Back\")\nNextButton = MTD.FindByName(\"Next\")\nFinishButton = MTD.FindByName(\"Finish\")\nOptionPanel = MTD.FindByName(\"OptionPanel\")\nGratPanel = MTD.FindByName(\"GratOptions\")\nGridPanel = MTD.FindByName(\"gridpanel\")\nBorderPanel = MTD.FindByName(\"graphicoptions\")\nViewFrames = MTD.FindByName(\"viewFrames\")\nSelGrat = MTD.FindByName(\"SelectGrat\")\nSelGrid = MTD.FindByName(\"SelectGrid\")\n\nif ((SelGrat.IsSelected) or (SelGrid.IsSelected)) then\n if (NextButton.GetLabel = \"Next >>\") then\n NextButton.SetEnabled(true)\n FinishButton.SetEnabled(true)\n end\nelse\n if (NextButton.GetLabel = \"Next >>\") then\n NextButton.SetEnabled(false)\n FinishButton.SetEnabled(false)\n end\nend" ) (Script.137 Name: "GratGrids.LayoutGraticule Show" SourceCode: "MTD = av.FindDialog(\"Grat Grids Layout Grids and Graticules\")\n\nif (av.GetActiveDoc.Is(View)) then\n brect = av.GetActiveDoc.ReturnUserRect\n if (brect = nil) then\n return nil\n end\n te = Extension.Find(\"Cartographic Tools\")\n if (te.GetPreferences.Get(\"ViewGratRect\") = nil) then\n te.GetPreferences.Add(\"ViewGratRect\",brect)\n else\n te.GetPreferences.Set(\"ViewGratRect\",brect) \n end\n MTD.FindByName(\"aTextLabel39\").SetEnabled(false)\n MTD.FindByName(\"viewFrames\").SetEnabled(false)\n MTD.FindByName( \"aTextLabel39\").SetVisible(false)\n MTD.FindByName(\"viewFrames\").SetVisible(false)\n theView = av.GetActiveDoc \n av.Run(\"GratGrids.LayoutGraticule Default Intervals\",{theView.GetName,brect})\nelse\n MTD.FindByName(\"aTextLabel39\").SetEnabled(true)\n MTD.FindByName(\"viewFrames\").SetEnabled(true)\n MTD.FindByName(\"aTextLabel39\").SetVisible(true)\n MTD.FindByName(\"viewFrames\").SetVisible(true)\n ViewFrames = MTD.FindByName(\"viewFrames\")\n theLayout = av.GetActiveDoc\n theGraphics = theLayout.GetGraphics\n vf s = av.GetActiveDoc.GetGraphics.FindAllByClass(ViewFrame)\n vfl = {}\n vfx = {}\n IsProjData = false\n RThese = {}\n for each vv in 0..(vfs.Count - 1)\n if (vfs.Get(vv).GetFillObject = nil) then\n RThese.Insert(vv)\n else\n vfl.Add(vfs.Get(vv).GetFillObject.GetName)\n vfx.Add(vfs.Get(vv).GetFillObject)\n end\n end\n for each rr in RThese\n vfs.Remove(rr)\n end\n theView = vfs.Get(0).GetFillObject\n thisPrj = theView.GetProjection\n if (thisPrj.IsNull) then\n for each t in theView.GetTh emes\n te = t.ReturnExtent.AsPolygon\n br = Rect.MakeXY(-181,-90,181,90).AsPolygon\n if (br.Contains(te).Not) then\n MTD.FindByName(\"SelectGrat\").SetSelected(false)\n MTD.FindByName(\"SelectGrat\").SetEnabled(false)\n break\n end\n end\n end\n if (vfl.Count = 0) then\n MsgBox.Info(\"Your ViewFrames do not reference any view documents.\",\"Cannot Create Graticule or Grid\")\n return nil\n end\n ViewFrames.DefineFromList(vfl)\n av.Run(\"GratGrids.LayoutGraticule Default Interv als\",{(vfs.Get(0).GetFillObject.GetName),(vfs.Get(0).GetFillObject.GetDisplay.ReturnVisExtent.clone)})\n\nend\n\nMTD.Open\n\n" ) (Script.138 Name: "GratGrids.LayoutGraticule Update" SourceCode: "theLayout = av.GetActiveDoc\nif (theLayout.Is(Layout)) then\n theGraphics = theLayout.GetGraphics\n vfs = av.GetActiveDoc.GetGraphics.FindAllByClass(ViewFrame)\n vfl = {}\n Enabled = true\n if (vfs.Is(List)) then\n for each vf in vfs\n if (vf.GetFillObject <> nil) then\n vfl.Add(vf.GetFillObject.GetName)\n end\n end\n if (vfl.Count = 0)then\n Enabled = false\n end\n else\n Enabled = false\n end\nelse\n Msgbox.Info(\"Please make your layout active again.\",\"Oops\")\n return nil\nend\nS elf.SetEnabled(Enabled)" ) (Script.139 Name: "GratGrids.LayoutGraticule Close" SourceCode: "if (av.GetProject.IsClosing) then\n return nil\nend\n\nMTD = av.FindDialog(\"Grat Grids Layout Grids and Graticules\")\ntheLayout = av.GetActiveDoc\nif ( Not (theLayout.is(Layout))) then\n Msgbox.Info(\"Your Graticule preview was not removed because your layout was not the active document.\",\"Oops\")\n return nil\nend\ntheGraphics = theLayout.GetGraphics\ntests = theGraphics.FindAllByName(\"Preview_GratGrid\")\nif (tests <> nil) then\n for each gsgx in tests\n theGraphics.RemoveGraphic(gsgx)\n end\nend\n" ) (Script.140 Name: "GratGrids.LayoutGraticule Update Panels" SourceCode: "MTD = av.FindDialog(\"Grat Grids Layout Grids and Graticules\")\ntheLayout = av.GetActiveDoc\nif ( Not (theLayout.is(Layout))) then\n Msgbox.Info(\"Please make your layout active again.\",\"Oops\")\n return nil\nend\n\nCancelButton = MTD.FindByName(\"Cancel\")\nBackButton = MTD.FindByName(\"Back\")\nNextButton = MTD.FindByName(\"Next\")\nFinishButton = MTD.FindByName(\"Finish\")\nOptionPanel = MTD.FindByName(\"OptionPanel\")\nGratPanel = MTD.FindByName(\"GratOptions\")\nGridPanel = MTD.FindByName(\"gridpanel\")\nBorderPanel = MTD.FindBy Name(\"graphicoptions\")\nSelGrat = MTD.FindByName(\"SelectGrat\")\nSelGrid = MTD.FindByName(\"SelectGrid\")\nMapBorderStyle = MTD.FindByName(\"MapBorderStyle\")\nLabelBorderStyle = MTD.FindByName(\"LabelBorderStyle\")\n\nVert = 9\nHorz = 187\n\npanels = {OptionPanel}\nif (SelGrat.IsSelected) then\n panels.Add(GratPanel)\nend\nif (SelGrid.IsSelected) then\n panels.Add(GridPanel)\nend\npanels.Add(BorderPanel)\n\npCount = 0\npIdx = 0\nfor each p in panels\n if (p.IsEnabled) then\n pIdx = pCount\n end\n pCount = pCount + 1\nend \ntheGrap hics = theLayout.GetGraphics\nif (self.Getname = \"Cancel\") then\n tests = theGraphics.FindAllByName(\"Preview_GratGrid\")\n if (tests <> nil) then\n for each gsgx in tests\n theGraphics.RemoveGraphic(gsgx)\n end\n end\n MTD.Close\n return nil\nend\n\n\nif (((Self.GetName = \"Next\") and (Self.GetLabel = \"Remove\")) or ((Self.GetName = \"Cancel\") and (NextButton.GetLabel = \"Remove\")))then\n NextButton.SetLabel(\"Next >>\")\n NextButton.SetHelp(\"Shows the next panel of the graticule and grid wizard\")\n tg = av.Get ActiveDoc.GetGraphics.FindAllByName(\"Preview_GratGrid\")\n if (tg <> nil) then 'cos somebody might hit delete\n for each gsgx in tg\n theGraphics.RemoveGraphic(gsgx)\n end\n if (Self.GetName = \"Cancel\") then\n MTD.Close\n end\n end\n FinishButton.SetLabel(\"Preview\")\n FinishButton.SetHelp(\"Previews the graticule or grid using the current settings\")\n if (BorderPanel.IsEnabled) then\n NextButton.SetEnabled(false)\n BackButton.SetEnabled(true)\n else\n NextButton.SetEnabled(true)\n if ( OptionPanel.IsEnabled) then\n BackButton.SetEnabled(false)\n else\n BackButton.SetEnabled(true)\n end\n end\n return nil\nend\n\nif (av.GetActiveDoc.Is(Layout)) then\n if (OptionPanel.IsEnabled) then\n vfrN = MTD.FindByName(\"viewFrames\").GetSelection\n theVfs = theLayout.GetGraphics.FindAllByClass(ViewFrame)\n for each vf in theVfs\n theView = vf.GetFillObject\n if (theView = nil) then\n continue\n end\n vfrN = vf.GetFillObject.GetName\n vN = vf\n end\n av.Run(\"G ratGrids.LayoutGraticule Default Intervals\",{vN,nil})\n end\nend\n\npanels.Get(pIdx).Move(800,1300)\npanels.Get(PIdx).SetEnabled(False)\n\nif (Self.GetName = \"Next\") then\n pIdx = pIdx + 1\nelseif (Self.Getname = \"Back\") then\n pIdx = pIdx - 1\nelse\n MTD.Close\nend\n\nif (pIdx = 0) then\n BackButton.SetEnabled(false)\n NextButton.SetEnabled(true)\nelse\n BackButton.SetEnabled(true)\nend\nif (pIdx = (panels.Count -1)) then\n NextButton.SetEnabled(false)\n FinishButton.SetEnabled(true)\nelse\n NextButton.SetEnabled(true) \nend\n\npanels.Get(pIdx).MoveTo(Horz,Vert)\npanels.Get(pIdx).SetEnabled(true)\n\n" ) (Script.141 Name: "GratGrids.CanUnload" SourceCode: "return (true)" ) (Script.142 Name: "GratGrids.Unload" SourceCode: "Dialog.DetachFromExtension(self)" ) (Script.143 Name: "GratGrids.Install" SourceCode: "if (av.getproject=nil) then return nil end\n\nif(Self.GetPreferences.Get(\"Loaded\") = true) then\n return nil\nend\n\ntheLayoutGUI = av.GetProject.FindGUI(\"Layout\")\nif (theLayoutGUI = nil) then\n listOfLayoutGUIs = av.GetProject.FindGUIsFor(Layout)\n LayoutGUIs2Use = Msgbox.MultiList(listOfLayoutGUIs,\"Choose one or more View document types to add Internet extension interface components to:\",\"Extension Loading\")\nelse\n LayoutGUIs2Use = {theLayoutGUI}\nend\n\nfor each LayoutDocGUI in LayoutGUIs2Use\n Bidx = LayoutDocG UI.GetButtonBar.GetControls.Count - 1\n LayoutDocGUI.GetButtonBar.Add(Self.Get(0).Clone, Bidx)\n LayoutDocGUI.SetModified(true)\n dd = LayoutDocGUI.GetMenuBar.FindByName(\"Layout\")\n if (dd <> nil) then\n si = dd.GetControls.Count \n dd.Add(((Self.Get(1)).Clone),si)\n end\nend\n\nif (LayoutGUIs2Use.Count > 0) then\n Self.GetPreferences.Set(\"Loaded\",true)\n Self.GetPreferences.Set(\"Version\",(3.1))\n av.getproject.setmodified(true)\nend\n\n" ) (Script.144 Name: "GratGrids.Uninstall" SourceCode: "if (av.GetProject = nil) then\n return nil\nend\n\nif (av.GetProject.IsClosing) then\n return nil\nend\n\nlistOfLayoutGUIs = av.GetProject.FindGUIsFor(Layout)\n\nfor each aDocGUI in (listOfLayoutGUIs)\n c1 = aDocGUI.GetButtonBar.FindByScript(\"GratGrids.LayoutGraticule Show\")\n if (c1 <> nil) then\n aDocGUI.GetButtonBar.Remove(c1)\n end\n c2 = aDocGUI.GetMenuBar.FindByScript(\"GratGrids.LayoutGraticule Show\")\n if (c2 <> nil) then\n aDocGUI.GetMenuBar.FindByName(\"Layout\").Remove(c2)\n end\nend\n\nav.getproject.setmo dified(true)\n\n" )