/3.2 (Extension.1 Name: "XTools 6/1/01" FirstRootClassName: "List" Roots: 2 Roots: 3 Roots: 19 Roots: 328 Roots: 329 Roots: 330 Roots: 331 Roots: 332 Roots: 333 Roots: 334 Roots: 335 Roots: 336 Roots: 337 Roots: 338 Roots: 339 Roots: 340 Roots: 341 Roots: 342 Roots: 343 Roots: 344 Roots: 345 Roots: 346 Roots: 347 Roots: 348 Roots: 349 Roots: 350 Roots: 351 Roots: 352 Roots: 353 Roots: 354 Roots: 355 Roots: 356 Roots: 357 Roots: 358 Roots: 359 Roots: 360 Roots: 361 Roots: 362 Roots: 363 Roots: 364 Roots: 365 Roots: 366 Roots: 367 Roots: 368 Roots: 369 Roots: 370 Roots: 371 Roots: 372 Roots: 373 Roots: 374 Roots: 375 Roots: 376 Roots: 377 Roots: 378 Roots: 379 Roots: 380 Roots: 381 Roots: 382 Roots: 383 Roots: 384 Roots: 385 Roots: 386 Roots: 387 Roots: 388 Roots: 389 Roots: 390 Roots: 391 Roots: 392 Roots: 406 Roots: 469 Roots: 485 Version: 32 About: "This extension contains useful tools developed, modified, or collected by ODF.\n\nThis XTools Version Created: Fri Jun 01 12:00:16 2001" UnloadScript: 565 InstallScript: 566 UninstallScript: 567 ExtVersion: 3 ) (List.2 ) (List.3 Child: 4 Child: 11 ) (List.4 Child: 5 Child: 9 Child: 10 ) (List.5 Child: 6 Child: 7 Child: 8 ) (AVStr.6 S: "View" ) (AVStr.7 S: "ButtonBar" ) (AVStr.8 S: "aanSpace.XTools1" ) (Space.9 ) (Numb.10 N: 24.00000000000000 ) (List.11 Child: 12 Child: 16 Child: 18 ) (List.12 Child: 13 Child: 14 Child: 15 ) (AVStr.13 S: "View" ) (AVStr.14 S: "ButtonBar" ) (AVStr.15 S: "XTDisplaySelected.Open" ) (Butn.16 Help: "Display Selected Shapes Info.//Display the number and amount (acres for polygons, length for lines) of selected shapes in each ftheme that has selected features. Press \"Shift and click this button for instructions." HelpTopic: " " Tag: "Xtools1234" Icon: 17 Click: "XTDisplaySelected.Open" ) (AVIcon.17 Name: "Summarize" Res: "Icons.Summarize" ) (Numb.18 N: 25.00000000000000 ) (List.19 Child: 20 Child: 27 Child: 34 Child: 41 Child: 48 Child: 55 Child: 62 Child: 69 Child: 76 Child: 83 Child: 90 Child: 97 Child: 104 Child: 111 Child: 118 Child: 125 Child: 132 Child: 139 Child: 146 Child: 153 Child: 160 Child: 167 Child: 174 Child: 181 Child: 188 Child: 195 Child: 202 Child: 209 Child: 216 Child: 223 Child: 230 Child: 237 Child: 244 Child: 251 Child: 258 Child: 265 Child: 272 Child: 279 Child: 286 Child: 293 Child: 300 Child: 307 Child: 314 Child: 321 ) (List.20 Child: 21 Child: 25 Child: 26 ) (List.21 Child: 22 Child: 23 Child: 24 ) (AVStr.22 S: "Project" ) (AVStr.23 S: "&XTools" ) (AVStr.24 S: "XTdefaults.Open" ) (Choice.25 Help: "View or change the XTools defaults for language version, data map units, View map units, View distance units, output area units, and View projection." Label: "View/Change XTools Defaults" Click: "XTdefaults.Open" Shortcut: "Keys.None" ) (Numb.26 ) (List.27 Child: 28 Child: 32 Child: 33 ) (List.28 Child: 29 Child: 30 Child: 31 ) (AVStr.29 S: "Project" ) (AVStr.30 S: "&XTools" ) (AVStr.31 S: "aanSpace.XTools1" ) (Space.32 ) (Numb.33 N: 1.00000000000000 ) (List.34 Child: 35 Child: 39 Child: 40 ) (List.35 Child: 36 Child: 37 Child: 38 ) (AVStr.36 S: "Project" ) (AVStr.37 S: "&XTools" ) (AVStr.38 S: "aanProject.SeeEnvironmentPaths" ) (Choice.39 Help: "See Environment Paths//See Environment Paths" Label: "See Environment Paths" Click: "aanProject.SeeEnvironmentPaths" Shortcut: "Keys.None" ) (Numb.40 N: 3.00000000000000 ) (List.41 Child: 42 Child: 46 Child: 47 ) (List.42 Child: 43 Child: 44 Child: 45 ) (AVStr.43 S: "Project" ) (AVStr.44 S: "&XTools" ) (AVStr.45 S: "aanProject.AboutXTools" ) (Choice.46 Help: "Displays a description of XTools" Label: "About XTools ..." Click: "aanProject.AboutXTools" Shortcut: "Keys.None" ) (Numb.47 N: 2.00000000000000 ) (List.48 Child: 49 Child: 53 Child: 54 ) (List.49 Child: 50 Child: 51 Child: 52 ) (AVStr.50 S: "View" ) (AVStr.51 S: "&XTools" ) (AVStr.52 S: "XTdefaults.Open" ) (Choice.53 Help: "View or change the XTools defaults for language version, data map units, View map units, View distance units, output area units, and View projection." Label: "View/Change XTools Defaults" Click: "XTdefaults.Open" Shortcut: "Keys.None" ) (Numb.54 ) (List.55 Child: 56 Child: 60 Child: 61 ) (List.56 Child: 57 Child: 58 Child: 59 ) (AVStr.57 S: "View" ) (AVStr.58 S: "&XTools" ) (AVStr.59 S: "aanSpace.XTools1" ) (Space.60 ) (Numb.61 N: 1.00000000000000 ) (List.62 Child: 63 Child: 67 Child: 68 ) (List.63 Child: 64 Child: 65 Child: 66 ) (AVStr.64 S: "View" ) (AVStr.65 S: "&XTools" ) (AVStr.66 S: "XTBatchWiz.Buttons" ) (Choice.67 Help: "Run a batch file containing XTools Overlay commands: Clip, Erase, Identity, Intersect, Union, or Update. Press \"Shift\" and click this menu item for instructions." Label: "XTools Batch Overlay" Click: "XTBatchWiz.Buttons" Shortcut: "Keys.None" ) (Numb.68 N: 2.00000000000000 ) (List.69 Child: 70 Child: 74 Child: 75 ) (List.70 Child: 71 Child: 72 Child: 73 ) (AVStr.71 S: "View" ) (AVStr.72 S: "&XTools" ) (AVStr.73 S: "aanView.XToolsLogFile" ) (Choice.74 Help: "View the log file for most XTools operations." Label: "View XTools Log File" Click: "aanView.XToolsLogFile" Shortcut: "Keys.None" ) (Numb.75 N: 3.00000000000000 ) (List.76 Child: 77 Child: 81 Child: 82 ) (List.77 Child: 78 Child: 79 Child: 80 ) (AVStr.78 S: "View" ) (AVStr.79 S: "&XTools" ) (AVStr.80 S: "aanSpace.XTools2" ) (Space.81 ) (Numb.82 N: 4.00000000000000 ) (List.83 Child: 84 Child: 88 Child: 89 ) (List.84 Child: 85 Child: 86 Child: 87 ) (AVStr.85 S: "View" ) (AVStr.86 S: "&XTools" ) (AVStr.87 S: "aanView.ClipWithPolygons" ) (Choice.88 Help: "Clip With Polygon(s)//Clips a point, multipoint, polyline or polygon theme with selected polygons from a polygon theme. Press \"Shift and click this menu item for instructions." Label: "Clip With Polygon(s)" Click: "aanView.ClipWithPolygons" Shortcut: "Keys.None" ) (Numb.89 N: 5.00000000000000 ) (List.90 Child: 91 Child: 95 Child: 96 ) (List.91 Child: 92 Child: 93 Child: 94 ) (AVStr.92 S: "View" ) (AVStr.93 S: "&XTools" ) (AVStr.94 S: "aanView.EraseFeatures" ) (Choice.95 Help: "Erase Features//Erases point, multipoint, polyline, or polygon features using selected polygons from an erase theme. Press \"Shift\" and click this menu item for instructions." Label: "Erase Features" Click: "aanView.EraseFeatures" Shortcut: "Keys.None" ) (Numb.96 N: 6.00000000000000 ) (List.97 Child: 98 Child: 102 Child: 103 ) (List.98 Child: 99 Child: 100 Child: 101 ) (AVStr.99 S: "View" ) (AVStr.100 S: "&XTools" ) (AVStr.101 S: "aanView.IdentityTheme" ) (Choice.102 Help: "Perform an \"Identity\" overlay operation.//Performs an \"Identity\" overlay operation. Press \"Shift\" and click this menu item for description and instructions." Label: "Identity" Click: "aanView.IdentityTheme" Shortcut: "Keys.None" ) (Numb.103 N: 7.00000000000000 ) (List.104 Child: 105 Child: 109 Child: 110 ) (List.105 Child: 106 Child: 107 Child: 108 ) (AVStr.106 S: "View" ) (AVStr.107 S: "&XTools" ) (AVStr.108 S: "aanView.IntersectThemes" ) (Choice.109 Help: "Intersect Themes//Intersect a point, multipoint, polyline, or polygon theme with selected polygons from a polygon theme. Press \"Shift\" and click this menu item for instructions.." Label: "Intersect Themes" Click: "aanView.IntersectThemes" Shortcut: "Keys.None" ) (Numb.110 N: 8.00000000000000 ) (List.111 Child: 112 Child: 116 Child: 117 ) (List.112 Child: 113 Child: 114 Child: 115 ) (AVStr.113 S: "View" ) (AVStr.114 S: "&XTools" ) (AVStr.115 S: "aanView.MergeThemes" ) (Choice.116 Help: "Merge Themes//Merges two or more feature themes with the same feature type. Requires at least two feature themes with the same feature type. Press \"Shift\" and click this menu item for instructions." Label: "Merge Themes" Click: "aanView.MergeThemes" Shortcut: "Keys.None" ) (Numb.117 N: 9.00000000000000 ) (List.118 Child: 119 Child: 123 Child: 124 ) (List.119 Child: 120 Child: 121 Child: 122 ) (AVStr.120 S: "View" ) (AVStr.121 S: "&XTools" ) (AVStr.122 S: "aanView.UnionPolygonThemes" ) (Choice.123 Help: "Union two polygon themes. Press \"Shift\" and click this menu item for a description and instructions." HelpTopic: " " Label: "Union Polygon Themes" Click: "aanView.UnionPolygonThemes" Shortcut: "Keys.None" ) (Numb.124 N: 10.00000000000000 ) (List.125 Child: 126 Child: 130 Child: 131 ) (List.126 Child: 127 Child: 128 Child: 129 ) (AVStr.127 S: "View" ) (AVStr.128 S: "&XTools" ) (AVStr.129 S: "aanView.UpdatePolygonTheme" ) (Choice.130 Help: "Update Polygon Theme//Update a polygon theme using polygons from another theme. Requires two polygon themes. Press \"Shift\" and click this menu item for instructions." Label: "Update Polygon Theme" Click: "aanView.UpdatePolygonTheme" Shortcut: "Keys.None" ) (Numb.131 N: 11.00000000000000 ) (List.132 Child: 133 Child: 137 Child: 138 ) (List.133 Child: 134 Child: 135 Child: 136 ) (AVStr.134 S: "View" ) (AVStr.135 S: "&XTools" ) (AVStr.136 S: "aanSpace.XTools3" ) (Space.137 ) (Numb.138 N: 12.00000000000000 ) (List.139 Child: 140 Child: 144 Child: 145 ) (List.140 Child: 141 Child: 142 Child: 143 ) (AVStr.141 S: "View" ) (AVStr.142 S: "&XTools" ) (AVStr.143 S: "aanView.CalcSize" ) (Choice.144 Help: "Update Feature Size Values//Uses the XTools defaults specs to update the size of features (area, perimeter, length, and acres and/or hectares), as appropriate. Press \"Shift\" and click this menu item for instructions." Label: "Calculate Area, Perimeter , Length , Acres, Hectares" Click: "aanView.CalcSize" Shortcut: "Keys.None" ) (Numb.145 N: 13.00000000000000 ) (List.146 Child: 147 Child: 151 Child: 152 ) (List.147 Child: 148 Child: 149 Child: 150 ) (AVStr.148 S: "View" ) (AVStr.149 S: "&XTools" ) (AVStr.150 S: "aanView.XtoolsTransferSelectedFeatures" ) (Choice.151 Help: "Copies and pastes features between themes, with feature type conversion if necessary and possible. Press and hold the \"Shift\" key and click on this menu item for instructions." Label: "Transfer / Convert Selected Features" Click: "aanView.XtoolsTransferSelectedFeatures" Shortcut: "Keys.None" ) (Numb.152 N: 14.00000000000000 ) (List.153 Child: 154 Child: 158 Child: 159 ) (List.154 Child: 155 Child: 156 Child: 157 ) (AVStr.155 S: "View" ) (AVStr.156 S: "&XTools" ) (AVStr.157 S: "aanSpace.XTools4" ) (Space.158 ) (Numb.159 N: 15.00000000000000 ) (List.160 Child: 161 Child: 165 Child: 166 ) (List.161 Child: 162 Child: 163 Child: 164 ) (AVStr.162 S: "View" ) (AVStr.163 S: "&XTools" ) (AVStr.164 S: "aauView.BufferFeatures" ) (Choice.165 Help: "Buffer Selected Features//Creates a buffer around selected features, or all features if none selected. Requires at least one active theme. Press \"Shift\" and click this menu item for a description and instructions." Label: "Buffer Selected Features" Click: "aauView.BufferFeatures" Shortcut: "Keys.None" ) (Numb.166 N: 16.00000000000000 ) (List.167 Child: 168 Child: 172 Child: 173 ) (List.168 Child: 169 Child: 170 Child: 171 ) (AVStr.169 S: "View" ) (AVStr.170 S: "&XTools" ) (AVStr.171 S: "aanView.ConvertMultiPart2SinglePart" ) (Choice.172 Help: "Converts multipart shapes to single part shapes and places them in a new shapefile. Press and hold the \"Shift\" key and click this menu item for a description and instructions." Label: "Convert Multipart Shapes to Single Part" Click: "aanView.ConvertMultipart2SinglePart" Shortcut: "Keys.None" ) (Numb.173 N: 17.00000000000000 ) (List.174 Child: 175 Child: 179 Child: 180 ) (List.175 Child: 176 Child: 177 Child: 178 ) (AVStr.176 S: "View" ) (AVStr.177 S: "&XTools" ) (AVStr.178 S: "aanView.Polygon2Polyline" ) (Choice.179 Help: "Convert Polygons to Polylines//Converts selected polygons to polylines. Requires a polygon theme. Press \"Shift\" and click this menu item for instructions." Label: "Convert Polygons To PolyLines" Click: "aanView.Polygon2Polyline" Shortcut: "Keys.None" ) (Numb.180 N: 18.00000000000000 ) (List.181 Child: 182 Child: 186 Child: 187 ) (List.182 Child: 183 Child: 184 Child: 185 ) (AVStr.183 S: "View" ) (AVStr.184 S: "&XTools" ) (AVStr.185 S: "aanView.Polylines2Polygon" ) (Choice.186 Help: "Builds one polygon from the selected polylines in a theme. Press the \"Shift\" key and click on this menu item for instructions." Label: "Make One Polygon From Polylines" Click: "aanView.Polylines2Polygon" Shortcut: "Keys.None" ) (Numb.187 N: 19.00000000000000 ) (List.188 Child: 189 Child: 193 Child: 194 ) (List.189 Child: 190 Child: 191 Child: 192 ) (AVStr.190 S: "View" ) (AVStr.191 S: "&XTools" ) (AVStr.192 S: "aanView.Points2Polygon" ) (Choice.193 Help: "Builds one polygon from the selected points in a theme. Press the \"Shift\" key and click on this menu item for instructions." Label: "Make One Polygon From Points" Click: "aanView.Points2Polygon" Shortcut: "Keys.None" ) (Numb.194 N: 20.00000000000000 ) (List.195 Child: 196 Child: 200 Child: 201 ) (List.196 Child: 197 Child: 198 Child: 199 ) (AVStr.197 S: "View" ) (AVStr.198 S: "&XTools" ) (AVStr.199 S: "aanView.Points2Polyline" ) (Choice.200 Label: "Make One Polyline From Points" Click: "aanView.Points2PolyLine" Shortcut: "Keys.None" ) (Numb.201 N: 21.00000000000000 ) (List.202 Child: 203 Child: 207 Child: 208 ) (List.203 Child: 204 Child: 205 Child: 206 ) (AVStr.204 S: "View" ) (AVStr.205 S: "&XTools" ) (AVStr.206 S: "aanView.ShapeToGraphic" ) (Choice.207 Help: "Convert Shapes To Graphics//Convert selected shapes to graphics. Requires a feature theme with shapes. Press \"Shift\" and click this menu item for instructions." Label: "Convert Shapes to Graphics" Click: "aanView.ShapeToGraphic" Shortcut: "Keys.None" ) (Numb.208 N: 22.00000000000000 ) (List.209 Child: 210 Child: 214 Child: 215 ) (List.210 Child: 211 Child: 212 Child: 213 ) (AVStr.211 S: "View" ) (AVStr.212 S: "&XTools" ) (AVStr.213 S: "aanView.Graphic2Shape" ) (Choice.214 Help: "Convert Graphics to Shapes//Converts all of the graphics in the View of a specified feature type to shapes, and stores them in a shape file. Press and hold the \"Shift\" key and click this menu item for instructions." Label: "Convert Graphics To Shapes" Click: "aanView.Graphic2Shape" Shortcut: "Keys.None" ) (Numb.215 N: 23.00000000000000 ) (List.216 Child: 217 Child: 221 Child: 222 ) (List.217 Child: 218 Child: 219 Child: 220 ) (AVStr.218 S: "View" ) (AVStr.219 S: "&XTools" ) (AVStr.220 S: "aauView.Shape2Centroid" ) (Choice.221 Help: "Make a new point theme based on the center points (centroids) of the input theme features. Press and hold the \"Shift\" key and click on this menu item for instructions." Label: "Convert Shapes To Centroids" Click: "aauView.Shape2Centroid" Shortcut: "Keys.None" ) (Numb.222 N: 24.00000000000000 ) (List.223 Child: 224 Child: 228 Child: 229 ) (List.224 Child: 225 Child: 226 Child: 227 ) (AVStr.225 S: "View" ) (AVStr.226 S: "&XTools" ) (AVStr.227 S: "aanSpace.XTools5" ) (Space.228 ) (Numb.229 N: 25.00000000000000 ) (List.230 Child: 231 Child: 235 Child: 236 ) (List.231 Child: 232 Child: 233 Child: 234 ) (AVStr.232 S: "View" ) (AVStr.233 S: "&XTools" ) (AVStr.234 S: "aanView.BatchImporttoShape" ) (Choice.235 Help: "Batch Import Active Themes To Shapefiles//This script allows the user to batch import active themes to shapefiles. Requires at least one active theme in the View. Press \"Shift\" and click this menu item for instructions." Label: "Batch Import Themes To Shapefiles" Click: "aanView.BatchImportToShape" Shortcut: "Keys.None" ) (Numb.236 N: 26.00000000000000 ) (List.237 Child: 238 Child: 242 Child: 243 ) (List.238 Child: 239 Child: 240 Child: 241 ) (AVStr.239 S: "View" ) (AVStr.240 S: "&XTools" ) (AVStr.241 S: "aanSpace.XTools6" ) (Space.242 ) (Numb.243 N: 27.00000000000000 ) (List.244 Child: 245 Child: 249 Child: 250 ) (List.245 Child: 246 Child: 247 Child: 248 ) (AVStr.246 S: "View" ) (AVStr.247 S: "&XTools" ) (AVStr.248 S: "aanView.SourceManager" ) (Choice.249 Help: "Manage shapefiles using the ArcView Source Manager. Allows the user to copy, rename, or delete associated shapefile datasets as a group. No \"Shift Click\" instructions ." Label: "Manage Shapefiles" Click: "aanView.SourceManager" Shortcut: "Keys.None" ) (Numb.250 N: 28.00000000000000 ) (List.251 Child: 252 Child: 256 Child: 257 ) (List.252 Child: 253 Child: 254 Child: 255 ) (AVStr.253 S: "Table" ) (AVStr.254 S: "&XTools" ) (AVStr.255 S: "XTdefaults.Open" ) (Choice.256 Help: "View or change the XTools defaults for language version, data map units, View map units, View distance units, output area units, and View projection." Label: "View/Change XTools Defaults" Click: "XTdefaults.Open" Shortcut: "Keys.None" ) (Numb.257 ) (List.258 Child: 259 Child: 263 Child: 264 ) (List.259 Child: 260 Child: 261 Child: 262 ) (AVStr.260 S: "Table" ) (AVStr.261 S: "&XTools" ) (AVStr.262 S: "aanSpace.XTools1" ) (Space.263 ) (Numb.264 N: 1.00000000000000 ) (List.265 Child: 266 Child: 270 Child: 271 ) (List.266 Child: 267 Child: 268 Child: 269 ) (AVStr.267 S: "Table" ) (AVStr.268 S: "&XTools" ) (AVStr.269 S: "aasTable.FieldProperties" ) (Choice.270 Help: "Field Properties//Displays the properties of the selected field. Select a field by clicking on it's name in the table. No \"Shift\" click instructions are available at this time." Label: "Field Properties" Click: "aasTable.FieldProperties" Shortcut: "Keys.None" ) (Numb.271 N: 2.00000000000000 ) (List.272 Child: 273 Child: 277 Child: 278 ) (List.273 Child: 274 Child: 275 Child: 276 ) (AVStr.274 S: "Table" ) (AVStr.275 S: "&XTools" ) (AVStr.276 S: "aasTable.ReportInfo" ) (Choice.277 Help: "Table Structure//Provides a summary of the key properties of the fields in the table. No \"Shift\" click instructions available at this time." Label: "Table Structure Information" Click: "aasTable.ReportInfo" Shortcut: "Keys.None" ) (Numb.278 N: 3.00000000000000 ) (List.279 Child: 280 Child: 284 Child: 285 ) (List.280 Child: 281 Child: 282 Child: 283 ) (AVStr.281 S: "Table" ) (AVStr.282 S: "&XTools" ) (AVStr.283 S: "aanTable.Statistics" ) (Choice.284 Label: "Table Statistics" Click: "aanTable.Statistics" Shortcut: "Keys.None" ) (Numb.285 N: 4.00000000000000 ) (List.286 Child: 287 Child: 291 Child: 292 ) (List.287 Child: 288 Child: 289 Child: 290 ) (AVStr.288 S: "Table" ) (AVStr.289 S: "&XTools" ) (AVStr.290 S: "aanTable.MultiFieldSummarize" ) (Choice.291 Help: "Summarizes one field or a combination of fields in a table. Press and hold the \"Shift\" key and click on this menu item for instructions. " Label: "Summarize Multiple Fields" Click: "aanTable.MultiFieldSummarize" Shortcut: "Keys.None" ) (Numb.292 N: 5.00000000000000 ) (List.293 Child: 294 Child: 298 Child: 299 ) (List.294 Child: 295 Child: 296 Child: 297 ) (AVStr.295 S: "Table" ) (AVStr.296 S: "&XTools" ) (AVStr.297 S: "aanSpace.XTools2" ) (Space.298 ) (Numb.299 N: 6.00000000000000 ) (List.300 Child: 301 Child: 305 Child: 306 ) (List.301 Child: 302 Child: 303 Child: 304 ) (AVStr.302 S: "Table" ) (AVStr.303 S: "&XTools" ) (AVStr.304 S: "aanTable.MultiFieldDelete" ) (Choice.305 Help: "Delete Multiple Fields//This script allows the user to delete multiple fields in a table. Press \"Shift\" and click this button for instructions." Label: "Delete Multiple Fields" Click: "aanTable.MultiFieldDelete" Shortcut: "Keys.None" ) (Numb.306 N: 7.00000000000000 ) (List.307 Child: 308 Child: 312 Child: 313 ) (List.308 Child: 309 Child: 310 Child: 311 ) (AVStr.309 S: "Table" ) (AVStr.310 S: "&XTools" ) (AVStr.311 S: "aanTable.CalcSize" ) (Choice.312 Help: "Update Feature Size Values//Uses the XTools defaults specs to update the size of features (area, perimeter, length, and acres and/or hectares), as appropriate. " Label: "Calculate Area, Perimeter , Length , Acres, Hectares" Click: "aanTable.CalcSize" Shortcut: "Keys.None" ) (Numb.313 N: 8.00000000000000 ) (List.314 Child: 315 Child: 319 Child: 320 ) (List.315 Child: 316 Child: 317 Child: 318 ) (AVStr.316 S: "Table" ) (AVStr.317 S: "&XTools" ) (AVStr.318 S: "aanSpace.XTools3" ) (Space.319 ) (Numb.320 N: 9.00000000000000 ) (List.321 Child: 322 Child: 326 Child: 327 ) (List.322 Child: 323 Child: 324 Child: 325 ) (AVStr.323 S: "Table" ) (AVStr.324 S: "&XTools" ) (AVStr.325 S: "aanTable.Av2Excel" ) (Choice.326 Help: "Export Table to excel//Exports the current table to Excel. Selected records will be exported, or all records if none are selected. Press \"Shift\" and click this button for instructions." Label: "Export Table to Excel Spreadsheet" Click: "aanTable.Av2Excel" Shortcut: "Keys.None" ) (Numb.327 N: 10.00000000000000 ) (List.328 ) (List.329 ) (Script.330 Name: "Doc.Open" SourceCode: "' XTools specific code added 5/28/01 by Mike Delaune\n\nfor each d in av.GetProject.GetSelectedDocs\n d.GetWin.Open\n if(d.Is(View)) then\n theView = d\n\n ' GET THE XTOOLS DEFAULTS\n theDefScript = av.GetProject.FindScript( \"XTprojectDefaults\" )\n if(theDefScript <> nil) then\n DefList = theDefScript.AsString.AsList \n end\n \n msgstr = \"\"\n \n str1 = DefList.Get(1).lcase\n str2 = theView.GetUnits.AsString.Middle(13,20).Trim.lcase\n \n if(str1 <> str2) then\n av.ShowMsg(\"The Vie ws map units (\"+str2+\") are different from the Xtools default map units (\"+str1+\") .\")\n end\n end\nend" ) (Script.331 Name: "View.New" SourceCode: "' View.New (Last Modified by Mike DeLaune 5/8/2001)\n\nnewView = View.MakeWithGUI(av.GetProject.GetSelectedGUI.GetName)\nXTDefView = av.GetProject.FindDoc(\"XTDefView\")\nnewView.SetProjection(XTDefView.GetProjection)\nnewView.SetUnits(XTDefView.GetUnits)\nnewView.GetDisplay.SetDistanceUnits(XTDefView.GetDisplay.GetDistanceUnits)\n\n' GET THE XTOOLS DEFAULTS\ntheDefScript = av.GetProject.FindScript( \"XTprojectDefaults\" )\nif(theDefScript <> nil) then\n DefList = theDefScript.AsString.AsList\n theStr = DefList.Get(4) \n if (theStr = \"Both\") then\n theStr = theStr + \" Acres and Hectares\"\n end\n\n theCommentStr = \"XTOOLS DEFAULTS FOR THIS VIEW:\"+NL+\"Data Map Units set to \"+ DefList.Get(1) +\n \"; Output Map Units set to \"+ DefList.Get(2) +\"; \"+\n \"View Distance Units set to \"+ DefList.Get(3) +\"; \"+\n \"Area Output Units set to \" + theStr + \";\"+nl+\n \"Always convert output shapes to single part?: \"+ DefList.Get(5) +\";\"+nl+\n \"Always do Area and Length Calculations?: \"+ DefList.Get(6) +\";\"+nl\n \n if(newView.GetProj ection.GetName <> \"\") then\n theCommentStr = theCommentStr + \"View Projection set to \"+XTDefView.GetProjection.ReturnDescription+\".\"\n else\n theCommentStr = theCommentStr + \"VIEW PROJECTION NOT SET.\"\n end\n\n DoNotShowProperties = DefList.Get(7)\n\n newView.SetComments(theCommentStr)\n newView.GetWin.Open\n \n if(DoNotShowProperties = \"False\") then\n newView.edit\n end\n\n av.ShowMsg(\" View Properties Set To the XTools Defaults.\")\n \nend" ) (Script.332 Name: "View.CircleTool" SourceCode: "' View.CircleTool (Modified by Mike DeLaune)\n' If there are no themes open for editing, this tool creates graphic circles.\n' If there is a theme open for editing, this tool creates a circle polygon and adds it to the themes feature table.\n'\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\n\ntheView = av.GetActiveDoc\n\nc = theView.ReturnUserCircle\ntheTheme = theView.GetEditableTheme \n\nif (c.IsNull) then\n return nil\nelse\n if (theTheme <> nil) then\n theTheme.GetFTab.BeginTransaction\n p = c.AsPolygon\n thePrj = theView.GetProjection\n if (thePrj.IsNull.Not) then\n p = p.ReturnUnprojected(thePrj)\n end\n theField = theTheme.GetFTab.FindField(\"Shape\")\n rec = theTheme.GetFTab.AddRecord\n theTheme.GetFTab.SetValue(theField, rec, p)\n theTheme.GetFTab.GetSelection.ClearAll\n theTheme.GetFTab.GetSelection.Set(rec)\n theTheme.GetFTab.UpdateSelection\n theTheme.GetFTab.EndTransaction\n shp = p\n else\n gc = GraphicShape.Make(c)\n theView.GetGraphics.UnselectAll\n gc.SetSelected(TR UE)\n theView.GetGraphics.Add(gc)\n shp = gc.GetShape\n end\n av.GetProject.SetModified(true)\nend\n\n'\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\n' Added by Mike Delaune 10/23/97 Revised 4/14/2000\nReturnList = av.Run(\"aan.Sub-CalcSize\",{shp.AsPolygon})\nif(ReturnList.Get(0).IsNull = False) then\n theAcNum = ReturnList.Get(0).SetFormat(\"d.dd\")\n theHtNum = ReturnList.Get(1).SetFormat(\"d.dd\")\n Acres = av.run(\"aanView.NumComma\",theAcNum)\n Hectares = av.run(\"aanView.NumComma\",theHtNum)\n av.ShowMsg(\"Cir cle Size = \"+Acres+\" Acres and \"+Hectares+\" Hectares.\")\nend\n'\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"" ) (Script.333 Name: "View.PolyTool" SourceCode: "' View.PolyTool (Modified by Mike DeLaune)\n' If there are no themes open for editing, this tool creates graphic polygons.\n' If there is a theme open for editing, this tool creates a polygon and adds it to the themes feature table.\n'\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\n\n\ntheView = av.GetActiveDoc\n\np = theView.ReturnUserPolygon\ntheTheme = theView.GetEditableTheme\n\nif (p.IsNull) then\n return nil\nelse\n if (theTheme <> nil) then\n theTheme.GetFTab.BeginTransaction\n thePrj = theView.GetProje ction\n if (thePrj.IsNull.Not) then\n p = p.ReturnUnprojected(thePrj)\n end\n theField = theTheme.GetFTab.FindField(\"Shape\")\n rec = theTheme.GetFTab.AddRecord\n theTheme.GetFTab.SetValue(theField, rec, p)\n theTheme.GetFTab.GetSelection.ClearAll\n theTheme.GetFTab.GetSelection.Set(rec)\n theTheme.GetFTab.UpdateSelection\n theTheme.GetFTab.EndTransaction\n shp = p\n else\n gp = GraphicShape.Make(p)\n theView.GetGraphics.UnselectAll\n gp.SetSelected(TRUE)\n theView.GetGraphics .Add(gp)\n shp = gp.GetShape\n end\n av.GetProject.SetModified(true)\nend\n\n'\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\n' Added by Mike Delaune 10/23/97 Revised 4/14/2000\nReturnList = av.Run(\"aan.Sub-CalcSize\",{shp.AsPolygon})\nif(ReturnList.Get(0).IsNull = False) then\n theAcNum = ReturnList.Get(0).SetFormat(\"d.dd\")\n theHtNum = ReturnList.Get(1).SetFormat(\"d.dd\")\n Acres = av.run(\"aanView.NumComma\",theAcNum)\n Hectares = av.run(\"aanView.NumComma\",theHtNum)\n av.ShowMsg(\"Polygon Size = \"+Acres+\" Acres and \"+Hectares+\" Hectares.\")\nend\n'\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"" ) (Script.334 Name: "View.RectTool" SourceCode: "' View.RectTool (Modified by Mike DeLaune)\n' If there are no themes open for editing, this tool creates graphic rectangles.\n' If there is a theme open for editing, this tool creates a rectangle polygon and adds it to the themes feature table.\n'\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\n\ntheView = av.GetActiveDoc\n\nr = theView.ReturnUserRect\ntheTheme = theView.GetEditableTheme\n\nif (r.IsNull) then\n return nil\nelse\n if (theTheme <> nil) then\n p = r.AsPolygon\n thePrj = theView.GetProjection\n if (thePrj.IsNull.Not) then\n p = p.ReturnUnprojected(thePrj)\n end\n theTheme.getFTab.BeginTransaction\n theField = theTheme.GetFTab.FindField(\"Shape\")\n rec = theTheme.GetFTab.AddRecord\n theTheme.GetFTab.SetValue(theField, rec, p)\n theTheme.GetFTab.EndTransaction\n theTheme.GetFTab.GetSelection.ClearAll\n theTheme.GetFTab.GetSelection.Set(rec)\n theTheme.GetFTab.UpdateSelection\n shp = p\n else\n gr = GraphicShape.Make(r)\n theView.GetGraphics.UnselectAll\n gr.SetSelected(T RUE)\n theView.GetGraphics.Add(gr)\n shp = gr.GetShape\n end\n av.GetProject.SetModified(true)\nend\n\n'\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\n' Added by Mike Delaune 10/23/97 Revised 4/14/2000\nReturnList = av.Run(\"aan.Sub-CalcSize\",{shp.AsPolygon})\nif(ReturnList.Get(0).IsNull = False) then\n theAcNum = ReturnList.Get(0).SetFormat(\"d.dd\")\n theHtNum = ReturnList.Get(1).SetFormat(\"d.dd\")\n Acres = av.run(\"aanView.NumComma\",theAcNum)\n Hectares = av.run(\"aanView.NumComma\",theHtNum)\n av.ShowMsg(\"Re ctangle Size = \"+Acres+\" Acres and \"+Hectares+\" Hectares.\")\nend\n'\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"" ) (Script.335 Name: "View.Select" SourceCode: "' View.Select (Modified by Mike DeLaune 10/23/97)\n' If there are no themes open for editing, this tool is used to select, move, and resize graphics.\n' If there is a theme open for editing, this tool is used to select, move, and resize features.\n'\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\n\ntheView = av.GetActiveDoc\ntheTheme = theView.GetEditableTheme\nif (theTheme = nil) then\n theView.Select\nelse\n theTheme.GetFTab.BeginTransaction\n theTheme.Select\n theTheme.GetFTab.EndTransaction\nend\n\n'\"\"\"\"\"\"\"\"\"\" \"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\n' Added by Mike Delaune 10/23/97 Revised 4/14/2000\nif (theTheme = nil) then\n selGraphics = theView.GetGraphics.GetSelected\n SelrecNum = selGraphics.Count\n if (SelrecNum = 1) then\n graphShape = selGraphics.Get(0)\n theShape = graphShape.GetShape\n if (theShape.GetDimension = 2) then\n theShape = theShape.AsPolygon\n end \n end\n theStr = \" selected graphic shapes.\" \nelse\n theFtab = theTheme.GetFtab\n SelRecNum = theFTab.GetSelection.Count\n if (SelRecN um = 1) then\n for each rec in theFTab.GetSelection\n theShapeField = theFtab.FindField(\"Shape\")\n theShape = theFTab.returnvalue(theShapeField,rec)\n end\n end\n theStr = \" selected shapes in the editable theme.\"\nend\n\nif (SelRecNum = 1) then\n if(theShape.Is(Polygon))then\n ReturnList = av.Run(\"aan.Sub-CalcSize\",{theShape})\n theAcNum = ReturnList.Get(0).SetFormat(\"d.dd\")\n theHtNum = ReturnList.Get(1).SetFormat(\"d.dd\")\n Acres = av.run(\"aanView.NumComma\",theAcNum)\n Hectares = av.ru n(\"aanView.NumComma\",theHtNum)\n av.ShowMsg(\"Polygon Size = \"+Acres+\" Acres and \"+Hectares+\" Hectares.\")\n \n elseif(theShape.Is(Polyline)) then\n ReturnList = av.Run(\"aan.Sub-CalcSize\",{theShape})\n theLenNum = ReturnList.Get(0).SetFormat(\"d.dd\")\n Length = av.run(\"aanView.NumComma\",theLenNum)\n av.ShowMsg(\"Polyline Length = \"+Length++ReturnList.Get(1)+\".\")\n \n else\n av.ShowMsg(\"There is one selected point shape.\")\n end\nelse\n av.ShowMsg(\"There are \"+SelRecNum.AsString++theStr)\nend \n'\"\"\"\"\"\" \"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\n\nav.GetProject.SetModified(true)\n" ) (Script.336 Name: "View.SelectPoint" SourceCode: "' View.SelectPoint (Modified by Mike DeLaune 10/23/97 Revised 4/15/2000)\n' This tool is used to select features in active themes.\n\ntheView = av.GetActiveDoc\nr = theView.ReturnUserRect\ntheThemes = theView.GetActiveThemes\n'\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\n 'Added by Mike DeLaune 10/23/97 Revised 4/15/2000\nthmNum = theThemes.Count\nshapetype = #FIELD_SHAPEPOINT\nSelRecNum = 0\ntheShape = Point.MakeNull\nav.ShowMsg(\" \")\n'\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\" \nif (r.IsNull) then \n p = theView.GetDisplay.ReturnUserPoint\n if (System.IsShiftKeyDown) then\n op = #VTAB_SELTYPE_XOR\n else\n op = #VTAB_SELTYPE_NEW\n end\n for each t in theThemes\n if (t.CanSelect) then\n t.SelectByPoint(p, op)\n end\n'\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\n 'Added by Mike DeLaune 10/23/97 Revised 4/15/2000\n theFtab = t.GetFtab\n SelRecNum = SelRecNum + theFTab.GetSelection.Count\n if (SelRecNum = 1) then\n for each rec in theFTab.GetSelection\n theShapeField = theFtab. FindField(\"Shape\")\n theShape = theFTab.returnvalue(theShapeField,rec)\n end\n end \n'\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\" \n end \nelse ' If r is not null\n if (System.IsShiftKeyDown) then\n op = #VTAB_SELTYPE_OR\n else\n op = #VTAB_SELTYPE_NEW\n end\n for each t in theThemes\n if (t.CanSelect) then\n t.SelectByRect(r, op)\n end\n'\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\n 'Added by Mike DeLaune 10/23/97 Revised 4/15/2000\n theFtab = t.GetFtab\n Sel RecNum = SelRecNum + theFTab.GetSelection.Count\n if (SelRecNum = 1) then\n for each rec in theFTab.GetSelection\n theShapeField = theFtab.FindField(\"Shape\")\n theShape = theFTab.returnvalue(theShapeField,rec)\n end\n end\n'\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\" \n end\nend\n'\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\n' Added by Mike Delaune 10/23/97 Revised 4/14/2000\nif (SelrecNum = 1) then\n if(theShape.Is(Polygon))then\n ReturnList = av.Run(\"aan.Sub-CalcS ize\",{theShape})\n theAcNum = ReturnList.Get(0).SetFormat(\"d.dd\")\n theHtNum = ReturnList.Get(1).SetFormat(\"d.dd\")\n Acres = av.run(\"aanView.NumComma\",theAcNum)\n Hectares = av.run(\"aanView.NumComma\",theHtNum)\n av.ShowMsg(\"Polygon Size = \"+Acres+\" Acres and \"+Hectares+\" Hectares.\")\n \n elseif(theShape.Is(Polyline)) then\n ReturnList = av.Run(\"aan.Sub-CalcSize\",{theShape})\n theLenNum = ReturnList.Get(0).SetFormat(\"d.dd\")\n if(theLenNum = nil) then exit end\n Length = av.run(\"aanView.NumC omma\",theLenNum)\n av.ShowMsg(\"Polyline Length = \"+Length++ReturnList.Get(1)+\".\")\n \n else\n av.ShowMsg(\"There is \"+SelRecNum.AsString++\" selected point shape(s) in the \"++thmNum.AsString++\"active theme(s).\")\n end\nelse\n av.ShowMsg(\"There are \"+SelRecNum.AsString++\" selected shape(s) in the \"++thmNum.AsString++\"active theme(s).\")\nend \n'\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\nav.GetProject.SetModified(true)\n" ) (Script.337 Name: "aanView.NumComma" SourceCode: "' Name: aanView.NumComma\n'\n' Title: Put commas into a number\n'\n' Topics: Formatting\n'\n' Description: This script is called from other scipts. The calling script passes this script\n' a number. This script converts the number to a string, puts commas into the appropriate \n' location(s), and passes the string back to the calling script for display. This script works\n' for any size number.\n'\n' This script expands on the aanView.NumComma script written by Mike DeLaune, \n' (Email: mike.g.delaune@state.or.us), Oregon Department of Forestry, 10/23/97 as part of the\n' Xtools extension.\n'\n' Script by Steve Perone, (Email: perones@metro.dst.or.us), METRO 4-28-98 \n'\n' Requires: The script can properly handle numbers w/ 10 decimal digits of precision. Numbers\n' with more than 10 decimal digits are rounded to 10 decimal digits of precision. \n'\n' Self: aNumber in \"d.x\" (x = up to 10 \"d\"s of percision) \n'\n' Returns: aString (newnum) in \"d,ddd,ddd,ddd.??????????\" format.\n'\n'============================================= ==============\n\ntheNumber = SELF\nScript.The.SetNumberFormat(\"d.dddddddddddd\")\nnumstr = theNumber.AsString.Astokens(\".\")\n\n\n' Add any comma's\naString = numstr.Get(0).AsString\nanIndex = aString.Count\naComma = 0\naNumber = \"\"\nfor each i in 1 .. aString.Count\n anIndex = anIndex - 1\n aLetter = aString.Middle(anIndex,1)\n aComma = aComma + 1\n if (aComma = 3) then\n if ( i <> aString.Count ) then\n aNumber = \",\"+aLetter+aNumber\n aComma = 0\n else\n aNumber = aLetter + aNumber\n end\n els e\n aNumber = aLetter + aNumber\n end\nend\n\n' Add any decimal digits\naString = numstr.Get(1).AsString\nanIndex = aString.Count\naDigit = \"\"\nflag = TRUE\nfor each i in 1 .. aString.Count\n anIndex = anIndex - 1\n aValue = aString.Middle(anIndex,1)\n if ( flag ) then\n if ( aValue.AsNumber = 0 ) then\n continue\n else\n flag = FALSE\n aDigit = aValue + aDigit\n end\n else\n aDigit = aValue + aDigit\n end\nend\n \n\nif (aDigit <> \"\") then\n newnum = aNumber + \".\" + aDigit\nelse\n newNum = aNum ber 'Don't show the period unless there are some decimal places\nend\nreturn newnum\n\n\n\n\n" ) (Script.338 Name: "aanView.OverlayThemes" SourceCode: "' Name: aanView.OverlayThemes\n'\n' Title: Overlay Themes\n'\n' Topics: Analysis, Themes\n'\n' Description: This script is a subroutine called by one of the following scripts:\n' aanView.BatchOverlay, aanView.ClipWithPolygons, aanView.EraseFeatures, aanView.IdentityTheme,\n' aanView.IntersectThemes, aanView.UnionPolygonThemes, aanView.UpdatePolygonTheme. \n' The purpose of this script is to carry out XTools overlay analysis functions. See the \"shift click\" instructions\n' with the individual functions for a descript ion of each function.\n'\n' Script by Mike DeLaune, (Email: mike.g.delaune@state.or.us), \n' Oregon Department of Forestry, 11/9/97. Last Revised 5/21/2001.\n'\n' Requires: At least two Fthemes, one of which is polygon.\n'\n' Self: Self is a list passed by the calling script. For the individual functions, self contains only one element,\n' the name of the operation requested (Clip, Erase, Identity, Intersect, Union, or Update). For batch operations, \n' the list contains five elements: the operation name, the Inp ut theme, the Overlay theme, the Output file name, and \n' the feature type of the Input Theme (Point, Arc, Polygon, or Shape)\n'\n' Returns: Returns nil to the calling script.\n'\n'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n\n' ALL OPERATIONS DO THE FOLLOWING:\n\n' SET TEST TO TRUE IF THIS IS A TEST RUN. THIS ALLOWS RUNNING THE SUBROUTINE DIRECTLY,\n' RATHER THAN FROM A CALLING SCRIPT. ALSO WRITES TESTING INFORMATION TO A FILE NAMED XTTRACK.TXT.\n\n' DO THIS FOR ALL OPERATIONS\ntheRunList = SELF \nOperation = \"Test\"\nif(theRunList <> nil) then\n Operation = theRunList.Get(0)\nelse\n theRunList = {}\nend \n\nTEST = FALSE\n' SELECT TEST RUNNING OPERATION BY HOLDING DOWN CONTROL KEY.\nif (System.IsControlKeyDown) then\n TEST = TRUE\n theXtTrackFN = Filename.Make(\"$HOME/Xttrack.txt\").GetFullName.AsFileName\n theXttrackFile = LineFile.Make(theXtTrackFN, #FILE_PERM_WRITE)\n theXttrackFile.WriteElt(Operation+\" operation starting \"+Date.Now.AsString+nl)\n theXttrackFile.WriteElt(\"1a. System Memory Available is \"+System.GetAvailableMemory.AsString+\n \" at time \"+Date.Now.AsString+\" - Start Program.\"+nl)\n theXttrackFile.Close\n MsgBox.Info(\"XTools will write test information to \"+theXtTrackFN.AsString,\"XTOOLS TEST RUN\")\n if(Operation = \"Test\") then\n Operation = Msgbox.ChoiceAsString({\"Clip\",\"Erase\",\"Intersect\",\"Identity\",\"Union\",\"Update\"},\"Pick an operation\",\"XTOOLS TEST RUN\")\n if(Operation = nil) then exit end\n end \nend\n\ntime1a = date.now\n\n' CHECK TO SEE IF THIS IS A BATCH RUN.\nif(theRunList.Count > 1) then\n batch = TRUE\nelse\n batch = FALSE\nend\n\n' GET THE ACTIVE DOCUMENT, WHICH SHOULD BE A VIEW. BAIL IF NOT A VIEW:\ntheView=av.GetActiveDoc\nif (theView.Is(View).Not) then\n MsgBox.Error(\"This script must be run from a view. Exiting\",\"Error\")\n exit\nend\n\n' FIND OUT IF A PROJECTION IS SET, SAVE IT, AND UNSET IT AND CUT GRAPHICS UNTIL THE END.\nthesaveprj = theView.GetProjection.clone\nif(thesaveprj.IsNull = false) then\n theView.GetGraphics.SelectAll\n theView.GetGraphics.CutSelected\n themapunits = theView .GetUnits.Clone\n theView.SetProjection(prj.MakeNull)\nend\n\n' BUILD A LIST OF FTHEMES FROM THE THEME LIST. THE USER WILL BE ASKED TO SELECT THE INPUT \n' THEME FROM THE LIST LATER.\nthms=List.Make\nfor each t in theView.GetThemes\n if (t.Is(Ftheme)) then\n thms.Add(t)\n end\nend\n\n'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n\n' IF THIS IS A BATCH OPERATION DO THE FOLLOWING:\nif(batch = TRUE) then\n theInputTheme = theRunList.Get(1)\n if(theInputTheme.Is(String)) then\n theInputSrcName = Src Name.Make(theInputTheme)\n theInputTheme = av.Run(\"aanView.Sub-MakeTheme\", theInputSrcName)\n end \n theOverlayTheme = theRunList.Get(2)\n if(theOverlayTheme.Is(String)) then\n theOverlaySrcName = SrcName.Make(theOverlayTheme)\n theOverlayTheme = av.Run(\"aanView.Sub-MakeTheme\", theOverlaySrcName)\n end\n outputfile = theRunList.Get(3)\n IsInputInView = false\n IsOverlayInView = false\n \n ' CHECK TO SEE IF THE INPUT AND OVERLAY THEMES ARE IN THE VIEW, ADD THEM IF NOT.\n for each t in thms\n if ((t.GetSrcName.GetDataSource = theInputTheme.GetSrcName.GetDataSource) AND\n (t.GetSrcName.GetSubName = theInputTheme.GetSrcName.GetSubName) AND\n (IsInputInView = false)) then\n theInputTheme = t\n IsInputInView = true\n end\n if ((t.GetSrcName.GetDataSource = theOverlayTheme.GetSrcName.GetDataSource) AND \n (t.GetSrcName.GetSubName = theOverlayTheme.GetSrcName.GetSubName) AND\n (IsOverlayInView = false)) then\n theOverlayTheme = t\n IsOverlayInView = true\n end\n end \n if (IsInputInView = false) then \n theView.AddTheme(theInputTheme)\n end\n if (IsOverlayInView = false) then \n theView.AddTheme(theOverlayTheme)\n end\n \nend ' IF(BATCH = TRUE) THEN\nav.PurgeObjects\n\n'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n' INITIAL SET UP AND ERROR CHECKS:\n'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n\n'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n' IF A SINGLE OPERATION RUN (NOT BATCH) DO THE FOLLOWING:\n\nif( batch = FALSE) then\n \n ' IF < 2 THEMES ARE FTHEMES, BAIL OUT.\n if (thms.Count < 2) then\n System.Beep\n MsgBox.Error(\"There must be at least two feature themes in the View to proceed! Exiting.\",\"Error\")\n exit\n end\n \n ' BUILD A LIST OF POLYGON FTHEMES FROM THE THEME LIST. THE USER WILL BE ASKED TO SELECT\n ' THE OVERLAY THEME FROM THE LIST.\n pthms=List.Make\n for each t in thms\n shapetype = t.GetFtab.FindField(\"Shape\").GetType\n if (shapetype = #FIELD_SHAPEPOLY) then\n pthms.Add(t)\n end\n end\n \n ' IF NO THEMES ARE POLYGON FTHEMES, BAIL OUT.\n if (pthms.Count < 1) then\n System.Beep\n MsgBox.Error(\"There must be at least one polygon feature theme in the View to proceed! Exiting.\",\"Error\")\n exit\n end\n \n ' MAKE SOME STRINGS FOR THE SELECTED OPERATION - USED IN THEME SELECTION LATER\n if (Operation = \"Clip\") then\n str1 = \"Select the theme that contains features that you wish to clip:\"\n str2 = \"Clip! SELECT INPUT THEME\"\n str3 = \"Select the polygon theme that will be used to clip features from the previous theme:\"\n str4 = \"Clip! SELECT CLIP THEME\"\n elseif (Operation = \"Erase\") then\n str1 = \"Select the theme that contains features that you wish to erase:\"\n str2 = \"Erase! SELECT INPUT THEME\"\n str3 = \"Select the polygon theme that will be used to Erase features from the previous theme:\"\n str4 = \"Erase! SELECT ERASE THEME\"\n elseif (Operation = \"Identity\") then\n str1 = \"Select the theme that contains features that you wish do an Identity operation on:\"\n str2 = \"Identity! SELECT INPUT THEME\"\n str3 = \"Select the polygon theme that will be used in the Identity operation:\"\n str4 = \"Identity! SELECT IDENTITY THEME\"\n elseif (Operation = \"Intersect\") then\n str1 = \"Select the theme that contains features that you wish to Intersect:\"\n str2 = \"Intersect! SELECT INPUT THEME\"\n str3 = \"Select the polygon theme that will be used to Intersect features from the previous theme:\"\n str4 = \"Intersect! SELECT INTERSECT THEME\"\n elseif (Opera tion = \"Union\") then\n str1 = \"Select the polygon theme that contains features that you wish to Union with another theme:\"\n str2 = \"Union! SELECT INPUT THEME\"\n str3 = \"Select the polygon theme that will be used to Union with features from the previous theme:\"\n str4 = \"Union! SELECT UNION THEME\"\n elseif (Operation = \"Update\") then\n str1 = \"Select the polygon theme that contains features that you wish to Update:\"\n str2 = \"Update! SELECT INPUT THEME\"\n str3 = \"Select the polygon theme that will be used to Update features from the previous theme:\"\n str4 = \"Update! SELECT UPDATE THEME\"\n end\n \n ' LIMIT THE THEMES ON THE SELECTION LIST TO POLYGON IF UNION OR UPDATE SELECTED \n if((Operation = \"Union\") or (Operation = \"Update\")) then\n thms = pthms\n end\n \n ' END OF THE INITIAL SETUP\n \n 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n ' ASK FOR USER INPUT:\n 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX \n \n ' ASK THE USER WHICH THEME TO USE AS INPUT:\n theInputTheme = MsgBox.Choice(thms,str1,str2)\n if(theInputTheme = nil) then exit end\n \n ' REMOVE THE INPUT THEME FROM THE LIST OF POLYGON THEMES:\n theInputThemeIndex = pthms.Find(theInputTheme)\n if(theInputThemeIndex > -1) then\n pthms.Remove(theInputThemeIndex)\n end\n\nend ' IF( BATCH = FALSE) THEN\n\n'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n' GET SOME INFO ABOUT THE INPUT THEME\ntheInputThemeName = theInputTheme.GetSRCName.GetFileName.AsString\ntheInputTh emeBase = theInputTheme.GetSRCName.GetName.Ucase\ntheInputShapeField = theInputTheme.GetFTab.FindField(\"shape\")\ntheInputShapeFieldType = theInputShapeField.GetType\n\n'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n' BEGIN PROCESS FOR SELECTING INPUT THEME FIELDS TO GO INTO THE OUTPUT THEME ( USED FOR\n' INTERSECT, IDENTITY, AND UNION)\nif ((Operation = \"Intersect\") or (Operation = \"Identity\") or (Operation = \"Union\")) then\n\n theInputfields = List.Make\n \n ' MAKE THE LIST, EXCLUDING THE SHAPE, AREA, LENGTH, ACRES, AND LENGTH FIELDS. THEY WILL BE ADDED LATER.\n for each f in theInputTheme.GetFTab.GetFields\n if ((f.GetName = \"Shape\") or (f.GetName = \"area\") or (f.GetName = \"perimeter\") or \n (f.GetName = \"acres\") or (f.GetName = \"length\") or (f.GetName = \"hectares\")) then\n continue\n else \n fCopy = f.Clone\n theInputFields.Add(fCopy)\n end\n end\n \n 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n ' IF A SINGLE OPERATION RUN (NOT BATCH) DO THE FOLLOWING:\n\n if (batch = FALSE) then\n ' ASK THE USER WHICH INPUT THEME FIELDS TO INCLUDE IN THE OUTPUT THEME.\n thetempFields = Msgbox.MultiList(theInputFields,\"(Single click to toggle selection,\"+nl+\n \" click and drag for multiple selection,\"+nl+\"Press SHIFT + OK to select all fields)\",\n \"SELECT\"++theInputThemeBase++\"FIELDS FOR OUTPUT\")\n \n if (System.IsShiftKeyDown) then\n thetempFields = theInputFields\n end \n if(thetempFields = nil) then exit end\n \n if ((thetempFields = nil).Not) th en\n theInputFields = thetempFields\n else\n theInputFields = theInputFields.Empty\n end\n end ' IF (BATCH = FALSE) THEN\n \n theInputFieldsList = List.Make\n for each fld in theInputFields\n theInputFieldsList.Add({fld.Clone, fld.Clone})\n end \n \nend ' IF ((OPERATION = \"INTERSECT\") OR (OPERATION = \"IDENTITY\") OR (OPERATION = \"UNION\")) THEN\n\nif (batch = FALSE) then\n ' ASK THE USER WHICH THEME CONTAINS THE POLYGONS THAT WILL BE OVERLAYED WITH THE INPUT THEME POLYGONS:\n theOverlayTheme = Ms gBox.Choice(pthms,str3, str4)\n if(theOverlayTheme = nil) then exit end\nend\n\n'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n' GET SOME INFO ABOUT THE OVERLAY THEME\ntheOverlayThemeName = theOverlayTheme.GetSRCName.GetFileName.AsString\ntheOverlayThemeBase = theOverlayTheme.GetSRCName.GetName.Ucase\ntheOverlayShapeField = theOverlayTheme.GetFTab.FindField(\"shape\")\n\n'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n' BEGIN PROCESS FOR SELECTING OVERLAY THEME FIELDS TO GO INTO THE OUTPU T THEME ( USED \n' FOR INTERSECT, IDENTITY, AND UNION)\nIf ((Operation = \"Intersect\") or (Operation = \"Identity\") or (Operation = \"Union\")) then\n\n theOverlayFieldsTemp = List.Make\n \n ' MAKE THE LIST, EXCLUDING THE SHAPE, AREA, LENGTH, ACRES, HECTARES, AND LENGTH FIELDS.\n ' (THEY WILL BE ADDED LATER.)\n for each f in theOverlayTheme.GetFTab.GetFields\n if ((f.GetName = \"Shape\") or (f.GetName = \"area\") or (f.GetName = \"perimeter\") or \n (f.GetName = \"acres\") or (f.GetName = \"length\")or (f.GetName = \"h ectares\")) then\n continue\n else \n fCopy = f.Clone\n theOverlayFieldsTemp.Add(fCopy)\n end\n end\n \n ' ASK THE USER WHICH OVERLAY THEME FIELDS TO INCLUDE IN THE OUTPUT THEME.\n theOverlayFields = List.Make\n theOverlayFieldsList = List.Make\n \n 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n ' IF A SINGLE OPERATION RUN (NOT BATCH) DO THE FOLLOWING:\n if (batch = FALSE) then\n thetempList = Msgbox.MultiList(theOverlayFieldsTemp,\"(Single click to toggle selection,\"+nl +\n \" click and drag for multiple selection,\"+nl+\"Press SHIFT + OK to select all fields)\",\n \"SELECT\"++theOverlayThemeBase++\"FIELDS FOR OUTPUT\")\n \n if (System.IsShiftKeyDown) then\n thetempList = theOverlayFieldsTemp\n end\n if(thetempList = nil) then exit end\n else\n thetempList = theOverlayFieldsTemp\n end ' IF (BATCH = FALSE) THEN\n 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n \n if ((thetempList = nil).Not) then\n theOverlayFieldsTemp = thetempList \n for ea ch f in theOverlayFieldsTemp\n fCopy = f.Clone\n dCopy = f.Clone\n for each thefield in theInputFields\n if (thefield.GetAlias = fcopy.GetAlias) then\n if (fcopy.GetAlias.count > 9) then\n fcopy.setname(fcopy.GetAlias.left(9)+\"b\")\n else\n fcopy.setname(fcopy.GetAlias+\"b\")\n end\n end\n end\n theOverlayFields.add(fCopy)\n theOverlayFieldsList.add({fCopy,dCopy})\n end\n end\nend ' END OF THE SEQUENCE TO SELECT OUTPUT THEME FIE LDS\n\n'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n' FOR THE UPDATE OPERATION, GET THE FIELDS THAT ARE COMMON TO THE INPUT AND \n' OVERLAY THEMES\nif(operation = \"Update\") then\n theInputFields = theInputTheme.GetFTab.GetFields\n theOverlayfields = theOverlayTheme.GetFTab.GetFields\n theCommonFields = List.Make\n for each nf in theInputFields\n if ((nf.GetName = \"Shape\") or (nf.GetName = \"area\") or (nf.GetName = \"perimeter\") or \n (nf.GetName = \"acres\") or (nf.GetName = \"length\")or (nf.Ge tName = \"hectares\")) then\n continue\n else \n for each sf in theOverlayfields\n if ((nf.GetName = sf.GetName) and (nf.GetType = sf.Gettype)) then\n theCommonFields.Add(nf.Clone)\n end\n end\n end\n end\nend ' if(operation = \"Update\") then\n\n'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n' IF A SINGLE OPERATION RUN (NOT BATCH) DO THE FOLLOWING:\n' ASK THE USER FOR A FILENAME AND LOCATION FOR THE NEW SHAPEFILE. EXIT IF USER CANCELS.\nif (batch = FALSE) then\n theWorkDir = av.GetProject.GetWorkDir\n theWorkDir.SetCWD\n defname = theWorkDir.MakeTMP(Operation, \"shp\")\n outputfile = FileDialog.Put(defname,\"*.shp\",\"NAME OUTPUT THEME\")\n if (outputfile = nil) then exit end\nend\n\n'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n\n\n'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n' END OF USER INPUT - START PRELIMINARY PROCESSING OPERATIONS.\n'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n\ntime1 = date.now\n\nif (TEST = TRUE) then\n ' MAKE A TRACKING LOG FILE AND WRITE SOME INFORMATION.\n theXttrackFile = LineFile.Make(theXtTrackFN, #FILE_PERM_APPEND)\n theXttrackFile.WriteElt(\"1. System Memory Available is \"+System.GetAvailableMemory.AsString+\n \" at time \"+Date.Now.AsString+\" - Start Processing.\"+nl)\n theXttrackFile.Close\nend\n\n' REMEMBER THE INITIAL SELECTIONS IN THE INPUT AND OVERLAY THEMES.\ntheOldInputSelRecs = theInputTheme.GetFtab.GetSelection.Clone\ntheOldOverlaySelRecs = theOverlayTheme.GetFtab.GetSelection.Clone\n\n' SET THE SELECTIONS FOR THE INPUT AND OVERLAY THEMES.\ntheInputFTab = theInputTheme.GetFTab\ntheInputSelRecs = theInputFTab.GetSelection\nif(theInputSelRecs.Count = 0) then\n theInputFTab.GetSelection.SetAll\n theInputFTab.UpdateSelection\nend\ntheInputSelRecsClone = theInputFTab.GetSelection.Clone\ntheInputSelRecNum = theInputSelRecsClone.Count\n\n\ntheOverlayFTab = theOverlayTheme.GetFTab\ntheOverlaySelRecs = theOverlayFTab.GetSelection\nif(theOverlaySelRecs.Count = 0) then\n theOverlayFTab.GetSelection.SetAll\n theOverlayFT ab.UpdateSelection\nend \ntheOverlaySelRecsClone = theOverlayFTab.GetSelection.Clone\n\n'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n' CHECK TO MAKE SURE THAT THERE IS SOME OVERLAP OF SELECTED FEATURES. CLEAN UP AND EXIT IF NOT.\ntheInputFTab.SelectByFTab (theOverlayFTab, #FTAB_RELTYPE_INTERSECTS, 0, #VTAB_SELTYPE_AND)\ntheSelRecs = theInputFTab.GetNumSelRecords\nif(theSelRecs = 0) then\n theInputFTab.SetSelection(theOldInputSelRecs.Clone)\n theInputFTab.UpdateSelection\n theOverlayFTab.SetSelec tion(theOldOverlaySelRecs.Clone)\n theOverlayFTab.UpdateSelection\n if(batch = TRUE) then\n av.ShowMsg(\"Overlay functions require overlap between Input and Overlay theme features. There is no overlap \"+\n \"between the specified Input and Overlay themes. Exiting.\")\n else\n MsgBox.Warning(\"Overlay functions require overlap between Input and Overlay theme features. There is no overlap \"+\n \"between the specified Input and Overlay themes. Exiting.\",\"\")\n end\n Return nil\nelse\n theInputFTab.SetSele ction(theInputSelRecsClone.Clone)\n theInputFTab.UpdateSelection\nend\n\n'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n' CHECK FOR AND DELETE TEMPORARY FILES.\ntheTempOverlayFileName = FileName.Make(\"$HOME/xxoverlay.shp\").GetFullName.AsFileName\nav.Run(\"aan.Sub-ShapeFileDelete\",theTempOverlayFileName)\n\ntheTempOutputFileName = FileName.Make(\"$HOME/xxoutput.shp\").GetFullName.AsFileName\nav.Run(\"aan.Sub-ShapeFileDelete\",theTempOutputFileName)\n\ntheTempInputFileName = FileName.Make(\"$HOME/xxxinput.shp\" ).GetFullName.AsFileName\nav.Run(\"aan.Sub-ShapeFileDelete\",theTempInputFileName) \n\n'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n' MAKE A TEMP OVERLAY THEME WITH ONLY SHAPE FIELD AND ONE OTHER FOR SPECIFIED OPS.\n' USED ONLY TO MAKE A MULTIPART OVERLAY SHAPE. USED FOR:\n' SHAPEPOINT - NONE\n' SHAPELINE - CLIP, ERASE\n' SHAPEPOLY - CLIP, ERASE, UPDATE\n\ntime2 = date.now\n\nif (TEST = TRUE) then\n ' MAKE A TRACKING LOG FILE AND WRITE SOME INFORMATION.\n theXttrackFile = LineFile.Make(theXtTra ckFN, #FILE_PERM_APPEND)\n theXttrackFile.WriteElt(\"2. System Memory Available is \"+System.GetAvailableMemory.AsString+\n \" at time \"+Date.Now.AsString+\" - Start Overlay Theme Merge.\"+nl)\n theXttrackFile.Close\nend\n\nif ((theInputShapeFieldType <> #FIELD_SHAPEPOINT) and ((Operation = \"Clip\") or (Operation = \"Erase\") or \n(Operation = \"Update\"))) then \n cnt = 0\n for each fld in theOverlayFTab.GetFields\n cnt = cnt + 1\n if(cnt > 2) then\n fld.SetVisible(FALSE)\n end\n end \n theTempOverlayFTab = th eOverlayTheme.ExportToFTab(theTempOverlayFileName)\n for each fld in theOverlayFTab.GetFields\n fld.SetVisible(TRUE)\n end\n theTempOverlayShapeField = theTempOverlayFTab.FindField(\"Shape\")\n theTempOverlayTheme = FTheme.Make(theTempOverlayFTab)\n theView.AddTheme(theTempOverlayTheme)\n theView.SetEditableTheme(theTempOverlayTheme)\n theTempOverlayFTab.GetSelection.SetAll\n theTempOverlayFTab.UpdateSelection\n theTempOverlayTheme.UnionSelected\n for each selrec in theTempOverlayFTab\n theOverlayMultiShap e = theTempOverlayFTab.ReturnValue(theOverlayShapeField,selrec)\n end\n theTempOverlayTheme.StopEditing(FALSE)\n theView.SetEditableTheme(nil) \n \n theView.DeleteTheme(theTempOverlayTheme)\n theTempOverlayFTab.DeActivate\n theTempOverlayFTab = nil\n theTempOverlayTheme = nil\n av.Run(\"aan.Sub-ShapeFileDelete\",theTempOverlayFileName)\n av.PurgeObjects\nend 'If ((Operation = \"Clip\")...\n\n'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n' MAKE A LIST OF OVERLAY SHAPES AS POLYLINES. USED FOR:\n' S HAPEPOINT - NONE\n' SHAPELINE - INTERSECT, IDENTITY\n' SHAPEPOLY - NONE\n\nif ((theInputShapeFieldType = #FIELD_SHAPELINE) and ((Operation = \"Intersect\") or (Operation = \"Identity\"))) then \n theOverlayShapeList = List.Make\n for each selrec in theOverlayFTab.GetSelection\n theOverlayShapeList.Add(theOverlayFTab.ReturnValue(theOverlayShapeField,selrec).AsPolyline)\n end\nend \n\n'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n\ntime3 = date.now\nif (TEST = TRUE) then\n ' MAKE A TRACKING LOG FILE AND WRITE SOME INFORMATION.\n theXttrackFile = LineFile.Make(theXtTrackFN, #FILE_PERM_APPEND)\n theXttrackFile.WriteElt(\"3. System Memory Available is \"+System.GetAvailableMemory.AsString+\n \" at time \"+Date.Now.AsString+\" - Start Output File Make Process.\"+nl)\n theXttrackFile.Close\nend\n\n\n' THIS PROCESS IS USED TO SELECT THE INPUT THEME SHAPES THAT WILL GO INTO THE \n' INTIIAL OUTPUT THEME:\n\n ' POINT SHAPEFILES: MODIFY THE 100% SELECTION OF THE INPUT THEME. (UNCHANGED \n ' FOR IDENTITY).\n if(theInp utShapeFieldType = #FIELD_SHAPEPOINT) then\n if(Operation = \"Erase\") then\n theInputTheme.SelectByTheme(theOverlayTheme,#FTAB_RELTYPE_INTERSECTS,0,#VTAB_SELTYPE_XOR)\n end\n if(Operation = \"Clip\") then\n theInputTheme.SelectByTheme(theOverlayTheme,#FTAB_RELTYPE_INTERSECTS,0,#VTAB_SELTYPE_AND)\n end\n if(Operation = \"Intersect\") then\n theInputTheme.SelectByTheme(theOverlayTheme,#FTAB_RELTYPE_INTERSECTS,0,#VTAB_SELTYPE_AND)\n end\n end ' IF(THEINPUTSHAPEFIELDTYPE = #FIELD_SHAPEPOINT ) THEN\n \n ' POLYLINE SHAPEFILES: MODIFY THE 100% SELECTION OF THE INPUT THEME.\n if(theInputShapeFieldType = #FIELD_SHAPELINE) then\n if(Operation = \"Clip\") then\n theInputTheme.SelectByShapes({theOverlayMultiShape},#VTAB_SELTYPE_AND)\n end\n if(Operation = \"Erase\") then \n theInputSelRecsOriginal = theInputFTab.GetSelection.Clone ' THE ORIGINAL SELECTED SHAPES.\n theInputTheme.SelectByShapes({theOverlayMultiShape},#VTAB_SELTYPE_NEW)\n theInputSelRecsOutside = theInputFTab.GetSele ction.Clone ' THE SHAPES EITHER COMPLETELY INSIDE THE OVERLAY THEME OR INTERSECTING THE BOUNDARY.\n theInputSelRecsOutside.Not ' THE SHAPES COMPLETELY OUTSIDE OF THE OVERLAY THEME.\n theInputTheme.SelectByShapes({theOverlayMultiShape.AsPolyline},#VTAB_SELTYPE_NEW)\n theInputSelRecsBoundary = theInputFTab.GetSelection.Clone ' THE SHAPES INTERSECTING THE BOUNDARY.\n theInputSelRecsOutside.Or(theInputSelRecsBoundary) ' THE TOTAL SHAPES EITHER COMPL ETELY OUTSIDE OR ON THE BOUNDARY.\n theInputSelRecsOriginal.And(theInputSelRecsOutside) ' THE ORIGINAL SELECTED SHAPES EITHER COMPLETELY OUTSIDE OR ON THE BOUNDARY.\n theInputFTab.SetSelection(theInputSelRecsOriginal.Clone)\n end\n if(Operation = \"Intersect\") then \n theInputSelRecsOriginal = theInputFTab.GetSelection.Clone ' THE ORIGINAL SELECTED SHAPES.\n theInputTheme.SelectByTheme(theOverlayTheme,#FTAB_RELTYPE_INTERSECTS,0,#VTAB_SELTYPE_NEW)\n theInputSelRecsInside = the InputFTab.GetSelection.Clone ' THE SHAPES EITHER COMPLETELY INSIDE THE OVERLAY THEME OR INTERSECTING THE BOUNDARY.\n theInputTheme.SelectByShapes(theOverlayShapeList,#VTAB_SELTYPE_NEW)\n theInputSelRecsBoundary = theInputFTab.GetSelection.Clone ' THE SHAPES INTERSECTING THE BOUNDARY.\n theInputSelRecsInside.Xor(theInputSelRecsBoundary) ' THE TOTAL SHAPES TOTALLY INSIDE AND NOT INTERSECTING A BOUNDARY.\n theInputSelRecsOriginal.And(theInputSelRecsInside) ' THE ORIGINAL S ELECTED SHAPES TOTALLY INSIDE AND NOT INTERSECTING A BOUNDARY.\n theInputFTab.SetSelection(theInputSelRecsOriginal.Clone)\n theInputFTab.UpdateSelection\n theOverlayShapeList = nil\n av.PurgeObjects\n end\n if(Operation = \"Identity\") then \n theInputSelRecsOriginal = theInputFTab.GetSelection.Clone ' THE ORIGINAL SELECTED SHAPES.\n theInputTheme.SelectByShapes(theOverlayShapeList,#VTAB_SELTYPE_NEW)\n theInputSelRecsBoundary = theInputFTab.GetSelection.Clone ' THE SHAPES IN TERSECTING THE BOUNDARY.\n theInputSelRecsBoundaryN = theInputSelRecsBoundary.Clone\n theInputSelRecsBoundaryN.Not ' THE SHAPES NOT INTERSECTING THE BOUNDARY. \n theInputSelRecsOriginal.And(theInputSelRecsBoundaryN) ' THE ORIGINAL SELECTED SHAPES NOT INTERSECTING A BOUNDARY.\n theInputFTab.SetSelection(theInputSelRecsOriginal.Clone)\n theInputFTab.UpdateSelection\n theOverlayShapeList = nil\n av.PurgeObjects\n end\n\n end ' IF(THEINPUTSHAPEFIELDTYPE = #FIELD_SHAPELI NE) THEN\n\n ' POLYGON SHAPEFILES: MODIFY THE 100% SELECTION OF THE INPUT THEME. (UNCHANGED FOR UNION).\n if(theInputShapeFieldType = #FIELD_SHAPEPOLY) then\n if(Operation = \"Clip\") then\n theInputTheme.SelectByShapes({theOverlayMultiShape},#VTAB_SELTYPE_AND)\n end\n if(Operation = \"Erase\") then \n theInputSelRecsOriginal = theInputFTab.GetSelection.Clone ' THE ORIGINAL SELECTED SHAPES.\n theInputTheme.SelectByShapes({theOverlayMultiShape},#VTAB_SELTYPE_NEW)\n theInputSelRecsOutside = theInputFTab.GetSelection.Clone ' THE SHAPES EITHER COMPLETELY INSIDE THE OVERLAY THEME OR INTERSECTING THE BOUNDARY.\n theInputSelRecsOutside.Not ' THE SHAPES COMPLETELY OUTSIDE OF THE OVERLAY THEME.\n theInputTheme.SelectByShapes({theOverlayMultiShape.AsPolyline},#VTAB_SELTYPE_NEW)\n theInputSelRecsBoundary = theInputFTab.GetSelection.Clone ' THE SHAPES INTERSECTING THE BOUNDARY.\n theInputSelRecsOutside.Or(theInputSelRecsBoundary) ' THE TOT AL SHAPES EITHER COMPLETELY OUTSIDE OR ON THE BOUNDARY.\n theInputSelRecsOriginal.And(theInputSelRecsOutside) ' THE ORIGINAL SELECTED SHAPES EITHER COMPLETELY OUTSIDE OR ON THE BOUNDARY.\n theInputFTab.SetSelection(theInputSelRecsOriginal.Clone)\n end\n if(Operation = \"Intersect\") then \n' theInputSelRecsOriginal = theInputFTab.GetSelection.Clone ' THE ORIGINAL SELECTED SHAPES.\n' theInputTheme.SelectByTheme(theOverlayTheme,#FTAB_RELTYPE_INTERSECTS,0,#VTAB_SELTYPE_NEW)\n' th eInputSelRecsInside = theInputFTab.GetSelection.Clone ' THE SHAPES EITHER COMPLETELY INSIDE THE OVERLAY THEME OR INTERSECTING THE BOUNDARY.\n' theInputTheme.SelectByShapes(theOverlayShapeList,#VTAB_SELTYPE_NEW)\n' theInputSelRecsBoundary = theInputFTab.GetSelection.Clone ' THE SHAPES INTERSECTING THE BOUNDARY.\n' theInputSelRecsInside.Xor(theInputSelRecsBoundary) ' THE TOTAL SHAPES TOTALLY INSIDE AND NOT INTERSECTING A BOUNDARY.\n' theInputSelRecsOriginal.And(theInputSelRecsIns ide) ' THE ORIGINAL SELECTED SHAPES TOTALLY INSIDE AND NOT INTERSECTING A BOUNDARY.\n' theInputFTab.SetSelection(theInputSelRecsOriginal.Clone)\n' theInputFTab.UpdateSelection\n' theOverlayShapeList = nil\n' av.PurgeObjects \n end\n if((Operation = \"Identity\") or (Operation = \"Union\")) then \n' theInputSelRecsOriginal = theInputFTab.GetSelection.Clone ' THE ORIGINAL SELECTED SHAPES.\n' theInputTheme.SelectByShapes(theOverlayShapeList,#VTAB_SELTYPE_NEW)\n' theInputSel RecsBoundary = theInputFTab.GetSelection.Clone ' THE SHAPES INTERSECTING THE BOUNDARY.\n' theInputSelRecsBoundaryN = theInputSelRecsBoundary.Clone\n' theInputSelRecsBoundaryN.Not ' THE SHAPES NOT INTERSECTING THE BOUNDARY. \n' theInputSelRecsOriginal.And(theInputSelRecsBoundaryN) ' THE ORIGINAL SELECTED SHAPES NOT INTERSECTING A BOUNDARY.\n' theInputFTab.SetSelection(theInputSelRecsOriginal.Clone)\n' theInputFTab.UpdateSelection\n' theOverlayShapeList = nil\n' av.Pur geObjects\n end\n if(Operation = \"Update\") then\n theInputSelRecsOriginal = theInputFTab.GetSelection.Clone ' THE ORIGINAL SELECTED SHAPES.\n theInputTheme.SelectByShapes({theOverlayMultiShape},#VTAB_SELTYPE_NEW)\n theInputSelRecsOutside = theInputFTab.GetSelection.Clone ' THE SHAPES EITHER COMPLETELY INSIDE THE OVERLAY THEME OR INTERSECTING THE BOUNDARY.\n theInputSelRecsOutside.Not ' THE SHAPES COMPLETELY OUTSIDE OF THE OVERLAY THEME.\n theInput Theme.SelectByShapes({theOverlayMultiShape.AsPolyline},#VTAB_SELTYPE_NEW)\n theInputSelRecsBoundary = theInputFTab.GetSelection.Clone ' THE SHAPES INTERSECTING THE BOUNDARY.\n theInputSelRecsOutside.Or(theInputSelRecsBoundary) ' THE TOTAL SHAPES EITHER COMPLETELY OUTSIDE OR ON THE BOUNDARY.\n theInputSelRecsOriginal.And(theInputSelRecsOutside) ' THE ORIGINAL SELECTED SHAPES EITHER COMPLETELY OUTSIDE OR ON THE BOUNDARY.\n theInputFTab.SetSelection(theInputSelRecsOriginal.Cl one)\n theInputFTab.UpdateSelection\n end\n end ' IF(THEINPUTSHAPEFIELDTYPE = #FIELD_SHAPEPOLY) THEN\n\n\n'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n\n' CREATE A DUPLICATE OF THE INPUT THEME AS THE OUTPUT SHAPEFILE.\n' NOTE: THIS STEP DOES ALL OF THE SPATIAL OPERATIONS NEEDED FOR POINTS.\n' SHAPEPOINT - CLIP, ERASE, INTERSECT, IDENTITY\n' SHAPELINE - CLIP, ERASE, INTERSECT, IDENTITY\n' SHAPEPOLY - CLIP, ERASE, INTERSECT, IDENTITY, UPDATE, UNION\n\n \n' BRING IN THE ATTRIBUTE DATA FOR INTERSECT AND IDENTITY OPERATIONS.\nif((Operation = \"Intersect\") or (Operation = \"Identity\") or (Operation = \"Union\")) then\n for each fld in theInputFTab.GetFields\n if(fld.GetName <> \"Shape\") then\n fld.SetVisible(FALSE)\n for each fld2 in theInputFields\n if(fld.GetAlias = fld2.GetAlias) then\n fld.SetVisible(TRUE)\n end\n end\n end\n end\n \n if(theInputShapeFieldType <> #FIELD_SHAPEPOLY) then\n for each fld in theOverlayFTab.GetFields\n if(fld.GetName <> \"Sha pe\") then\n fld.SetVisible(FALSE)\n for each fld2 in theOverlayFields\n if(fld.GetAlias = fld2.GetAlias) then\n fld.SetVisible(TRUE)\n end\n end\n end\n end\n theInputFTab.Join(theInputShapeField, theOverlayFTab, theOverlayShapeField) \n theFieldList = theInputFTab.GetFields\n theFldNum = theFieldList.Count\n theFldNum1 = theFldNum - 2\n theFldNum2 = theFldNum - 1\n for each i in 0..theFldNum1\n f1 = theFieldList.Get(i)\n k = i + 1\n for each j in k..theFldNum2\n f2 = theFieldList.Get(j)\n if(f1.GetName = f2.GetName) then\n if (f2.GetName.count > 9) then\n f2.SetAlias(f2.GetName.left(9)+\"b\")\n else\n f2.SetAlias(f2.GetName+\"b\")\n end\n end\n end\n end \n end ' IF(THEINPUTSHAPEFIELDTYPE <> #FIELD_SHAPEPOLY) THEN\nend ' IF((OPERATION = \"INTERSECT\") OR (OPERATION = \"IDENTITY\")) THEN\n \n \n' MAKE THE OUTPUT THEME. USE FTHEME.EXPORTTOFTAB IF RECORDS ARE SELECTED AN D FTAB.EXPORT IF NO RECORDS ARE SELECTED.\n' DETERMINE THE SHAPE CLASS OF THE INPUT THEME\nif (theInputShapeFieldType = #FIELD_SHAPELINE) then \n thenewShapeFieldClass = POLYLINE\nelseif (theInputShapeFieldType = #FIELD_SHAPEMULTIPOINT) then\n thenewShapeFieldClass = MULTIPOINT\nelseif (theInputShapeFieldType = #FIELD_SHAPEPOINT) then\n thenewShapeFieldClass = POINT\nelseif (theInputShapeFieldType = #FIELD_SHAPEPOLY) then\n thenewShapeFieldClass = POLYGON\nelse\n MsgBox.Error(\"Invalid shape field type in the inp ut theme.\", \"Overlay Themes\")\n return nil\nend \n\nif ((theInputShapeFieldType <> #FIELD_SHAPEPOLY) or (Operation = \"Clip\") or (Operation = \"Erase\") or (Operation = \"Update\")) then\n if(theInputFtab.GetSelection.Count <> 0) then\n theOutputFTab = theInputTheme.ExportToFTab(Outputfile)\n else \n TheOutputFTab = theInputFTab.Export (Outputfile, thenewShapeFieldClass, TRUE)\n end \nelse ' FOR POLYGON INTERSECT, IDENTITY, AND UNION.\n theInputFTab.GetSelection.Clearall\n TheOutputFTab = theInputFTab.Export ( Outputfile, thenewShapeFieldClass, TRUE)\n theInputFTab.SetSelection(theInputSelRecsClone.Clone)\n theInputFTab.UpdateSelection\nend ' \n\ntheOutputFTab.SetEditable(True)\ntheInputFTab.UnJoinAll\n\nfor each fld in theInputFTab.GetFields\n fld.SetVisible(TRUE)\nend\nfor each fld in theOverlayFTab.GetFields\n fld.SetVisible(TRUE)\nend\n\n\n' CHECK TO SEE IF THE OUTPUT THEME HAS AT LEAST 2 FIELDS AND EXIT WITH WARNING IF NOT.\nif (theOutputFTab.GetFields.Count < 2) then\n System.Beep\n MsgBox.Error(\"There must be at lea st two fields in the output to proceed! Exiting.\",\"Error\")\n theOutputFTab.DeActivate\n theOutputFTab = nil\n av.Run(\"aan.Sub-ShapeFileDelete\",outputfile)\n exit\nend\n \n' GET INFO ABOUT THE OUTPUT SHAPEFILE.\ntheView.InvalidateToc(nil)\ntheOutputShapeField = theOutputFtab.FindField(\"shape\")\ntheOutputShapeType = theOutputFtab.FindField(\"shape\").GetType\ntheOutputIdField = theOutputFtab.FindField(\"id\")\ntheOutputFtab.SetEditable(False)\ntheOutputFtab.SetEditable(True)\n \n \n' ADD THE OVERLAY THEME FIELDS IF THE OPERATION IS INTERSECT, IDENTITY, OR UNION, AND SHAPE IS POLYGON.\n' SHAPEPOINT - NONE\n' SHAPELINE - NONE\n' SHAPEPOLY - INTERSECT, IDENTITY, UNION\nif(((Operation = \"Intersect\") or (Operation = \"Identity\") or (Operation = \"Union\")) and (theInputShapeFieldType = #FIELD_SHAPEPOLY)) then\n \n ' ADD THE SELECTED FIELDS FROM THE OVERLAY THEME.\n for each lst in theOverlayFieldsList\n fld = lst.Get(0)\n theOutputFTab.AddFields({fld})\n end \n \nend ' if ((Operation = \"Intersect\") or (Operation = \"Ident ity\") or (Operation = \"Union\")) then\n\n ' CREATE THE NEW THEME AND ADD IT TO THE VIEW\n theOutputTheme = FTheme.Make(theOutputFtab)\n theView.AddTheme(theOutputTheme)\n \n\n'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n\n' GET THE ID FIELDS AND SET THEM VISIBLE.\ntheInputRecNum = theInputFTab.GetNumRecords\ntheInputIDField = theInputFTab.FindField(\"id\") \nif ((theInputIDField = nil).Not) then\n theInputIDField.SetVisible(true)\nend\n\ntheOverlayIDField = theOverlayFTab.FindField(\"id\") \nif ((theOverl ayIDField = nil).Not) then\n theOverlayIDField.SetVisible(true)\nend\n \ntime4 = date.now\nif (TEST = TRUE) then\n ' MAKE A TRACKING LOG FILE AND WRITE SOME INFORMATION.\n theXttrackFile = LineFile.Make(theXtTrackFN, #FILE_PERM_APPEND)\n theXttrackFile.WriteElt(\"4. System Memory Available is \"+System.GetAvailableMemory.AsString+\n \" at time \"+Date.Now.AsString+\" - Start Overlay Operation.\"+nl)\n theXttrackFile.Close\nend\n\nav.ClearMsg\nav.ShowMsg(\"XTools \"+Operation+\" operation in progress.....\")\nSystem.Refresh Windows\nav.UseWaitCursor\nav.PurgeObjects\n\n'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n' BEGIN OVERLAY OPERATIONS X\n'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n' CLIP PROCESS:\ntime5 = date.now\nif (TEST = TRUE) then\n ' MAKE A TRACKING LOG FILE AND WRITE SOME INFORMATION.\n theXttrackFile = LineFile.Make(theXtTrackFN, #FILE_PERM_APPEND)\n theXttrackFile.WriteElt(\"5. System Memory Available is \"+System.GetAvailableMemory.AsString+\n \" at time \"+Date.Now.AsString+\" - Start Clip Operation.\"+nl)\n theXttrackFile.Close\nend\n\nif(Operation = \"Clip\") then \n if ((theInputShapeFieldType = #FIELD_SHAPEPOLY) or (theInputShapeFieldType = #FIELD_SHAPELINE)) then\n theView.SetEditableTheme(theOutputTheme)\n theOutputTheme.SelectByShapes({theOverlayMultiShape.AsPolyline},#VTAB_SELTYPE_NEW)\n theOutputTheme.ClipSelected(theOverlayMultiShape)\n ' NOTE: THE CLIP PROCESS FOR POINTS IS DONE BEFORE CREATING THE OUTPUT FTAB. \n end\nend\n\n'XXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n' ERASE PROCESS:\ntime6 = date.now\nif (TEST = TRUE) then\n ' MAKE A TRACKING LOG FILE AND WRITE SOME INFORMATION.\n theXttrackFile = LineFile.Make(theXtTrackFN, #FILE_PERM_APPEND)\n theXttrackFile.WriteElt(\"6. System Memory Available is \"+System.GetAvailableMemory.AsString+\n \" at time \"+Date.Now.AsString+\" - Start Erase Operation.\"+nl)\n theXttrackFile.Close\nend\n\nif (Operation = \"Erase\") Then\n if ((theInputShapeFieldType = #FIELD_SHAPEPOLY) or (theInputShapeFiel dType = #FIELD_SHAPELINE)) then\n theView.SetEditableTheme(theOutputTheme)\n theOutputTheme.SelectByShapes({theOverlayMultiShape.AsPolyline},#VTAB_SELTYPE_NEW)\n theOutputTheme.SubtractShape(theOverlayMultiShape)\n ' NOTE: THE ERASE PROCESS FOR POINTS IS DONE BEFORE CREATING THE OUTPUT FTAB.\n end\nend\n\n'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n' UPDATE PROCESS:\ntime7 = date.now\nif (TEST = TRUE) then\n ' MAKE A TRACKING LOG FILE AND WRITE SOME INFORMATION.\n theXttrackFile = Line File.Make(theXtTrackFN, #FILE_PERM_APPEND)\n theXttrackFile.WriteElt(\"7. System Memory Available is \"+System.GetAvailableMemory.AsString+\n \" at time \"+Date.Now.AsString+\" - Start Update Operation.\"+nl)\n theXttrackFile.Close\nend\n\nif (Operation = \"Update\") Then\n theView.SetEditableTheme(theOutputTheme)\n theOutputTheme.SelectByShapes({theOverlayMultiShape.AsPolyline},#VTAB_SELTYPE_NEW)\n theOutputTheme.SubtractShape(theOverlayMultiShape)\n for each selpoly in theOverlayFTab.GetSelection\n theOverlaySha pe = theOverlayFTab.ReturnValue(theOverlayShapeField,selpoly) \n thenewRec = theOutputFTab.AddRecord\n theOutputFTab.SetValue(theOutputShapeField,thenewRec,theOverlayShape)\n for each cf in theCommonFields\n theOverlayField = theOverlayFTab.FindField(cf.GetAlias)\n theOutputField = theOutputFTab.FindField(cf.GetAlias)\n if ((theOverlayField <> nil) and (theOutputField <> nil)) then\n theOverlayVal = theOverlayFTab.ReturnValue(theOverlayField,selpoly)\n theOutputFTab.SetValue(th eOutputField,thenewRec,theOverlayVal)\n end \n end \n end\nend ' if (Operation = \"Update\") Then\n\n'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n' INTERSECT AND IDENTITY PROCESSES FOR POINTS\ntime8 = date.now\nif (TEST = TRUE) then\n ' MAKE A TRACKING LOG FILE AND WRITE SOME INFORMATION.\n theXttrackFile = LineFile.Make(theXtTrackFN, #FILE_PERM_APPEND)\n theXttrackFile.WriteElt(\"8. System Memory Available is \"+System.GetAvailableMemory.AsString+\n \" at time \"+Date.Now.AsString+\" - Start Point Intersect / Identity Operation.\"+nl)\n theXttrackFile.Close\nend\n' NOTE: THE INTERSECT AND IDENTITY PROCESSES FOR POINTS ARE DONE BEFORE CREATING THE OUTPUT FTAB.\n\n'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n' INTERSECT PROCESS FOR POLYLINES (ALSO DO FOR IDENTITY OPERATIONS).\ntime8b = date.now\nif (TEST = TRUE) then\n ' MAKE A TRACKING LOG FILE AND WRITE SOME INFORMATION.\n theXttrackFile = LineFile.Make(theXtTrackFN, #FILE_PERM_APPEND)\n theXttrackFile.WriteElt(\"8b. System M emory Available is \"+System.GetAvailableMemory.AsString+\n \" at time \"+Date.Now.AsString+\" - Start Polygon / Polyline Intersect Operation.\"+nl)\n theXttrackFile.Close\nend\n\nif (((Operation = \"Intersect\") or (Operation = \"Identity\")) and (theInputShapeFieldType = #FIELD_SHAPELINE)) then\n theInputSelRecsBoundary.AND(theInputSelRecsClone)\n theInputFTab.SetSelection(theInputSelRecsBoundary.Clone)\n theInputFTab.UpdateSelection\n for each irec in theInputFTab.GetSelection\n ' GET THE INTERSECT SHAPE AND SELE CT FOR ALL RECORDS IN THEOVERLAYFTAB WITHIN \n ' THAT SHAPE.\n theInputShape = theInputFTab.returnvalue(theInputShapeField,irec)\n ' SKIP THE REMAINDER OF THIS LOOP IF THE SHAPE IS NULL (LIKE THE UNIVERSAL POLYGON IN \n ' AN ARCINFO POLYGON COVERAGE.)\n if(theInputShape.IsNull = true) then continue end \n theOverlayFTab.SetSelection(theOverlaySelRecsClone.Clone)\n theOverlayFTab.UpdateSelection\n theOverlayFTab.SelectbyPolyline(theInputShape,#VTAB_SELTYPE_AND)\n ' SKIP THE REMAINDER OF THIS LOOP IF NO RECORDS WERE SELECTED.\n if (theOverlayFTab.GetSelection.Count = 0) then continue end\n \n ' START PROCESSING EACH SELECTED RECORD IN THEINPUTFTAB\n for each orec in theOverlayFTab.GetSelection\n \n ' GET THE SHAPE.\n theOverlayShape = theOverlayFTab.ReturnValue(theOverlayShapeField,orec)\n \n ' SKIP THE REMAINDER IF THE POLYGON IS NULL\n if (Operation = \"Intersect\") then\n if(theOverlayShape.IsNull = true) then continue end\n end \n \n ' G ET THE INTERSECTING SHAPE\n InterShape = theInputShape.ReturnIntersection(theOverlayShape)\n \n ' SKIP THE REST IF THE INTERSECTING SHAPE IS NULL\n if(InterShape.IsNull = true) then continue end\n \n if (Operation = \"Identity\") then\n theInputShape = theInputShape.ReturnDifference(theOverlayShape)\n end \n \n ' MAKE A NEW RECORD & SET THE VALUE OF THE SHAPEFIELD\n thenewRec = theOutputFTab.AddRecord\n theOutputFTab.SetValue(theOutputShapeField,thenewRec,I nterShape)\n \n ' ADD THE ATTRIBUTE DATA FROM THE INPUT THEME:\n if (((theInputFields = nil).Not) and (theInputFields.Count > 0)) then\n for each afield in theInputFields\n infield = theInputFTab.FindField(afield.GetAlias)\n outfield = theOutputFTab.FindField(afield.GetAlias)\n if((infield <> nil) and (outfield <> nil)) then\n invalue = theInputFTab.ReturnValue(infield,irec)\n theOutputFTab.SetValue(outfield,thenewRec,invalue)\n end\n end\n end\n \n ' ADD THE ATTRIBUTE DATA FROM THE OVERLAY THEME:\n if (((theOverlayFieldsList = nil).Not) and (theOverlayFieldsList.Count > 0)) then\n for each afield in theOverlayFieldsList\n infield = theOverlayFTab.FindField(afield.Get(1).GetAlias)\n outfield = theOutputFTab.FindField(afield.Get(1).GetAlias)\n if((infield <> nil) and (outfield <> nil)) then\n invalue = theOverlayFTab.ReturnValue(infield,orec)\n theOutputFTab.SetValue(out field,thenewRec,invalue)\n end\n end\n end\n\n end ' for each orec\n\n\n\n if((theInputShape.IsNull = FALSE) and (Operation = \"Identity\")) then \n ' MAKE A NEW RECORD & SET THE VALUE OF THE SHAPEFIELD\n thenewRec = theOutputFTab.AddRecord\n theOutputFTab.SetValue(theOutputShapeField,thenewRec,theInputShape)\n \n ' ADD THE ATTRIBUTE DATA FROM THE INPUT THEME:\n if (((theInputFields = nil).Not) and (theInputFields.Count > 0)) then\n for each afield in theInp utFields\n infield = theInputFTab.FindField(afield.GetAlias)\n outfield = theOutputFTab.FindField(afield.GetAlias)\n if((infield <> nil) and (outfield <> nil)) then\n invalue = theInputFTab.ReturnValue(infield,irec)\n theOutputFTab.SetValue(outfield,thenewRec,invalue)\n end\n end\n end\n end\n end ' for each irec\nend ' if ((Operation = \"Intersect\") and (theInputShapeFieldType = #FIELD_SHAPELINE)) then\n\n\n'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXX\n' INTERSECT PROCESS FOR POLYGONS \n' THE INTERSECTION IS ALSO USED FOR THE IDENTITY AND UNION PROCESSES.\ntime8b = date.now\nif (TEST = TRUE) then\n ' MAKE A TRACKING LOG FILE AND WRITE SOME INFORMATION.\n theXttrackFile = LineFile.Make(theXtTrackFN, #FILE_PERM_APPEND)\n theXttrackFile.WriteElt(\"8b. System Memory Available is \"+System.GetAvailableMemory.AsString+\n \" at time \"+Date.Now.AsString+\" - Start Polygon / Polyline Intersect Operation.\"+nl)\n theXttrackFile.Close\nend\n ' INITIALIZE THEOVERLAYMULTISHAPE\n theOverlayMultiShape = Polygon.MakeNull ' This deals with the possibility that there is no overlap of selected features.\n\n\nif (((Operation = \"Intersect\") or (Operation = \"Identity\") or (Operation = \"Union\")) and (theInputShapeFieldType = #FIELD_SHAPEPOLY)) then\n sec = 0\n theInputTheme.SelectByTheme(theOverlayTheme, #FTAB_RELTYPE_INTERSECTS , 0, #VTAB_SELTYPE_AND)\n theOverlayTheme.SelectByTheme(theInputTheme, #FTAB_RELTYPE_INTERSECTS , 0, #VTAB_SELTYPE_AND)\n' INTERSECT THE THEME WITH MORE RECORDS WITH THE THEME WITH FEWER RECORDS. THIS INCREASES PROCESSING EFFICIENCY.\n swapped = FALSE\n if (theOverlayFTab.GetNumSelRecords > theInputFTab.GetNumSelRecords) then\n tempInput = theInputFTab\n theInputFTab = theOverlayFTab\n theOverlayFTab = tempInput\n tmpInpFields = theInputFieldsList\n theInputFieldsList = theOverlayFieldsList\n theOverlayFieldsList = tmpInpFields\n swapped = TRUE\n end\n theSelInput = theInputFTab.GetSelection.Clone\n\n\n ' INTERSECT THE INPU T THEME WITH THE OVERLAY THEME.\n for each orec in theOverlayFTab.GetSelection\n ' GET THE INTERSECT SHAPE AND SELECT FOR ALL RECORDS IN THEINPUTFTAB WITHIN THAT SHAPE.\n theOverlayShape = theOverlayFTab.ReturnValue(theOverlayShapeField,orec)\n ' SKIP THE REMAINDER OF THIS LOOP IF THE POLYGON IS NULL (LIKE THE UNIVERSAL POLYGON IN AN ARCINFO POLYGON COVERAGE.)\n if(theOverlayShape.IsNull = true) then continue end \n theInputFTab.SetSelection(theSelInput.Clone)\n theInputFTab.UpdateSelection\n theInputFTab.SelectbyShapes({theOverlayShape},#VTAB_SELTYPE_AND)\n ' SKIP THE REMAINDER OF THIS LOOP IF NO RECORDS WERE SELECTED.\n if (theInputFTab.GetSelection.Count = 0) then continue end\n \n ' START PROCESSING EACH SELECTED RECORD IN THEINPUTFTAB\n for each irec in theInputFTab.GetSelection\n \n ' GET THE SHAPE.\n theInputShape = theInputFTab.returnvalue(theInputShapeField,irec)\n \n ' SKIP THE REMAINDER IF THE POLYGON IS NULL\n if(theInputShape.IsNull = true) then continue end \n \n ' GET THE INTERSECTING SHAPE\n InterShape = theOverlayShape.ReturnIntersection(theInputShape)\n \n ' SKIP THE REST IF THE INTERSECTING SHAPE IS NULL\n if(InterShape.IsNull = true) then continue end\n \n ' MAKE A NEW RECORD & SET THE VALUE OF THE SHAPEFIELD\n thenewRec = theOutputFTab.AddRecord\n theOutputFTab.SetValue(theOutputShapeField,thenewRec,InterShape)\n\n ' CREATE AN UNIONED OUTPUT SHAPE FOR USE IN IDENTITY AND UNION OPERATIONS\n if (Operation <> \"Intersect\") then\n if (sec = 0) then\n theOverlayMultiShape = InterShape\n sec = 1\n else\n theOverlayMultiShape = theOverlayMultiShape.ReturnUnion(InterShape)\n end\n end\n\n ' ADD THE ATTRIBUTE DATA FROM THE INPUT THEME:\n if (((theInputFields = nil).Not) and (theInputFields.Count > 0)) then\n for each afield in theInputFieldsList\n infield = theInputFTab.FindField(afield.Get(0).GetAlias)\n outfield = theOutputF Tab.FindField(afield.Get(0).GetName)\n if((infield <> nil) and (outfield <> nil)) then\n invalue = theInputFTab.ReturnValue(infield,irec)\n theOutputFTab.SetValue(outfield,thenewRec,invalue)\n end\n end\n end\n\n \n ' ADD THE ATTRIBUTE DATA FROM THE OVERLAY THEME:\n if (((theOverlayFieldsList = nil).Not) and (theOverlayFieldsList.Count > 0)) then\n for each afield in theOverlayFieldsList\n infield = theOverlayFTab.FindField(afield.Get(0). GetAlias)\n outfield = theOutputFTab.FindField(afield.Get(0).GetName)\n if((infield <> nil) and (outfield <> nil)) then\n invalue = theOverlayFTab.ReturnValue(infield,orec)\n theOutputFTab.SetValue(outfield,thenewRec,invalue)\n end\n end\n end\n \n end ' for each irec in theInputFTab.GetSelection\n end ' for each orec in theOverlayFTab\n ' RESET THE INPUT AND OVERLAY THEMES, IF THEY WERE SWAPPED.\n if (swapped = TRUE) then\n tempInput = theI nputFTab\n theInputFTab = theOverlayFTab\n theOverlayFTab = tempInput\n tmpInpFields = theInputFieldsList\n theInputFieldsList = theOverlayFieldsList\n theOverlayFieldsList = tmpInpFields\n end\n\n end ' IF ((OPERATION = \"INTERSECT\") OR (OPERATION = \"IDENTITY\") OR (OPERATION = \"UNION\")) THEN\n \n \n'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n' IDENTITY PROCESS:\n' COMBINES THE RESULTS OF THE INTERSECTION IN THE PREVIOUS PROCESS WITH THE INPUT THEME FEATURES OUTSIDE OF THE INTERSECTI ON.\n' IF UNION IS THE SPECIFIED OPERATION, THE RESULTS ARE PASSED ON TO THE NEXT STAGE. \nav.PurgeObjects\ntime9 = date.now\nif (TEST = TRUE) then\n ' MAKE A TRACKING LOG FILE AND WRITE SOME INFORMATION.\n theXttrackFile = LineFile.Make(theXtTrackFN, #FILE_PERM_APPEND)\n theXttrackFile.WriteElt(\"9. System Memory Available is \"+System.GetAvailableMemory.AsString+\n \" at time \"+Date.Now.AsString+\" - Start Identity Operation.\"+nl)\n theXttrackFile.Close\nend\n\nif ((theInputShapeFieldType = #FIELD_SHAPEPOLY) and ((Operation = \"Identity\") or (Operation = \"Union\"))) then\n' MAKE A TEMP INPUT THEME.\n theTempInputFileName = FileName.Make(\"$HOME/xxxinput.shp\")\n if (File.Exists(theTempInputFileName)) then\n av.Run(\"aan.Sub-ShapeFileDelete\",theTempInputFileName)\n end\n theInputFTab.SetSelection(theInputSelRecsClone.Clone)\n theInputFTab.UpdateSelection\n theTempInputFTab = theInputTheme.ExportToFTab(theTempInputFileName)\n av.PurgeObjects\n theTempInputTheme = FTheme.Make(theTempInputFTab)\n theView.AddTheme(theTempI nputTheme)\n \n ' GET INFO ABOUT THE TEMPINPUTFTAB.\n theTempInputShapeField = theTempInputFTab.FindField(\"shape\")\n' theInputRecNum = theTempInputFTab.GetNumRecords\n \n theTempInputIDField = theTempInputFTab.FindField(\"id\")\n if ((theTempInputIDField = nil).Not) then\n theTempInputIDField.SetVisible(true)\n end\n \n theTempInputFTab.GetSelection.SetAll\n theTempInputFTab.UpdateSelection\n\n theView.SetEditableTheme(theTempInputTheme)\n theTempInputTheme.SubtractShape(theOverlayMultiShape)\n \n for each irec in theTempInputFTab\n theInputShape = theTempInputFTab.ReturnValue(theTempInputShapeField,irec)\n ' SKIP THE REMAINDER IF THE POLYGON IS NULL\n if(theInputShape.IsNull = true) then continue end\n ' MAKE A NEW RECORD & SET THE VALUE OF THE SHAPEFIELD\n thenewRec = theOutputFTab.AddRecord\n theOutputFTab.SetValue(theOutputShapeField,thenewRec,theInputShape)\n \n ' ADD THE ATTRIBUTE DATA FROM THE INPUT THEME:\n if (((theInputFields = nil).Not) and (theInputFields.Count > 0)) then\n for each afield in theInputFieldsList\n infield = theTempInputFTab.FindField(afield.Get(0).GetAlias)\n outfield = theOutputFTab.FindField(afield.Get(0).GetName)\n if((infield <> nil) and (outfield <> nil)) then\n invalue = theTempInputFTab.ReturnValue(infield,irec)\n theOutputFTab.SetValue(outfield,thenewRec,invalue)\n end\n end\n end\n end ' for each irec in theInputTheme\n \n ' TEMP INPUT CLEANUP.\n theTempInputTheme.StopEditing(false)\n theView.SetEdita bleTheme(nil)\n theView.DeleteTheme(theTempInputTheme)\n theTempInputFTab.DeActivate\n theTempInputFTab = nil\n theTempInputTheme = nil\n if(File.CanDelete(theTempInputFileName)) then\n av.Run(\"aan.Sub-ShapeFileDelete\",theTempInputFileName) \n theTempInputFileName = nil\n end\n av.PurgeObjects\n \nend ' if ((Operation = \"Identity\") or (Operation = \"Union\")) then\n\n' UNION PROCESS:\n' COMBINES THE RESULTS OF THE TWO PREVIOUS PROCESSES WITH THE OVERLAY THEME FEATURES OUTSIDE OF THE INTERSECTION.\nav.Pur geObjects\ntime10 = date.now\nif (TEST = TRUE) then\n ' MAKE A TRACKING LOG FILE AND WRITE SOME INFORMATION.\n theXttrackFile = LineFile.Make(theXtTrackFN, #FILE_PERM_APPEND)\n theXttrackFile.WriteElt(\"10. System Memory Available is \"+System.GetAvailableMemory.AsString+\n \" at time \"+Date.Now.AsString+\" - Start Union Operation.\"+nl)\n theXttrackFile.Close\nend\n\nif (Operation = \"Union\") Then\n' MAKE A TEMP OVERLAY THEME.\n' theTempOverlayFileName = FileName.Make(\"$HOME/xxoverlay.shp\")\n if (File.Exists(theTe mpOverlayFileName)) then\n av.Run(\"aan.Sub-ShapeFileDelete\",theTempOverlayFileName)\n end\n theOverlayFTab.SetSelection(theOverlaySelRecsClone.Clone)\n theOverlayFTab.UpdateSelection\n theTempOverlayFTab = theOverlayTheme.ExportToFTab(theTempOverlayFileName)\n theTempOverlayTheme = FTheme.Make(theTempOverlayFTab)\n theView.AddTheme(theTempOverlayTheme)\n \n \n ' MAKE THE OVERLAY THEME FTAB AND GET INFO ABOUT IT. \n theTempOverlayShapeField = theTempOverlayFTab.FindField(\"shape\")\n \n theTempOverlayIDFiel d = theTempOverlayFTab.FindField(\"id\") \n if ((theTempOverlayIDField = nil).Not) then\n theTempOverlayIDField.SetVisible(true)\n end\n \n theTempOverlayFTab.GetSelection.SetAll\n theTempOverlayFTab.UpdateSelection\n \n theView.SetEditableTheme(theTempOverlayTheme)\n theTempOverlayTheme.SubtractShape(theOverlayMultiShape)\n \n for each orec in theTempOverlayFTab\n theOverlayShape = theTempOverlayFTab.ReturnValue(theTempOverlayShapeField,orec)\n ' SKIP THE REMAINDER IF THE POLYGON IS NULL\n if(theOv erlayShape.IsNull = true) then continue end \n\n ' MAKE A NEW RECORD & SET THE VALUE OF THE SHAPEFIELD\n thenewRec = theOutputFTab.AddRecord\n theOutputFTab.SetValue(theOutputShapeField,thenewRec,theOverlayShape)\n \n ' ADD THE ATTRIBUTE DATA FROM THE OVERLAY THEME:\n if (((theOverlayFieldsList = nil).Not) and (theOverlayFieldsList.Count > 0)) then\n for each afield in theOverlayFieldsList\n infield = theTempOverlayFTab.FindField(afield.Get(0).GetAlias)\n outfield = theOutputFT ab.FindField(afield.Get(0).GetName)\n if((infield <> nil) and (outfield <> nil)) then\n invalue = theTempOverlayFTab.ReturnValue(infield,orec)\n theOutputFTab.SetValue(outfield,thenewRec,invalue)\n end\n end\n end\n \n end ' for each orec in theTempOverlayTheme\n \n ' TEMP OVERLAY CLEANUP.\n theTempOverlayTheme.StopEditing(false)\n theView.SetEditableTheme(nil)\n theView.DeleteTheme(theTempOverlayTheme)\n theTempOverlayFTab.DeActivate\n theTempOverlayFTab = nil\n theTe mpOverlayTheme = nil\n if(File.CanDelete(theTempOverlayFileName)) then\n av.Run(\"aan.Sub-ShapeFileDelete\",theTempOverlayFileName) \n theTempOverlayFileName = nil\n end\n av.PurgeObjects\n \nend ' if (Operation = \"Union\") Then\n\n\n'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n' END OVERLAY OPERATIONS X\n'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n\n'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX \n' BEGIN THE POST-EDITING CALC ULATIONS AND CLEANUP. X\n'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\nav.PurgeObjects\n\ntime11 = date.now\nif (TEST = TRUE) then\n ' MAKE A TRACKING LOG FILE AND WRITE SOME INFORMATION.\n theXttrackFile = LineFile.Make(theXtTrackFN, #FILE_PERM_APPEND)\n theXttrackFile.WriteElt(\"11. System Memory Available is \"+System.GetAvailableMemory.AsString+\n \" at time \"+Date.Now.AsString+\" - Start Null shape Delete.\"+nl)\n theXttrackFile.Close\nend\n\ntheView.SetEditableTheme(nil)\ntheOutputFTab.SetE ditable(True)\n\n' CLEAR OUT ANY EMPTY SHAPES:\nstr = \"[Shape].IsEmpty or [Shape].IsNull\"\ntheOutputFTab.Query(str, theOutputFTab.GetSelection, #VTAB_SELTYPE_NEW)\ntheOutputFTab.RemoveRecords(theOutputFTab.GetSelection)\n \ntime12 = date.now\nif (TEST = TRUE) then\n ' MAKE A TRACKING LOG FILE AND WRITE SOME INFORMATION.\n theXttrackFile = LineFile.Make(theXtTrackFN, #FILE_PERM_APPEND)\n theXttrackFile.WriteElt(\"12. System Memory Available is \"+System.GetAvailableMemory.AsString+\n \" at time \"+Date.Now.AsString+\" - Start Area, Permeter, Acres, Length Calc.\"+nl)\n theXttrackFile.Close\nend\n\n' GET THE XTOOLS DEFAULTS\ntheDefScript = av.GetProject.FindScript( \"XTprojectDefaults\" )\nif(theDefScript <> nil) then\n DefList = theDefScript.AsString.AsList\nelse\n MsgBox.Error(\"Please set XTools Defaults\",\"XTOOLS DEFAULTS NOT SET\")\n return nil\nend\ntheOverlayConvert = DefList.Get(5)\ntheAreaCalc = DefList.Get(6)\n\n' RUN THE MULTIPART TO SINGLE PART SUBROUTINE.\nif((theOverlayConvert = \"Yes\") and (theInputShapeFieldType <> #FIELD _SHAPEPOINT)) then\n theOutputFTab = av.Run(\"aan.Sub-Multi2Single\", theOutputFTab)\nend\n\n' CALCULATE AREA, PERIMETER, ACRES, AND LENGTH FIELDS AS NECESSARY AND APPROPRIATE.\nif((theAreaCalc = \"Yes\") and (theInputShapeFieldType <> #FIELD_SHAPEPOINT)) then\n theOutputFTab = av.Run(\"aan.Sub-CalcSize\",{theOutputFTab})\nend \n\n\ntime13 = date.now\nif (TEST = TRUE) then\n ' MAKE A TRACKING LOG FILE AND WRITE SOME INFORMATION.\n theXttrackFile = LineFile.Make(theXtTrackFN, #FILE_PERM_APPEND)\n theXttrackFile.WriteElt( \"13. System Memory Available is \"+System.GetAvailableMemory.AsString+\n \" at time \"+Date.Now.AsString+\" - Start Output File Save.\"+nl)\n theXttrackFile.Close\nend\n\ntheOutputFtab.SetEditable(FALSE) \n \ntime14 = date.now\nif (TEST = TRUE) then\n ' MAKE A TRACKING LOG FILE AND WRITE SOME INFORMATION.\n theXttrackFile = LineFile.Make(theXtTrackFN, #FILE_PERM_APPEND)\n theXttrackFile.WriteElt(\"14. System Memory Available is \"+System.GetAvailableMemory.AsString+\n \" at time \"+Date.Now.AsString+\" - Start Indexing the Output Theme.\"+nl)\n theXttrackFile.Close\nend\n\n' INDEX THE THEME, IF NECESSARY.\nif (theOutputFtab.IsFieldIndexed(theOutputShapeField) = False) then\n theOutputFtab.CreateIndex(theOutputShapeField)\nend\n\n' BRING THE VIEW TO THE FRONT AND CLEAN UP.\ntheView.InvalidateTOC(nil)\ntheView.GetWin.Activate\n\n' RESET THE PROJECTION AND RESTORE THE GRAPHICS, IF NECESSARY.\nif(thesaveprj.IsNull = false) then\n theView.SetProjection(thesaveprj)\n theView.SetUnits(themapunits)\n theView.GetGraphics.Paste\nend\n\n'XXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n'SET EDITING OFF AND RESET SELECTIONS.\ntheOutputFTab.GetSelection.Clearall\ntheInputFTab.SetSelection(theOldInputSelRecs.Clone)\ntheInputFTab.UpdateSelection\ntheOverlayFTab.SetSelection(theOldOverlaySelRecs.Clone)\ntheOverlayFTab.UpdateSelection\n\n'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n\ntime15 = date.now\nif (TEST = TRUE) then\n ' MAKE A TRACKING LOG FILE AND WRITE SOME INFORMATION.\n theXttrackFile = LineFile.Make(theXtTrackFN, #FILE_PERM _APPEND)\n theXttrackFile.WriteElt(\"15. System Memory Available is \"+System.GetAvailableMemory.AsString+\n \" at time \"+Date.Now.AsString+\" - Program completed.\"+nl)\n theXttrackFile.Close\nend\n\nif( BATCH = TRUE) then\n time1 = time1a\nend\n \nTotalsec = time15.GetTimeAsSeconds - time1.GetTimeAsSeconds\n\nif (TEST = TRUE) then\n ' GIVE THE PROGRAMMER INFO ON TIME TAKEN BY VARIOUS PARTS OF THE PROGRAM\n theMessage = Operation++\"Program Processing Times:\"+nl+\n time1.AsString+\": Start Processing.\"+\" (\"+(time2. GetTimeAsSeconds - time1.GetTimeAsSeconds).AsString++\"secs)\"+nl+\n time2.AsString+\": Start Overlay Theme Merge.\"+\" (\"+(time3.GetTimeAsSeconds - time2.GetTimeAsSeconds).AsString++\"secs)\"+nl+\n time3.AsString+\": Start Output File Make.\"+\" (\"+(time4.GetTimeAsSeconds - time3.GetTimeAsSeconds).AsString++\"secs)\"+nl+\n time4.AsString+\": Start Overlay Operation.\"+\" (\"+(time5.GetTimeAsSeconds - time4.GetTimeAsSeconds).AsString++\"secs)\"+nl+\n time5.AsString+\": Start Clip Operation.\"+\" (\"+(time6.GetTimeAsS econds - time5.GetTimeAsSeconds).AsString++\"secs)\"+nl+\n time6.AsString+\": Start Erase Operation.\"+\" (\"+(time7.GetTimeAsSeconds - time6.GetTimeAsSeconds).AsString++\"secs)\"+nl+\n time7.AsString+\": Start Update Operation.\"+\" (\"+(time8.GetTimeAsSeconds - time7.GetTimeAsSeconds).AsString++\"secs)\"+nl+\n time8.AsString+\": Start Point Intersect / Identity Operation.\"+\" (\"+(time8b.GetTimeAsSeconds - time8.GetTimeAsSeconds).AsString++\"secs)\"+nl+\n time8b.AsString+\": Start Polygon / Polyline Intersect Oper ation.\"+\" (\"+(time9.GetTimeAsSeconds - time8b.GetTimeAsSeconds).AsString++\"secs)\"+nl+\n time9.AsString+\": Start Identity Operation.\"+\" (\"+(time10.GetTimeAsSeconds - time9.GetTimeAsSeconds).AsString++\"secs)\"+nl+\n time10.AsString+\": Start Union Operation.\"+\" (\"+(time11.GetTimeAsSeconds - time10.GetTimeAsSeconds).AsString++\"secs)\"+nl+\n time11.AsString+\": Start Null Shape Delete.\"+\" (\"+(time12.GetTimeAsSeconds - time11.GetTimeAsSeconds).AsString++\"secs)\"+nl+\n time12.AsString+\": Start Area, Perime ter, Acres Calc.\"+\" (\"+(time13.GetTimeAsSeconds - time12.GetTimeAsSeconds).AsString++\"secs)\"+nl+\n time13.AsString+\": Start Output File Save.\"+\" (\"+(time14.GetTimeAsSeconds - time13.GetTimeAsSeconds).AsString++\"secs)\"+nl+\n time14.AsString+\": Start Indexing The Output Theme.\"+\" (\"+(time15.GetTimeAsSeconds - time14.GetTimeAsSeconds).AsString++\"secs)\"+nl+\n time15.AsString+\": Program Completed.\"+nl++nl+\n Totalsec.AsString+\": Total running time in seconds.\"\n \n MsgBox.Report(theMessage, \"OVERLAY P ROGRAM PROCESS\")\n \n Clipboard.The.Empty\n Clipboard.The.Add(theMessage)\n Clipboard.The.Update\n \n 'MsgBox.Info(\"This information was copied to the system clipboard. To print it, open a text editor\"++\n '\"(like notepad), paste in the contents of the clipboard, and print it from the text editor.\",\"PRINT INSTRUCTIONS\")\nend\n\n' OUTPUT TO AN XTOOLS LOG FILE:\ntheType = theOutputTheme.GetSRCName.GetSubName\ntheStr = Operation+\" \"+theInputThemeName+\" \"+theOverlayThemeName+\" \"+theOutputTheme.GetSRCName.GetF ileName.AsString+\" \"+\ntheType+\" \"+\"[\"+Date.Now.AsString+\"] [\"+theInputSelRecNum.AsString+\" --> \"+theOutputFTab.GetNumRecords.AsString+\" \"+\n\"shapes] [\"+TotalSec.AsString++\"secs]\"\nav.Run(\"aan.Sub-LogFile\", theStr)\n\ntheOverlayMultiShape = nil\ntheInputTheme = nil\ntheInputFTab.Deactivate\ntheInputFTab = nil\ntheOverlaytheme = nil\ntheOverlayFTab.Deactivate\ntheOvelayFTab = nil\ntheOutputtheme = nil\ntheOutputFTab.Deactivate\ntheOutputFTab = nil\n\nav.PurgeObjects\n\nav.ShowMsg(theStr)\nSystem.Beep\nav.ProcessAllInval s\n\nreturn nil" ) (Script.339 Name: "aanView.Sub-Setup" SourceCode: "' Name: aanView.Sub-SetUp\n'\n' Title: Standard Analysis Script Set Up\n'\n' Topics: Analysis, Themes\n'\n' Description: This script contains the standard initial setup and error checks for all analysis scripts.\n'\n' Script by Mike DeLaune, (Email: mike.g.delaune@state.or.us), Oregon Department of Forestry, 10/123/97. \n'\n' Requires: At least two Fthemes in a View, one of which is a polygon theme. \n'\n' Self: Nil\n'\n' Returns: Two lists: a list of all feature themes in the view and a list of polygon feature themes \n'\n'===========================================================\n \n''''''''''''''''''''''''''''''''''''''\n' Initial set up and error checks:\n''''''''''''''''''''''''''''''''''''''\n \n' Get the active document, which should be a view. Bail if not a view:\ntheView=av.GetActiveDoc\nif (theView.Is(View).Not) then\n MsgBox.Error(\"This script must be run from a view. Exiting\",\"Error\")\n exit\nend\n \n' Build a list of fthemes from the theme list. The user will be asked to select from the list.\nthms=List.Make\nfor ea ch t in theView.GetThemes\n if (t.Is(Ftheme)) then\n thms.Add(t)\n end\nend\n \n' If < 2 themes are fthemes, bail out.\nif (thms.Count < 2) then\n System.Beep\n MsgBox.Error(\"There must be at least two feature themes in the View to proceed! Exiting.\",\"Error\")\n exit\nend\n \n' Build a list of polygon fthemes from the theme list. The user will be asked to select from the list.\npthms=List.Make\nfor each t in thms\n shapetype = t.GetFtab.FindField(\"Shape\").GetType\n if (shapetype = #FIELD_SHAPEPOLY) then\n pthms.Add(t)\n end\nend\n \n' If no themes are polygon fthemes, bail out.\nif (pthms.Count < 1) then\n System.Beep\n MsgBox.Error(\"There must be at least one polygon feature theme in the View to proceed! Exiting.\",\"Error\")\n exit\nend\n \n \n' END OF THE INITIAL SETUP - RETURN LISTS TO CALLING SCRIPT:\n \nReturn {thms,pthms}\n \n" ) (Script.340 Name: "aan.Sub-CalcSize" SourceCode: "' Name: aan.Sub-CalcSize\n'\n' Title: Subroutine Calculate Feature Size\n'\n' Topics: Analysis, Themes\n'\n' Description: This subroutine contains standard routines for calculating Area, Perimeter, and Acres / Hectares\n' for polygons; and Length for polylines. Provides a standard ending process for scripts that modify feature\n' geometry. \n'\n' This script is called by the following scripts: View.CircleTool, View.Polytool, View.RectTool, View.SelectPoint, View.Select,\n' aan.table.calcsize, aanview.calcsize, aanVi ew.ConvertMultipart2Singlepart, aanView.Graphic2Shape, aanView.MergeThemes, \n' aanView.OverlayThemes, aanView.Points2Polygon, aanView.Points2Polyline, aanView.Polygon2Polyline, aanView.Polylines2Polygon,\n' aanView.XtoolsTransferSelectedFeatures.\n'\n' Script by Mike DeLaune, (Email: mike.g.delaune@state.or.us), Oregon Department of Forestry, 10/23/97. \n' Last Revised on 5/21/2001.\n'\n' Requires: A calling script that passes a Theme, FTab, or shape to this scripts SELF variable. \n'\n' Self: An FTab\n'\n' Returns: theFTAB\n'\n'===========================================================\nthmList = SELF\ntheDoc = av.GetActiveDoc\n\n'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''\n' BEGIN THE CALCULATION PROCESS\n'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''\n\n' GET THE XTOOLS DEFAULTS\ntheDefScript = av.GetProject.FindScript( \"XTprojectDefaults\" )\nif(theDefScript <> nil) then\n DefList = theDefScript.AsString.AsList\nelse\n MsgBox.Error(\"Please set XTools Defaults\",\"XTOOLS DEFAULTS NOT SET\")\n return nil\nend\n\n' SET THE DEFAULT VARIABLES.\nDataMapUnits = DefList.Get(1)\nDataMapUnitsEnum = (\"#UNITS_LINEAR_\"+DataMapUnits).AsEnum\nDataMapUnitsEnumStr = (\"#UNITS_LINEAR_\"+DataMapUnits)\nViewMapUnits = DefList.Get(2)\nViewMapUnitsEnum = (\"#UNITS_LINEAR_\"+ViewMapUnits).AsEnum\nViewMapUnitsEnumStr = (\"#UNITS_LINEAR_\"+ViewMapUnits)\nAreaType = DefList.Get(4)\n\n\n' GET THE DEFAULT PROJECTION.\nxtprjexists = FALSE\nthePrj = nil\ntheSpheroidUnits = nil\n\nXTDefView = av.GetProject.FindDoc(\"XTDefView\")\nthePrj = XTDefView .GetProjection\nif(thePrj.IsNull = FALSE) then\n xtprjexists = TRUE\nend\n\n\n'msgbox.info(\"DEBUG: prjname\" + theprj.returnprjname, \"DEBUG\") 'DEBUG\n\n\nif(xtprjexists = true) then\n theSpheroidUnits = thePrj.GetSpheroid.GetUnits\nelseif((xtprjexists = false) and (DataMapUnits = \"Degrees\")) then\n Msgbox.Warning(\"Default data map units are set to degrees. XTools is unable to calculate Area, Perimeter, Acres / Hectares, Length unless a default projection is set. Please \"+\n \"set the default projection and try again .\",\"XTOOLS CALCULATE FEATURE SIZE\")\n av.Run(\"XTdefaults.Open\",nil)\n exit \nend\n\nif( thmList.Get(0) = nil) then\n Return {DataMapUnitsEnum, ViewMapUnitsEnum, ViewMapUnits, theSpheroidUnits, thePrj}\nend\n\n' LOOP THROUGH THE LIST OF SELECTED THEMES. IF THE THEME IS NOT EDITABLE, INFORM THE USER.\nfor each theSrc in thmList\n if(theSrc.Is(SrcName)) then\n theTheme = Theme.Make(theSrc)\n theFTab = theTheme.GetFTab\n elseif (theSrc.Is(Ftab)) then\n theFTab = theSrc\n theTheme = FTheme.Make(theFTab)\n else if (theSrc.Is(FTheme)) then\n theFTab = theSrc.GetFtab\n theTheme = theSrc\n elseif ((theSrc.Is(Polygon)) or (theSrc.Is(Polyline))) then\n theExt = theSrc.ReturnExtent\n test = \"No\"\n if ((thePrj.IsNull = FALSE) and (DataMapUnits = \"Degrees\")) then\n themax = \"180\".AsNumber\n themin = \"-180\".AsNumber\n if((theExt.GetTop > themax) or (theExt.GetTop < themin) or (theExt.GetBottom > themax) or (theExt.GetBottom < themin) or\n (theExt.GetLeft > themax) or (theExt.GetLeft < themi n) or (theExt.GetRight > themax) or (theExt.GetRight < themin)) then\n av.ShowMsg(\"XTools default data map units are set to degrees. The shape produced appears to be projected. Check XTools defaults.\")\n return theSrc \n end\n theSrc = theSrc.ReturnProjected(thePrj)\n \n ' CHECK TO SEE IF THE PROJECTION FAILED. THIS CAN HAPPEN WHEN YOU DO NOT HAVE AN APPROPRIATE PROJECTION SELECTED FOR THE \n ' GEOGRAPHIC AREA WHERE THE SHAPE IS LOCATED.\n if(theSrc.IsNull) then\n av.ShowMsg(\"Shape projection failed. Check XTools defaults to see if you have an appropriate Projection specified \"+\n \"for the geographic area.\")\n exit\n end\n \n DataMapUnitsEnum = theSpheroidUnits\n test = \"Yes\"\n end\n if(theSrc.Is(Polygon)) then\n theAcres = Units.ConvertArea(theSrc.ReturnArea,DataMapUnitsEnum,#UNITS_LINEAR_FEET) / 43560\n theHectares = Units.ConvertArea(theSrc.ReturnArea,DataMapUnitsEnum,#UNITS_LINEAR_METERS) / 10000\n ' MsgBox.Li stAsString({theAcres,theHectares,DataMapUnitsEnum,theSpheroidUnits,thePrj,test},\"\",\"\")\n Return {theAcres, theHectares}\n elseif(theSrc.Is(Polyline)) then\n theLength = Units.Convert(theSrc.ReturnLength,DataMapUnitsEnum,ViewMapUnitsEnum)\n Return {theLength, ViewMapUnits}\n end\n else\n av.ShowMsg(\"Invalid data source for area, perimeter, acres / hectares, and length calculations!\")\n exit\n end \n \n ' CHECK TO SEE IF THE DATA IS CONSISTENT WITH THE DEFAULT SETTINGS AND EXIT IF NOT.\n theExt = theTheme.ReturnExtent\n if ((thePrj.IsNull = FALSE) and (DataMapUnits = \"Degrees\")) then\n themax = \"180\".AsNumber\n themin = \"-180\".AsNumber\n if((theExt.GetTop > themax) or (theExt.GetTop < themin) or (theExt.GetBottom > themax) or (theExt.GetBottom < themin) or\n (theExt.GetLeft > themax) or (theExt.GetLeft < themin) or (theExt.GetRight > themax) or (theExt.GetRight < themin)) then\n av.ShowMsg(\"Feature size calculation not done. XTools default data map units are set to degrees. The theme or table appears to be projected. Check XTools defaults.\")\n return theSrc \n end\n end \n\n if (theFTab.CanEdit.Not) then\n MsgBox.Info(\"The feature table (FTab) for theme:\"++theTheme.AsString++\" is not editable.\",\n \"CALCULATE FEATURE SIZE\")\n Continue\n end\n \n ' CHECK TO SEE IF THE FTAB IS ALREADY EDITABLE, AND SAVE THAT INFO\n wasEditable = theFTab.IsEditable\n\n ' MAKE THE FTAB EDITABLE, AND FIND OUT WHICH TYPE OF FEATURE IT IS.\n theFTab.SetEditable(TRUE)\n' theFTab.GetSelection.Cle arall\n' theFTab.UpdateSelection\n theType = theFTab.FindField(\"shape\").GetType\n \n ' CALCULATIONS TO USE IF THE DATA IS ALREADY PROJECTED.\n if (theType = #FIELD_SHAPEPOLY) then\n \n ' IF IT'S POLYGONAL CHECK FOR THE EXISTENCE OF THE FIELDS \"AREA\", \"PERIMETER\", AND \"ACRES\".\n ' IF THEY DO NOT EXIST, CREATE THEM.\n \n' '''''''''''''''''''''''''''\n \n ' AREA ADD / CALCULATE:\n if (theFTab.FindField(\"Area\") = nil) then\n theAreaField = Field.Make(\"Area\",#FIELD_DOUBLE,16,3)\n theFTab. AddFields({theAreaField})\n else\n theAreaField = theFTab.FindField(\"Area\")\n theShapeField = theFTab.FindField(\"Shape\")\n end\n theAreaField.SetAlias(\"Area_\"+ViewMapUnits)\n \n if ((DataMapUnits = ViewMapUnits) and (DataMapUnits <> \"Degrees\")) then\n theFtab.Calculate(\"[Shape].ReturnArea\",theAreaField)\n elseif ((DataMapUnits <> ViewMapUnits) and (DataMapUnits <> \"Degrees\")) then\n theFtab.Calculate(\"Units.ConvertArea([Shape].ReturnArea,\"+DataMapUnitsEnumStr+\",\"+ViewMapUnitsEnum Str+\")\",theAreaField)\n end \n \n ' PERIMETER ADD / CALCULATE\n if (theFTab.FindField(\"Perimeter\") = nil) then\n thePerimeterField = Field.Make(\"Perimeter\",#FIELD_DOUBLE,16,3)\n theFTab.AddFields({thePerimeterField})\n else\n thePerimeterField = theFTab.FindField(\"Perimeter\")\n end\n thePerimeterField.SetAlias(\"Perimeter_\"+ViewMapUnits)\n \n if ((DataMapUnits = ViewMapUnits) and (DataMapUnits <> \"Degrees\")) then\n theFtab.Calculate(\"[Shape].ReturnLength\",thePerimeterFi eld)\n elseif ((DataMapUnits <> ViewMapUnits) and (DataMapUnits <> \"Degrees\")) then\n theFtab.Calculate(\"Units.Convert([Shape].ReturnLength,\"+DataMapUnitsEnumStr+\",\"+ViewMapUnitsEnumStr+\")\",thePerimeterField)\n end \n\n ' ACRES ADD / CALCULATE\n 'ADD ACRES FIELD\n if ((theFTab.FindField(\"Acres\") = nil) and ((AreaType = \"Acres\") or (AreaType = \"Both\"))) then\n theAcresField = Field.Make(\"Acres\",#FIELD_DOUBLE,16,3)\n theFTab.AddFields({theAcresField})\n else\n theAcresField = theF Tab.FindField(\"Acres\")\n end\n \n 'ADD HECTARES FIELD\n if ((theFTab.FindField(\"Hectares\") = nil) and ((AreaType = \"Hectares\") or (AreaType = \"Both\"))) then\n theHectaresField = Field.Make(\"Hectares\",#FIELD_DOUBLE,16,3)\n theFTab.AddFields({theHectaresField})\n else\n theHectaresField = theFTab.FindField(\"Hectares\")\n end\n\n \n if ((AreaType = \"Acres\") or (AreaType = \"Both\")) then\n if (DataMapUnits = \"Feet\") then\n theFtab.Calculate(\"[Shape].ReturnArea / 43560\", th eAcresField)\n elseif ((DataMapUnits <> \"Feet\") and (DataMapUnits <> \"Degrees\")) then\n theFtab.Calculate(\"Units.ConvertArea([Shape].ReturnArea,\"+DataMapUnitsEnumStr+\",#UNITS_LINEAR_FEET) / 43560\", theAcresField)\n end \n end\n if ((AreaType = \"Hectares\") or (AreaType = \"Both\")) then\n if (DataMapUnits = \"Meters\") then\n theFtab.Calculate(\"[Shape].ReturnArea / 10000\", theHectaresField)\n elseif ((DataMapUnits <> \"Meters\") and (DataMapUnits <> \"Degrees\")) then\n theFtab. Calculate(\"Units.ConvertArea([Shape].ReturnArea,\"+DataMapUnitsEnumStr+\",#UNITS_LINEAR_METERS) / 10000\", theHectaresField)\n end \n end\n \n \n elseif (theType = #FIELD_SHAPELINE) then\n \n ' LENGTH ADD / CALCULATE\n if (theFTab.FindField(\"Length\") = nil) then\n theLengthField = Field.Make(\"Length\",#FIELD_DOUBLE,16,3)\n theFTab.AddFields({theLengthField})\n else\n theLengthField = theFTab.FindField(\"Length\")\n end\n theLengthField.SetAlias(\"Length_\"+ViewMapUnits)\n \n if ((DataMapUnits = ViewMapUnits) and (DataMapUnits <> \"Degrees\")) then\n theFtab.Calculate(\"[Shape].ReturnLength\",theLengthField)\n elseif ((DataMapUnits <> ViewMapUnits) and (DataMapUnits <> \"Degrees\")) then\n theFtab.Calculate(\"Units.Convert([Shape].ReturnLength,\"+DataMapUnitsEnumStr+\",\"+ViewMapUnitsEnumStr+\")\",theLengthField)\n end \n \n end ' END THE IF THETYPE = ...\n \n '''''''''''''''''''''''''''\n \n ' CALCULATION ROUTINES TO USE IF THE DATA NEEDS TO BE PROJECTED. \n if ((thePrj .IsNull = FALSE) and (DataMapUnits = \"Degrees\")) then\n theShapeField = theFTab.FindField(\"Shape\")\n For each rec in theFTab\n theInputShape = theFTab.ReturnValue(theShapeField,rec)\n theNewShape = theInputShape.ReturnProjected(thePrj)\n \n if (theType = #FIELD_SHAPEPOLY) then\n theFTab.SetValue(theAreaField,rec,Units.ConvertArea(theNewShape.ReturnArea,theSpheroidUnits,ViewMapUnitsEnum))\n theFTab.SetValue(thePerimeterField,rec,Units.Convert(theNewShape.ReturnLength,theSphero idUnits,ViewMapUnitsEnum))\n if ((AreaType = \"Acres\") or (AreaType = \"Both\")) then\n theFTab.SetValue(theAcresField,rec,Units.ConvertArea(theNewShape.ReturnArea,theSpheroidUnits,#UNITS_LINEAR_FEET) / 43560) \n end \n if ((AreaType = \"Hectares\") or (AreaType = \"Both\")) then\n theFTab.SetValue(theHectaresField,rec,Units.ConvertArea(theNewShape.ReturnArea,theSpheroidUnits,#UNITS_LINEAR_METERS) / 10000)\n end\n elseif (theType = #FIELD_SHAPELINE) then\n t heFTab.SetValue(theLengthField,rec,theNewShape.ReturnLength)\n end\n end \n end \n''''''''''''''''''''''''''\n\n if(wasEditable = false) then\n theFTab.SetEditable(FALSE)\n end \n \n if((theDoc.Is(View) and theSrc.Is(SrcName))) then\n thms = theDoc.GetThemes\n for each t in thms\n if(t.GetSrcName.AsString = theSrc.AsString) then\n t.GetFtab.Refresh\n end\n av.PurgeObjects\n end\n elseif((theDoc.Is(View) and theSrc.Is(Ftab))) then\n theFTab.Refresh\n Return theFTab\n end\n if(theDoc.Is(Table)) then\n theDoc.GetWin.Invalidate\n end \n \n av.PurgeObjects \n \nend ' END THE FOR EACH THESRC IN SRCLIST\n\nReturn nil\n" ) (Script.341 Name: "aan.Sub-Multi2Single" SourceCode: "' Name: aan.Sub-Multi2Single\n' \n' Title: Convert MultiPart Shapes To Single Part\n'\n' Topics: GeoData\n'\n' Description: Provides MultiPart to Single part conversion. Conversion only \n' done on selected records if there are selected records. If there are no \n' selected records, then records with multipart shapes are selected.\n'\n' Script by Mike DeLaune, (Email: mike.g.delaune@state.or.us), Oregon Department \n' of Forestry, 4/29/2000. Last modified 5/8/2001.\n'\n' Requires: \n'\n' Self: SELF is an FTab p assed to this subroutine.\n'\n' Returns: An altered FTab with additional records.\n'=========================================================== \n \n'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''\n' BEGIN THE CONVERSION PROCESS\n'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''\n\n' GET INFO ABOUT THE FTAB TO BE PROCESSED.\ntheInputFTab = SELF\ntheInputShapeField = theInputFTab.FindField(\"shape\")\ntheInputShapeFieldType = theInputFTab.FindField(\"shape\").GetType\ntheOldtheInputSelRecs = theInputFTab.GetSelection.Clone\n \n' IF THE FTAB CONTAINS SELECTED RECORDS, THEN ASSUME THAT THEY ARE THE MULTIPART SHAPE RECORDS AND SKIP THE FOLLOWING SELECTION PROCESS.\nif(theInputFTab.GetSelection.Count = 0) then\n ' SET THE APPROPRIATE QUERY TO DETERMINE IF THERE ARE MULTIPART SHAPES IN THE FTAB. RETURN IF SHAPE TYPE IS POINT.\n if (theInputShapeFieldType = #FIELD_SHAPELINE) then \n theQueryStr = \"[Shape].CountParts > 1\"\n theNullShape = Polyline.MakeNull\n elseif (theInputShapeFieldType = #FIELD _SHAPEMULTIPOINT) then\n theQueryStr = \"[Shape].Count > 1\"\n theNullShape = MultiPoint.MakeNull\n elseif (theInputShapeFieldType = #FIELD_SHAPEPOINT) then\n Return theInputFtab\n elseif (theInputShapeFieldType = #FIELD_SHAPEPOLY) then\n theQueryStr = \"[Shape].Explode.Count > 1\"\n theNullShape = Polygon.MakeNull\n end\n \n theInputFTab.Query(theQueryStr, theInputFTab.GetSelection, #VTAB_SELTYPE_NEW )\n \n ' IF NO RECORDS CONTAIN MULTIPART SHAPES, RETURN.\n if (theInputFTab.GetSelection.Count = 0) then\n Return theInputFtab\n end\nend\n\ntheInputSelRecs = theInputFTab.GetSelection.Clone\n \n' MAKE A LIST OF INPUT THEME FIELDS, EXCLUDING THE SHAPE FIELD.\ntheInputfields = List.Make\nfor each f in theInputFTab.GetFields\n if (f.GetName = \"Shape\") then\n continue\n else \n theInputFields.Add(f)\n end\nend\n\n' SET UP PROGRESS ROUTINE.\ncurrentrec = 0 \nav.ShowStopButton\ntotalrec = theInputSelRecs.Count\nav.ShowMsg(\"Converting \"+totalrec.AsString+\" Multipart Shapes to Single Part Shapes....\")\n \n' MA IN lOOP\nfor each rec in theInputSelRecs\n\n ' SHOW PROGRESS ROUTINE:\n currentrec = currentrec + 1\n progress = (currentrec / totalrec) * 100\n proceed = av.SetStatus( progress )\n if (proceed.Not) then\n av.ShowMsg( \"Stopped\" )\n exit\n end\n \n theInputShape = theInputFTab.ReturnValue(theInputShapeField,rec)\n \n if (theInputShapeFieldType = #FIELD_SHAPEMULTIPOINT) then\n shapelist = {}\n shapelistTemp = theInputShape.AsList\n for each shp in shapelistTemp\n shapelist.Add(Multipoint.Make({ shp}))\n end \n else\n shapeList = theInputShape.Explode\n end\n \n for each ashape in shapelist\n ' ADD THE SHAPE TO THE NEW FTAB\n newrec = theInputFtab.AddRecord\n theInputFtab.SetValue(theInputShapeField,newrec,ashape)\n \n ' ADD THE ATTRIBUTE DATA FROM THE INPUT THEME:\n if (((theInputFields = nil).Not) and (theInputFields.Count > 0)) then\n for each afield in theInputFields\n oldfield = theInputFTab.FindField(afield.GetAlias)\n oldvalue = theInputFTab.ReturnValue(oldfi eld,rec)\n theInputFtab.SetValue(afield,newrec,oldvalue)\n end\n end\n end \nend ' END OF FOR EACH REC IN THEINPUTSELRECS\n\n' CLEAR OUT ANY EMPTY SHAPES:\ntheInputFtab.RemoveRecords(theInputFtab.GetSelection)\n \nReturn theInputFtab\n" ) (Script.342 Name: "aan.Sub-LogFile" SourceCode: "theStr = SELF\n\n' OUTPUT TO AN XTOOLS LOG FILE:\ntheXtLogName = Filename.Make(\"$HOME/xtlog.txt\").GetFullName.AsFilename\nxtlogexists = File.Exists(theXtLogName)\nif(xtlogexists = false) then\n theXtLogFile = LineFile.Make(theXtLogName, #FILE_PERM_CLEARMODIFY)\n theXtLogFile.WriteElt(\"[OPERATION] [INPUT THEME] [OVERLAY THEME] [OUTPUT THEME] [FEATURE TYPE] \"+\n \"[OPERATION ENDING TIME] [PROCESSING TIME]\") \nelse\n theXtLogFile = LineFile.Make(theXtLogName, #FILE_PERM_APPEND)\nend\n\ntheXtLogFile.WriteElt (theStr)\ntheXtLogFile.Close\n\nReturn nil\n" ) (Script.343 Name: "aan.Sub-ShapeFileDelete" SourceCode: "' SELF IS A SHAPEFILE FILENAME THAT HAS BEEN FORWARDED FOR DELETING\n\ntheFileName = SELF\n\nif (File.CanDelete(theFileName)) then\n File.Delete(theFileName)\n theBase = theFileName.AsString.AsTokens(\".\").Get(0)\n if(File.CanDelete((theBase+\".shx\").AsFileName)) then\n File.Delete((theBase+\".shx\").AsFileName)\n end\n if(File.CanDelete((theBase+\".dbf\").AsFileName)) then\n File.Delete((theBase+\".dbf\").AsFileName)\n end\n if(File.CanDelete((theBase+\".sbn\").AsFileName)) then\n File.Delete((theBase+\".sbn\").AsF ileName)\n end\n if(File.CanDelete((theBase+\".sbx\").AsFileName)) then\n File.Delete((theBase+\".sbx\").AsFileName)\n end\nend\n\nreturn nil\n" ) (Script.344 Name: "aanView.Sub-MakeTheme" SourceCode: "' This subroutine is called from aanView.Batchoverlay. It is used to make a theme from a source name passed to it.\n' This is done in a separate subroutine so that an error in the sourcename specified will not cause the batch routine to bail out.\ntheSrcName = SELF\ntheTheme = Theme.Make(theSrcName)\nreturn theTheme" ) (Script.345 Name: "XTdefaults.Update" SourceCode: "msgshow = SELF\n\nProjectName = \"Unnamed\"\nif(av.GetProject.GetFileName <> nil) then\n ProjectName = av.GetProject.GetName\nend \nLocalLoc = \"No\"\nSystemLoc = \"\"\n\n\n' OPEN UP THE DEFAULTS DIALOG AND FIND THE OBJECTS CONTAINING THE DEFAULTS.\nxtdial = av.FindDialog(\"XTDefaults\")\ntheMapUnitsListBox = xtdial.FindByName(\"MapUnitsComboBox\")\ntheViewMapUnitsListBox = xtdial.FindByName(\"ViewMapUnitsComboBox\")\ntheDistanceUnitsListBox = xtdial.FindByName(\"DistanceUnitsComboBox\")\ntheAreaListBox = xtdial.FindByName(\"AreaComb oBox\")\ntheOverlayConvertListBox = xtdial.FindByName(\"OverlayConvertComboBox\")\ntheAreaCalcListBox = xtdial.FindByName(\"AreaCalcComboBox\")\ntheProjectionLabel = xtdial.FindByName(\"ProjectionLabel\")\ntheSpheroidLabel = xtdial.FindByName(\"SpheroidLabel\")\ntheNewViewWarn = xtdial.FindByName(\"cbNewViewWarn\")\ntheXTdefaultsWarn = xtdial.FindByName(\"cbXTdefaultsWarn\")\n\n\n' REMOVE THE SCRIPT CONTAINING THE DEFAULTS, IF IT EXISTS.\ntheScript = av.GetProject.FindScript(\"XTprojectDefaults\")\nif(theScript <> nil) then\n av.Ge tProject.RemoveScript(\"XTprojectDefaults\")\nend\n\n' REMOVE THE SED CONTAINING THE DEFAULTS, IF IT EXISTS.\ntheDoc = av.GetProject.FindDoc(\"XTprojectDefaults\")\nif (theDoc <> nil) then\n av.GetProject.RemoveDoc(theDoc)\n av.GetProject.SetSelectedGUI (av.GetProject.FindGUI(\"View\"))\nend\n \n' MAKE THE SED IN WHICH THE DEFAULTS WILL BE STORED LOCALLY AND WRITE THE DEFAULTS TO IT.\ntheDefSEd = SEd.Make\ntheDefSEd.SetName(\"XTprojectDefaults\")\ntheAreaStr = theAreaListBox.GetCurrentValue\nif(theAreaStr = \"Both Acres and Hectares\") then\n theAreaStr = \"Both\"\nend\ntheDefStr = \"'XTDEFAULTS\" ++ theMapUnitsListBox.GetCurrentValue ++ theViewMapUnitsListBox.GetCurrentValue ++\n theDistanceUnitsListBox.GetCurrentValue ++ theAreaStr ++ theOverlayConvertListBox.GetCurrentValue ++\n theAreaCalcListBox.GetCurrentValue ++ theNewViewWarn.IsSelected.AsString ++ theXTdefaultsWarn.IsSelected.AsString\n\ntheDefSEd.SetSource(theDefStr)\ntheDefSEd.Compile\ntheScript = theDefSEd.GetScript\nav.GetProject.AddScript( theScript )\nav.GetProject.RemoveDo c( theDefSEd )\nav.GetProject.SetSelectedGUI (av.GetProject.FindGUI(\"View\"))\n\n' MAKE THE PROJECT SUBDIRECTORY XTDEFAULTS.TXT FILE AND WRITE THE DEFAULTS TO IT.\nif(av.GetProject.GetFileName <> nil) then\n theXtDefName = Filename.Make(av.GetProject.GetFileName.ReturnDir.AsString + \"/xtdefaults.txt\").GetFullName.AsFilename\n theXtDefFile = LineFile.Make(theXtDefName, #FILE_PERM_WRITE)\n xtdefexists = File.Exists(theXtDefName)\n if(xtdefexists = true) then\n theXtDefFile.WriteElt(theMapUnitsListBox.GetCurrent Value + \" (The map units of your data.)\")\n theXtDefFile.WriteElt(theViewMapUnitsListBox.GetCurrentValue + \" (Desired default output map units for area and length calculations.)\")\n theXtDefFile.WriteElt(theDistanceUnitsListBox.GetCurrentValue + \" (Desired default View Properties distance units.)\")\n theXtDefFile.WriteElt(theAreaListBox.GetCurrentValue + \" (Desired units for area outputs.)\")\n theXtDefFile.WriteElt(theOverlayConvertListBox.GetCurrentValue + \" (Always convert overlay o utput shapes to single part?)\")\n theXtDefFile.WriteElt(theAreaCalcListBox.GetCurrentValue + \" (Always calculate Area, Perimeter, Acres (Hectares), Length?)\")\n theXtDefFile.WriteElt(theNewViewWarn.IsSelected.AsString + \" (Do not show XTools defaults when a new view is created.)\")\n theXtDefFile.WriteElt(theXTdefaultsWarn.IsSelected.AsString + \" (Do not show XTools defaults when XTools is loaded into a project without saved defaults.)\")\n theXtDefFile.Close\n LocalLoc = theXtDefName\n end \nend\n\n' MAKE THE $HOME XTDEFAULTS.TXT FILE AND WRITE THE DEFAULTS TO IT.\ntheXtDefName = Filename.Make(\"$HOME/xtdefaults.txt\").GetFullName.AsFilename\ntheXtDefFile = LineFile.Make(theXtDefName, #FILE_PERM_WRITE)\nxtdefexists = File.Exists(theXtDefName)\nif(xtdefexists = true) then\n theXtDefFile.WriteElt(theMapUnitsListBox.GetCurrentValue + \" (The map units of your data.)\")\n theXtDefFile.WriteElt(theViewMapUnitsListBox.GetCurrentValue + \" (Desired default output map units for area and length calculati ons.)\")\n theXtDefFile.WriteElt(theDistanceUnitsListBox.GetCurrentValue + \" (Desired default View Properties distance units.)\")\n theXtDefFile.WriteElt(theAreaListBox.GetCurrentValue + \" (Desired units for area outputs.)\")\n theXtDefFile.WriteElt(theOverlayConvertListBox.GetCurrentValue + \" (Always convert overlay output shapes to single part?)\")\n theXtDefFile.WriteElt(theAreaCalcListBox.GetCurrentValue + \" (Always calculate Area, Perimeter, Acres (Hectares), Length?)\")\n theXtDefFile.WriteElt( theNewViewWarn.IsSelected.AsString + \" (Do not show XTools defaults when a new view is created.)\")\n theXtDefFile.WriteElt(theXTdefaultsWarn.IsSelected.AsString + \" (Do not show XTools defaults when XTools is loaded into a project without saved defaults.)\")\n theXtDefFile.Close\n SystemLoc = theXtDefName\nend\n\n' DEFAULT VIEW INFORMATION:\nXTDefView = av.FindDoc( \"XTDefView\")\n\n' IF THE DEFAULT PROJECTION FILE EXISTS, OPEN IT AND GET THE DEFAULT PROJECTION.\n' FIRST CHECK IN THE CURRENT PROJECT:\nXTDefPr jExists = FALSE\nif(XTDefView <> nil) then\n XTDefPrj = XTDefView.GetProjection\n thePrjName = XTDefPrj.GetName\n XTDefPrjExists = TRUE\nend\n\n' CHECK TO SEE IF THE MAP UNITS OR VIEW UNITS ARE DEGREES\ntheMapUnitsDeg = (theMapUnitsListBox.GetCurrentValue = \"Degrees\")\ntheViewUnitsDeg = (theViewMapUnitsListBox.GetCurrentValue = \"Degrees\")\n\n' CONSISTENCY CHECK #1\nif(theMapUnitsDeg and theViewUnitsDeg and XTDefPrjExists and (thePrjName <> \"Geographic\") and (thePrjName.IsNull = False)) then\n' msgbox.info(thePr jName.count.asstring,\"\")\n MsgBox.Warning(\"If data map units (#1) are Degrees and output map units (#2) are Degrees, then the Projection can \"+\n \"only be ''Geographic'' or not set. Deleting Projection.\",\"Warning: Inconsistent Defaults!\")\nend \n\n' CONSISTENCY CHECK #2\nif(theMapUnitsDeg and (theViewUnitsDeg = FALSE) and ((XTDefPrjExists = FALSE) or (thePrjName = \"Geographic\") or \n (thePrjName.IsNull = TRUE))) then\n MsgBox.Warning(\"If data map units (#1) are Degrees and output map units (#2) are not Degr ees, then the Projection can \"+\n \"not be ''Geographic'' or not set. Change units default, or set a projection.\",\"Warning: Inconsistent Defaults!\")\n Exit\nend \n\n' CONSISTENCY CHECK #3\nif((theMapUnitsDeg = FALSE) and theViewUnitsDeg) then\n MsgBox.Warning(\"If data map units (#1) are not Degrees, output map units (#2) can not be degrees.\",\"Warning: Inconsistent Defaults!\")\n Exit\nend \n\n' CONSISTENCY CHECK #4\nif((theMapUnitsDeg = FALSE) and (theViewUnitsDeg = FALSE) and XTDefPrjExists and (thePrjName <> \"Ge ographic\") and \n (thePrjName.IsNull = False)) then\n MsgBox.Warning(\"If data map units (#1) are not Degrees and output map units (#2) are not Degrees, then the Projection can \"+\n \"only be ''Geographic'' or not set. Deleting Projection.\",\"Warning: Inconsistent Defaults!\")\nend \n \n' DELETE THE XTDEFAULT.PRJ FILE IF THE DATA MAP UNITS ARE NOT DEGREES, OR VIEW MAP UNITS ARE DEGREES OR UNKNOWN.\nif ((theMapUnitsListBox.GetCurrentValue <> \"Degrees\") or ((theViewMapUnitsListBox.GetCurrentValue = \"Degrees\") or \n (theViewMapUnitsListBox.GetCurrentValue = \"Unknown\"))) then\n XTDefView.SetProjection(Prj.MakeNull)\n theProjectionLabel.SetLabel(\"VIEW DEFAULT PROJECTION NOT SET.\")\n theSpheroidLabel.SetLabel(\" \")\nend\n\n' SET THE VIEW MAP UNITS AND DISTANCE UNITS:\nif(XTDefPrj.IsNull = FALSE) then\n theEnum = (\"#UNITS_LINEAR_\"+theViewMapUnitsListBox.GetCurrentValue).AsEnum\nelse\n theEnum = (\"#UNITS_LINEAR_\"+theMapUnitsListBox.GetCurrentValue).AsEnum\nend \nXTDefView.SetUnits(theEnum)\ntheEnum2 = (\"#UNITS_LINEAR_\"+theDistance UnitsListBox.GetCurrentValue).AsEnum\nXTDefView.GetDisplay.SetDistanceUnits(theEnum2)\n\nif(av.GetProject.FindDoc( \"XTprojectDefaults\" ) <> nil) then\n av.GetProject.RemoveDoc( av.GetProject.FindDoc( \"XTprojectDefaults\" ) )\n av.GetProject.SetSelectedGUI (av.GetProject.FindGUI(\"View\"))\nend\n\nif(System.GetOS = #SYSTEM_OS_MSW ) then\n LocalLoc = LocalLoc.AsString.Substitute(\"/\",\"\\\")\n SystemLoc = SystemLoc.AsString.Substitute(\"/\",\"\\\")\n LocalLoc = LocalLoc.AsString.Substitute(\"\\\\\",\"\\\")\n SystemLoc = SystemLoc.AsS tring.Substitute(\"\\\\\",\"\\\")\nend\n\nif(System.GetOS = #SYSTEM_OS_UNIX ) then\n LocalLoc = LocalLoc.AsString.Substitute(\"\\\",\"/\")\n SystemLoc = SystemLoc.AsString.Substitute(\"\\\",\"/\")\n LocalLoc = LocalLoc.AsString.Substitute(\"//\",\"/\")\n SystemLoc = SystemLoc.AsString.Substitute(\"//\",\"/\")\nend\n\nMsgBox.Info(\"XTools defaults have been saved to the \"++ProjectName++\"Project,\"++LocalLoc.AsString++\n \"local subdirectory, and\"++SystemLoc.AsString++\"system location.\",\"\")" ) (Script.346 Name: "XTdefaults.Close" SourceCode: "' CHECK TO SEE IF ANYTHING HAS CHANGED SINCE LAST UPDATE AND EXIT IF NOT.\nxtdial = av.FindDialog(\"XTDefaults\")\ntheMapUnitsListBox = xtdial.FindByName(\"MapUnitsComboBox\")\ntheViewMapUnitsListBox = xtdial.FindByName(\"ViewMapUnitsComboBox\")\ntheDistanceUnitsListBox = xtdial.FindByName(\"DistanceUnitsComboBox\")\ntheAreaListBox = xtdial.FindByName(\"AreaComboBox\")\ntheOverlayConvertListBox = xtdial.FindByName(\"OverlayConvertComboBox\")\ntheAreaCalcListBox = xtdial.FindByName(\"AreaCalcComboBox\")\ntheNewViewWarn = xtdial. FindByName(\"cbNewViewWarn\")\ntheXTdefaultsWarn = xtdial.FindByName(\"cbXTdefaultsWarn\")\n\n\n' READ IN THE DEFAULTS AND SET THEM IN THE DIALOG.\nGoodCheck = TRUE\nDefaultList = nil\ntheDefScript = nil\ntheDefScript = av.GetProject.FindScript( \"XTprojectDefaults\" )\nif(theDefScript <> nil) then\n theDefStr = theDefScript.AsString\n DefaultList = theDefStr.AsList\n \n theCount = DefaultList.Count\n if(theCount < 9) then\n Msgbox.Info(\"The XTools Defaults stored in this project are in an older format and \" + \n \"ne ed to be updated. Please respecify your defaults, and then \"\n + \"press the ''Save Defaults'' button.\", \"UPDATE DEFAULTS FOR NEW XTOOLS VERSION\")\n return nil\n end\n\n if(theMapUnitsListBox.GetCurrentValue <> DefaultList.Get(1)) then\n GoodCheck = FALSE\n end \n if(theViewMapUnitsListBox.GetCurrentValue <> DefaultList.Get(2)) then\n GoodCheck = FALSE\n end \n if(theDistanceUnitsListBox.GetCurrentValue <> DefaultList.Get(3)) then\n GoodCheck = FALSE\n end \n theAreaTemp = theAreaListBox.GetCurre ntValue\n if(theAreaTemp = \"Both Acres and Hectares\") then\n theAreaTemp = \"Both\"\n end \n if(theAreaTemp <> DefaultList.Get(4)) then\n GoodCheck = FALSE\n end \n if(theOverlayConvertListBox.GetCurrentValue <> DefaultList.Get(5)) then\n GoodCheck = FALSE\n end \n if(theAreaCalcListBox.GetCurrentValue <> DefaultList.Get(6)) then\n GoodCheck = FALSE\n end \n if(theNewViewWarn.IsSelected.AsString <> DefaultList.Get(7)) then\n GoodCheck = FALSE\n end \n if(theXTdefaultsWarn.IsSelected.AsString < > DefaultList.Get(8)) then\n GoodCheck = FALSE\n end \nelse\n GoodCheck = FALSE\nend\n\nif( GoodCheck = FALSE ) then\n answer = MsgBox.YesNo(\"One or more Xtools Defaults Dialog settings are different from the stored default settings.\"++\n \"Do you wish to save the Defaults? (Press YES to save defaults and exit or NO to exit without saving.\",\n \"XTOOLS DEFAULTS CHECK\", TRUE)\n if(answer = TRUE) then\n av.Run(\"XTDefaults.Update\", nil)\n else\n if(DefaultList <> nil) then\n theMapUnitsListBox.FindByValu e(DefaultList.Get(1))\n theMapUnitsListBox.SelectCurrent\n theViewMapUnitsListBox.FindByValue(DefaultList.Get(2))\n theViewMapUnitsListBox.SelectCurrent\n theDistanceUnitsListBox.FindByValue(DefaultList.Get(3))\n theDistanceUnitsListBox.SelectCurrent\n theStr = DefaultList.Get(4)\n if (theStr = \"Both\") then\n theStr = theStr + \" Acres and Hectares\"\n end\n theAreaListBox.FindByValue(theStr)\n theAreaListBox.SelectCurrent\n theOverlayConvertListBox.FindByValu e(DefaultList.Get(5))\n theOverlayConvertListBox.SelectCurrent\n theAreaCalcListBox.FindByValue(DefaultList.Get(6))\n theAreaCalcListBox.SelectCurrent\n if (DefaultList.Get(7) = \"TRUE\") then\n theNewViewWarn.SetSelected(TRUE)\n else\n theNewViewWarn.SetSelected(FALSE)\n end\n if (DefaultList.Get(8) = \"TRUE\") then\n theXTdefaultsWarn.SetSelected(TRUE)\n else\n theXTdefaultsWarn.SetSelected(FALSE)\n end \n\n end \n end\nend \n\nif(av.GetProject.FindDo c( \"XTprojectDefaults\" ) <> nil) then\n av.GetProject.RemoveDoc( av.GetProject.FindDoc( \"XTprojectDefaults\" ) )\n av.GetProject.SetSelectedGUI (av.GetProject.FindGUI(\"View\"))\nend\n\nxtdial.Close \nReturn nil" ) (Script.347 Name: "XTdefaults.Load" SourceCode: "' IF THE DEFAULTS ARE ALREADY STORED LOCALLY, SKIP THE REST. \n' CHECK FOR EXTERNAL DEFAULTS FILES IN THE PROJECT DIRECTORY AND AT $HOME.\nxtdefset = TRUE\ntheDefScript = av.GetProject.FindScript(\"XTprojectDefaults\")\ntheDefString = \"\"\n\n' IF THE DEFAULT SCRIPT EXISTS, CHECK TO SEE IF IT IS AN UP-TO-DATE VERSION.\nif(theDefScript <> nil) then\n theDefString = theDefScript.AsString\n av.GetProject.RemoveScript(\"XTprojectDefaults\")\n if(theDefString.AsList.Count < 9) then\n Msgbox.Info(\"The XTools Defaults st ored in this Project are in an \" +\n \"older format and need to be updated. Please respecify your defaults, and then \"\n + \"press the ''Save Defaults'' button.\", \"UPDATE DEFAULTS FOR NEW XTOOLS VERSION\")\n theDefString = \"\"\n else\n av.ShowMsg (\"The XTools Defaults are set to the stored defaults for this Project.\") \n end\nend\n\nif(theDefString = \"\") then\n\n ' CHECK TO SEE IF THERE IS A DEFAULTS FILE IN THE LOCAL PROJECT SUBDIRECTORY OR IN $HOME. \n if(av.GetProject.GetFileName <> nil) then\n theXt DefName = Filename.Make(av.GetProject.GetFileName.ReturnDir.AsString + \"/xtdefaults.txt\").GetFullName.AsFilename\n xtdefexists = File.Exists(theXtDefName)\n if(xtdefexists = false) then\n theXtDefName = Filename.Make(\"$HOME/xtdefaults.txt\").GetFullName.AsFilename\n xtdefexists = File.Exists(theXtDefName)\n end \n else\n theXtDefName = Filename.Make(\"$HOME/xtdefaults.txt\").GetFullName.AsFilename\n xtdefexists = File.Exists(theXtDefName)\n end\n \n ' IF THE DEFAULT FILE EXISTS, OPEN IT, RE AD IN THE VALUES, AND SET THE COMBO BOXES TO THE VALUES FROM THE FILE.\n if(xtdefexists = true) then\n theXtDefFile = LineFile.Make(theXtDefName, #FILE_PERM_READ)\n DefaultList = List.Make\n DefaultList2 = List.Make \n theXtDefFile.Read(DefaultList2,8)\n For each thing in DefaultList2\n if (thing.AsList.Count <> 0) then\n DefaultList.Add(thing.AsList.Get(0))\n end \n end\n \n ' CHECK TO SEE IF THE EXTERNAL DEFAULTS ARE CURRENT. IF THEY ARE, THEN CREATE THE DEFAULT SCRIPT.\n if(DefaultList.Count < 8) then\n Msgbox.Info(\"The XTools Defaults stored in \" + theXtDefFile.GetFileName.GetFullName.AsString + \" are in an \" +\n \"older format and need to be updated. Please respecify your defaults, and then \"\n + \"press the ''Save Defaults'' button.\", \"UPDATE DEFAULTS FOR NEW XTOOLS VERSION\")\n else\n theDefString = \"'XTDEFAULTS\" ++ DefaultList.Get(0) ++ DefaultList.Get(1) ++\n DefaultList.Get(2) ++ DefaultList.Get(3) ++ DefaultList.Get(4) ++\n DefaultList.Get( 5) ++ DefaultList.Get(6) ++ DefaultList.Get(7) \n end\n \n theXtDefFile.Close\n av.ShowMsg (\"The initial XTools Defaults are set to the defaults stored in \" + theXtDefName.AsString)\n \n end 'if((xtdefexists = true) AND (xtdefset = FALSE)) then\n \nend\n\n' CHECK TO SEE IF THE XTSED EXISTS. CREATE IT IF IT DOES NOT.\nif(av.FindGUI( \"XTSED\") = nil) then\n XTSED = av.FindGUI( \"Script\").clone\n XTSED.SetName( \"XTSED\" )\n XTSED.SetTitle( \"XTSED\" )\n XTSED.SetVisible(FALSE)\n av.GetProject.AddGUI( XTS ED )\n av.GetProject.Update\nend \n\n' MAKE THE SED IN WHICH THE DEFAULTS WILL BE STORED LOCALLY AND WRITE THE DEFAULTS TO IT.\ntheDefSEd = SEd.MakeWithGUI (\"XTSED\")\ntheDefSEd.SetName(\"XTprojectDefaults\")\nif(theDefString = \"\") then\n theDefString = \"'XTDEFAULTS\" ++ \"Feet Feet Feet Both No Yes False False\"\n xtdefset = FALSE\n av.ShowMsg (\"The XTools Defaults are not currently set.\") \nend \ntheDefSEd.SetSource(theDefString) \ntheDefSEd.Compile \ntheScript = theDefSEd.GetScript\nav.GetProject.AddScript( theScrip t )\n\n\n' CHECK TO SEE IF THE XTGUI EXISTS. CREATE IT IF IT DOES NOT.\nif(av.FindGUI( \"XTGUI\") = nil) then\n XTGUI = av.FindGUI( \"View\").clone\n XTGUI.SetName( \"XTGUI\" )\n XTGUI.SetTitle( \"XTGUI\" )\n XTGUI.SetVisible(FALSE)\n av.GetProject.AddGUI( XTGUI )\n av.GetProject.Update\nend \n\n' CHECK TO SEE IF THE XTDEFVIEW EXISTS. CREATE IT IF IT DOES NOT.\nif(av.FindDoc( \"XTDefView\") = nil) then \n XTDefView = View.MakeWithGUI (\"XTGUI\")\n XTDefView.SetName(\"XTDefView\")\n av.GetProject.Update\nend \n \n' CHECK TO S EE IF THE MAP UNITS OR VIEW UNITS ARE DEGREES\ntheMapUnitsDeg = (theDefString.AsList.Get(1) = \"Degrees\")\ntheViewMapUnitsDeg = (theDefString.AsList.Get(3) = \"Degrees\")\n\nif((theMapUnitsDeg = TRUE) and (theViewMapUnitsDeg = FALSE)) then\n\n ' IF THE DEFAULT PROJECTION FILE EXISTS, OPEN IT AND GET THE DEFAULT PROJECTION.\n ' FIRST CHECK IN THE CURRENT PROJECT:\n XTDefPrjExists = FALSE\n XTDefViewDoc = av.FindDoc( \"XTDefView\")\n if(XTDefViewDoc <> nil) then\n XTDefPrj = XTDefViewDoc.GetProjection\n if(XTDe fPrj.IsNull = False) then\n XTDefPrjExists = TRUE\n end\n end\n\n ' THEN CHECK THE CURRENT SUBDIRECTORY:\n if((XTDefPrjExists = FALSE) AND (av.GetProject.GetFileName <> nil)) then\n theXtPrjName = Filename.Make(av.GetProject.GetFileName.ReturnDir.AsString + \"/xtdefault.prj\").GetFullName.AsFilename\n xtdefexists = File.Exists(theXtPrjName)\n if(xtdefexists = true) then\n theODB = ODB.Open(theXtPrjName)\n theCoord = theODB.Get(0)\n XTDefPrj = theCoord.GetProjections.Get(0)\n XTDefPrjExists = TRUE\n end\n end\n \n ' THEN CHECK THE $HOME SUBDIRECTORY:\n if(XTDefPrjExists = FALSE) then\n theXtPrjName = Filename.Make(\"$HOME/xtdefault.prj\").GetFullName.AsFilename\n xtdefexists = File.Exists(theXtPrjName)\n if(xtdefexists = true) then\n theODB = ODB.Open(theXtPrjName)\n theCoord = theODB.Get(0)\n XTDefPrj = theCoord.GetProjections.Get(0)\n XTDefPrjExists = TRUE\n end\n end\n \n ' SET THE PROJECT PROJECTION DEFAULT AND THE LABELS\n if(XTDefPrjExists = T RUE) then\n XTDefView = av.FindDoc( \"XTDefView\")\n XTDefView.SetProjection(XTDefPrj)\n end \n \nend ' if((theMapUnitsDeg = TRUE) and (theViewMapUnitsDeg = FALSE)) then\n \n' SET THE MAP UNITS AND THE DISTANCE UNITS IN THE DEFAULT VIEW.\nif( xtdefset = TRUE ) then\n XTDefView = av.FindDoc( \"XTDefView\")\n theMUnits = (\"#UNITS_LINEAR_\"+theDefString.AsList.Get(1)).AsEnum\n if(XTDefView.GetProjection <> nil) then\n theMUnits = (\"#UNITS_LINEAR_\"+theDefString.AsList.Get(2)).AsEnum\n end\n XTDefView.SetUnits( theMUnits)\n XTDefView.GetDisplay.SetDistanceUnits((\"#UNITS_LINEAR_\"+\n theDefString.AsList.Get(3)).AsEnum)\nend\n\n \nif((theDefString.AsList.Get(8) = \"false\") or (xtdefset = FALSE)) then\n av.Run(\"XTdefaults.Open\", nil) \nend\n\nreturn nil" ) (Script.348 Name: "XTdefaults.Projection" SourceCode: "' OPEN UP THE DEFAULTS DIALOG AND GET THE NEEDED OBJECTS.\nxtdial = av.FindDialog(\"XTDefaults\")\ntheMapUnitsListBox = xtdial.FindByName(\"MapUnitsComboBox\")\ntheViewMapUnitsListBox = xtdial.FindByName(\"ViewMapUnitsComboBox\")\ntheProjectionLabel = xtdial.FindByName(\"ProjectionLabel\")\ntheSpheroidLabel = xtdial.FindByName(\"SpheroidLabel\")\n\n' CHECK TO SEE IF THE DEFAULTS ARE CORRECT FOR SETTING A PROJECTION. BAIL OUT IF NOT.\nif ((theMapUnitsListBox.GetCurrentValue <> \"Degrees\") or (theViewMapUnitsListBox.GetCurrent Value = \"Degrees\")) then\n MsgBox.Warning(\"Setting a Projection is not appropriate unless the data map units (Xtools Default #1) are degrees and the output map units \"+\n \"(Xtools Default #2) are something other than Degrees. If the data map units are degrees, please reset Defaults 1 and/or 2!\",\"\")\n exit\nend \n \nXTDefView = av.FindDoc( \"XTDefView\")\n' CREATE A COORDSYS OBJECT AND GET ITS LIST OF PROJECTIONS\nc = CoordSys.Make\nprojections = c.GetProjections\ntheUnits = \"#UNITS_LINEAR_\"+theViewMapUnitsListB ox.GetCurrentValue\ntheUnitsEnum = theUnits.AsEnum\n\n' HAVE THE USER SELECT A PROJECTION. EXIT IF THE USER CANCELS.\np = ProjectionDialog.Show(XTDefView,theUnitsEnum)\nif(p = nil) then\n exit\nend \n\nc.SetName(p.ReturnDescription.AsTokens(\";\").Get(0).Trim)\n\n' EXIT IF THE USER SELECTS GEOGRAPHIC.\ntemp = p.ReturnDescription.AsTokens(\";\")\ncnt = temp.Count\nif(cnt = 2) then\n prjtype = temp.Get(1).Trim\n if(prjtype = \"Geographic\") then\n MsgBox.Warning(\"The XTools View default projection can not be Geographic. P lease select another projection!\",\"\")\n return nil\n end \nend \n\nXTDefView.SetProjection(p.Clone) \n\n' ADD THE NEW PROJECTION TO THE COORDSYS PROJECTIONS\nprojections.Add(p.Clone)\n\n' ADD THE COORDSYS TO AN ODB FILE IN THE LOCAL SUBDIRECTORY.\nif(av.GetProject.GetFileName <> nil) then\n prjfile = Filename.Make(av.GetProject.GetFileName.ReturnDir.AsString + \"/xtdefault.prj\").GetFullName.AsFilename\n defprj = ODB.Make(prjfile)\n defprj.Add(c.Clone)\n defprj.Commit\nend \n\n\n' ADD THE COORDSYS TO AN ODB FILE IN T HE SYSTEM SUBDIRECTORY.\nprjfile = \"$HOME/XTdefault.prj\".AsFilename.GetFullName.AsFilename\ndefprj = ODB.Make(prjfile)\ndefprj.Add(c.Clone)\ndefprj.Commit\n\n' SET THE LABELS AND GIVE A MESSAGE.\ntheProjectionLabel.SetLabel(\"View Default Projection: \"+p.ReturnDescription)\ntheSpheroidLabel.SetLabel(\"Projection Units (set by #2 above): \"+theViewMapUnitsListBox.GetCurrentValue.Ucase)\nav.ShowMsg(\"The XTools View default projection has been updated and written to \"+prjfile.AsString)" ) (Script.349 Name: "XTdefaults.Help" SourceCode: "' MAKE THE XTOOLS DEFAULTS HELP MESSAGE.\nmessage =\n\" \"+nl+\n\"XTools Defaults Help:\"+nl+nl+\n\"The XTools Defaults dialog is opened using the XTools ''View/Change XTools Defaults''\"+nl+\n\"menu item. This menu item is available in the XTools menus located in the Project, \"+nl+\n\"View, and Table windows. \"+nl+nl+ \n\"All of the XTools functions that create new polygon or polyline output shapefiles \"+nl+\n\"also automatically calculate the area, perimeter, acres and/or hectares for polygons, \"+nl+\n\"and length for poly lines. XTools will add the fields: Area, Perimeter, and Acres \"+nl+\n\"and/or Hectares to output polygon shapefiles; and Length to output polyline shapefiles \"+nl+\n\"if the fields do not exist. If the fields exist, their values will be recalculated. \"+nl+\n\"These calculations are based on the user specifications set in the XTools Defaults \"+nl+\n\"dialog. The user may also turn off these automatic calculations, if so desired.\"+nl+nl+\n\"Multipart shapes can be found in polygon, polyline, and multipoint shapefiles . In \"+nl+\n\"addition to the XTools overlay tools, multipart shapes are created by the \"+nl+\n\"Edit, Union Features menu option in the standard ArcView user interface. XTools \"+nl+\n\"defaults allow the user to control whether multipart shapes in output shapefiles \"+nl+\n\"are converted to single part shapes. See the help for the View XTools Convert \"+nl+\n\"MultiPart to Single Part tool for more information on multipart shapes. \"+nl+nl+\n\"XTools defaults are stored in three locations: embedded in the current A rcView Project \"+nl+\n\"file, in a file named XTdefaults.txt located in the subdirectory where the Project is \"+nl+\n\"located after it is saved, and in another file also named XTdefaults.txt located in the user's \"+nl+\n\"HOME subdirectory.\"+nl++nl+ \n\"When XTools loads, it checks first to see if defaults are embedded in the current Project. \"+nl+\n\"If so, then it uses those defaults. If not, then XTools checks the Project file's subdirectory.\"+nl+\n\"If no default file is found in the Project's subdirectory, the n XTools checks the user's $HOME \"+nl+\n\"subdirectory. This tiered approach allows the XTools defaults to be both portable with the Project \"+nl+\n\"file, and shared among other ArcView projects. \"+nl+nl+\n\"Default Settings Described:\"+nl+nl+\n\"1. Specify the map units of your data:\"+nl+\n\"Select Feet, Meters, Degrees, Inches, Yards, Miles, Millimeters, Centimeters, \"+nl+\n\"or Kilometers.\"+nl+nl+\n\"The user may select any of the above map units. However, XTools area, perimeter, \"+nl+\n\"acres / hectares, and len gth calculations will only be correct if the user's spatial \"+nl+\n\"data on disk is actually in the map units selected. Also, new Views created while \"+nl+\n\"XTools is loaded will have the View Properties Map units set to this selection.\"+nl+nl+\n\"2. Specify the desired output map units:\"+nl+\n\"Select Feet, Meters, Degrees, Inches, Yards, Miles, Millimeters, Centimeters, \"+nl+\n\"or Kilometers.\"+nl+nl+\n\"The user may select any of the above map units. XTools area, perimeter, and length \"+nl+\n\"outputs will be in the units selected in this default.\"+nl+nl+\n\"The desired output map units work in conjunction with the data map units in #1 above.\"+nl+\n\"For instance, if your data is unprojected (you selected degrees in #1) and you select\"+nl+\n\"''Meters'' as your desired output map units, XTools will use the projection set in #7 \"+nl+\n\"below to output area in square meters. Perimeter and length will be output in meters.\"+nl+nl+\n\"If your data is projected (you selected something other than degrees in #1 above) \"+nl+\n\"XToo ls will convert area, perimeter and length outputs from the units specified in #1 \"+nl+\n\"to the units specified in #2.\"+nl+nl+\n\"3. Specify the desired default View distance units:\"+nl+\n\"Select Feet, Meters, Inches, Yards, Miles, NauticalMiles, Millimeters, Centimeters, \"+nl+\n\"or Kilometers.\"+nl+nl+\n\"The user may select any of the above distance units. This setting has only one \"+nl+\n\"function: new Views created while XTools is loaded will have the View Properties \"+nl+\n\"Distance Units set to this specifi ed setting.\"+nl+nl+\n\"4. Specify the desired units for area outputs:\"+nl+\n\"Select Acres, Hectares, or Both Acres and Hectares.\"+nl+nl+\n\"In addition to the area in square map units, the user can choose to see polygon areas \"+nl+\n\"as acres, hectares, or both.\"+nl+nl+\n\"5. Always convert overlay (CLIP, INTERSECT, etc.) output shapes to single part?\"+nl+\n\"Select Yes or No.\"+nl+nl+\n\"The user should select ''Yes'' if they always want XTools to check output shapefiles \"+nl+\n\"for multipart shapes and convert multip art shapes to single part shapes. Depending on \"+nl+\n\"the number of multipart shapes found, the additional time that this feature adds to \"+nl+\n\"XTools operations may vary from not much to very significant. If the user is doing a \"+nl+\n\"series of XTools overlay operations in a spatial analysis, it would be more time \"+nl+\n\"efficient to turn the automatic conversion off until the final product has been \"+nl+\n\"produced, and then run the View XTools Convert MultiPart to Single Part tool on the \"+nl+\n\"final p roduct. \"+nl+nl+\n\"6. Always calculate Area, Perimeter, Acres (Hectares), Length?\"+nl+\n\"Select Yes or No.\"+nl+nl+\n\"The user should select ''Yes'' if they always want XTools to calculate Area, Perimeter,\"+nl+\n\"Acres (Hectares), Length after XTools spatial operations. Depending on the number of \"+nl+\n\"shapes in the shapefile, the additional time that this feature adds to XTools \"+nl+\n\"operations may vary from very little to significant. If the user is doing a series of \"+nl+\n\"XTools overlay operations in a spatial analysis, it would be more time efficient to \"+nl+\n\"turn the automatic calculation off until the final product has been produced, and then \"+nl+\n\"run the View XTools ''Recalculate Area, Perimeter , Length, Acres, Hectares'' tool on \"+nl+\n\"the final product.\"+nl+nl+\n\"7. Do NOT show View Properties and XTools Defaults when creating a new View.\"+nl+\n\"Check this box if you do not want a reminder of the XTools Defaults settings when a new\"+nl+\n\"View is created. If all of your data is in the same map un its and projection, then a\"+nl+\n\"reminder is usually not needed. If you deal with multiple map units (meters, feet, degrees...)\"+nl+\n\"or multiple projections, then a reminder is useful. Having the Defaults set to the incorrect\"+nl+\n\"map units or projection will give incorrect results in the area, perimeter, acres, hectares\"+nl+\n\"and length calculations.\" +nl++nl+\n\"8. Do NOT show the XTools Defaults Dialog when the XTools Extension loads.\"+nl+\n\"The XTools Defaults Dialog opens automatically when XTools lo ads into a project that does not \"+nl+\n\"contain saved XTools Defaults. Check this box if you do not want a reminder of the XTools \"+nl+\n\"Defaults settings when XTools loads. If all of your data is in the same map units and \"+nl+\n\"projection, then a reminder is usually not needed. If you deal with multiple map units \"+nl+\n\"(meters, feet, degrees...) or multiple projections, then a reminder is useful. Having the \"+nl+\n\"Defaults set to the incorrect map units or projection will give incorrect results in th e area, \"+nl+\n\"perimeter, acres, hectares and length calculations.\" +nl++nl+\n\n\"9. Set Projection:\"+nl+\n\"To set a projection, push the ''Set Projection'' button and select an appropriate \"+nl+\n\"projection from the Projection Properties dialog. Do not set a projection if your data\"+nl+\n\"is already projected (is not in degrees).\"+nl+nl+\n\"If your data is unprojected (you selected degrees in #1), you need to select a \"+nl+\n\"projection for area, perimeter , length, acres, and hectares calculations. Choose a \"+ nl+\n\"projection that is appropriate for the geographic area covered by your data. \"+nl+\n\"''Projections of the World, Geographic'' is not an appropriate projection.\"+nl+nl+\n\"As with the other XTools Defaults, the XTools default projection is stored in the \"+nl+\n\"current Project file and in files named XTdefault.prj located in the Project file's \"+nl+\n\"subdirectory and in the user's HOME subdirectory. Helpful hint: If you would like to \"+nl+\n\"have your most-used standard or custom projection come up first on the projection list, \"+nl+\n\"then set the projection using the Projection Properties dialog, go to your HOME subdirectory, \"+nl+\n\"make a copy of XTdefault.prj and make the name of the copy default.prj. This \"+nl+\n\"projection will now be the first projection visible when the Projection Properties \"+nl+\n\"dialog appears.\"+nl+nl+\n\"Note: When selecting a projection, chose one that uses the same datum as your data. \"+nl+\n\"For instance, do not select a projection based on the NAD83 datum if your data is in \" +nl+\n\"the NAD27 datum. ArcView (and therefor XTools) can not do datum shifts without using \"+nl+\n\"the Projection Engine.\"\n\n\nmsgbox.report(message,\"XTools Defaults Help\")\n\nClipboard.The.Empty\nClipboard.The.Add(message)\nClipboard.The.Update\n\nMsgBox.Info(\"This information was copied to the system clipboard. To print it, open a text editor\"++\n\"(like notepad), paste in the contents of the clipboard, and print it from the text editor.\",\"PRINT INSTRUCTIONS\")\n\nreturn nil\n" ) (Script.350 Name: "XTDisplaySelected.Close" SourceCode: "xtdial = av.FindDialog(\"XTDisplaySelected\")\ntheSelected = xtdial.FindByName(\"txtbxSelected\")\ntheSelected.SetText(\"\")\nxtdial.Close \n" ) (Script.351 Name: "XTDisplaySelected.Clearall" SourceCode: "xtdial = av.FindDialog(\"XTDisplaySelected\")\ntheMessage = xtdial.FindByName(\"lblXTDisplaySelectedMessage\")\ntheSelected = xtdial.FindByName(\"txtbxSelected\")\ntheView = av.GetActiveDoc\nthemeList = theView.GetThemes\nfor each thm in themeList\n if (thm.Is(Ftheme)) then\n theSel = thm.GetFtab.GetSelection\n if(theSel.Count > 0) then\n theSel.ClearAll\n end \n thm.Invalidate(TRUE)\n end\nend\ntheView.Invalidate\ntheView.GetDisplay.Invalidate(TRUE)\nav.ProcessAllInvals\nav.GetActiveWin.Invalidate\nav.ShowMsg(\" All selected features in this View cleared.\")\ntheSelected.SetText(\"\")\ntheMessage.SetLabel(\"All selections in the View have been cleared!\")" ) (Script.352 Name: "XTBatchWiz.Run" SourceCode: "' Name: XTBatchWiz.Run\n'\n' Title: XTools Batch Overlay\n'\n' Topics: Analysis, Themes\n'\n' Description: This script executes the run button from the XTBatchWiz Dialog.\n'\n' Script by Mike DeLaune, (Email: mike.g.delaune@state.or.us), \n' Oregon Department of Forestry, 4/5/01. Last Revised 5/21/2001.\n'\n' Requires: A text file with XTools overlay commands. \n'\n' Self: the file name of the batch file to run.\n'\n' Returns: Not Applicable\n'\n'===========================================================\n ' G ET THE BATCH FILE TO RUN.\ntheXtBatchName = SELF\nif(theXtBatchName = nil) then exit end\n\n' OPEN THE BATCH FILE AND READ IT INTO A LIST\ntheXtBatchFile = LineFile.Make(theXtBatchName, #FILE_PERM_READ)\nlines = theXtBatchFile.GetSize\nLineList = List.Make\ntheXtBatchFile.Read(LineList,lines)\n'MsgBox.ListAsString(LineList,\"\",\"\")\ntheBatchList = List.Make\n\n' MAKE AN ERROR LOG FILE.\ntheXtBatchErrorFile = Filename.Make(\"$HOME/XtError.txt\").GetFullName.AsFilename\ntheXtErrorFile = LineFile.Make(theXtBatchErrorFile, #FI LE_PERM_WRITE)\ntheXtErrorFile.WriteElt(\"Error Log for XTools Overlay Batch operation starting \"+Date.Now.AsString+nl)\n\n' MAKE FILE THAT CAN BE USED TO STOP A RUNNING PROCESS. THE USER DELETES THE FILE IN ORDER TO STOP THE PROCESS.\ntheXtStopFileName = FileName.Make(\"$HOME/XtStop.txt\").GetFullName.AsFilename\ntheXtStopFile = LineFile.Make(theXtStopFileName, #FILE_PERM_WRITE)\ntheXtStopFile.Close\n\n' MAKE A LIST TO CONTAIN VALID OUTPUTFILE NAMES. THIS LIST WILL BE USED TO CHECK INPUT AND OVERLAY FILES FOR VAL IDITY.\nOutputFileList = List.Make\n\n' ERROR CHECK PROCEDURE.\nfor each i in 0..(lines - 1)\n str = LineList.Get(i)\n bline = i + 1\n if(str.Contains(\"'\")) then continue end\n thestrlist = str.AsList\n' MsgBox.ListAsString(thestrlist,\"\",\"\")\n\n ' CHECK FOR A GENERAL FORMAT ERROR.\n if(thestrlist.Count <> 6) then\n theXtErrorFile.WriteElt(\"Batch File Line \"+bline.AsString+\": Operation request format is incorrect. Requires 6 specifications: [OPERATION] \"+\n \"[INPUT THEME PATH/NAME] [INPUT THEME FEATURE CLASS] [OVERLAY THEME PATH/NAME] [OVERLAY THEME FEATURE CLASS] [OUTPUT THEME PATH/NAME].\")\n continue\n end\n\n ' STEP 1: CHECK FOR ERROR IN THE OPERATION NAME.\n Op = thestrlist.Get(0)\n if((op <> \"Clip\") and (op <> \"Erase\") and (op <> \"Identity\") and (op <> \"Intersect\") and (op <> \"Union\") and (op <> \"Update\")) then\n theXtErrorFile.WriteElt(\"Batch File Line \"+bline.AsString+\": Operation ''\"+op+\"'' is invalid. Needs to be Clip, Erase, Identity, Intersect, Union, or Update.\")\n end \n \n ' STEP 2: CHECK FOR ERRORS IN THE INPUT THEME.\n if (thestrlist.Get(1).Contains(\".shp\")) then\n theInputSrcName = SrcName.Make(thestrlist.Get(1))\n else\n theInputSrcName = SrcName.Make(thestrlist.Get(1)++thestrlist.Get(2))\n end \n \n ' CHECK TO SEE IF THE INPUT THEME WILL BE THE OUTPUT OF A PREVIOUS STEP AFTER IT IS EXECUTED. \n ' IF SO, SKIP THE CHECKS SINCE THE SOURCE DOES NOT YET EXIST.\n sw1 = 0\n for each ofile in OutputFileList\n if(ofile = thestrlist.Get(1)) then\n theInputTheme = thestrlist. Get(1)\n sw1 = 1\n end\n end \n \n ' CHECK FOR ERRORS.\n if (sw1 = 0) then \n theInputTheme = nil\n ' MAKE THE THEME. SINCE AN INVALID SOURCE WILL GENERATE A SCRIPT-STOPPING ERROR, WE DO THIS IN A CALLED SCRIPT.\n if(theInputSrcName <> nil) then\n theInputTheme = av.Run(\"aanView.Sub-MakeTheme\", theInputSrcName)\n end\n if(theInputTheme = nil) then\n theXtErrorFile.WriteElt(\"Batch File Line \"+bline.AsString+\": Input Theme Source ''\"+thestrlist.Get(1)+\n \"'' either does not exist or is not a valid theme source.\")\n else\n if(theInputTheme.Is(FTheme) = false) then\n theXtErrorFile.WriteElt(\"Batch File Line \"+bline.AsString+\": Input Theme Source ''\"+thestrlist.Get(1)+\n \"'' needs to be a feature theme.\")\n else\n theInputShapeType = theInputTheme.GetFtab.FindField(\"Shape\").GetType\n if(((Op = \"Union\") or (Op = \"Update\")) and (theInputShapeType <> #FIELD_SHAPEPOLY)) then\n theXtErrorFile.WriteElt(\"Batch File Line \"+bline.AsString+\": Input Theme Source ''\"+thestrlist.Get(1)+\n \"'' must be Polygon if the operation is Union or Update.\") \n end\n end \n end \n end ' if (sw1 = 0) then\n \n ' STEP 3: CHECK FOR ERRORS IN THE OVERLAY THEME.\n if (thestrlist.Get(3).Contains(\".shp\")) then\n theOverlaySrcName = SrcName.Make(thestrlist.Get(3))\n else\n theOverlaySrcName = SrcName.Make(thestrlist.Get(3)++thestrlist.Get(4))\n end \n\n \n ' CHECK TO SEE IF THE OVERLAY THEME WILL BE THE OUTPUT OF A PREVIOUS STEP AFTER IT IS EXECUTED. \n ' IF SO, SKIP THE CHECKS SINCE THE SOURCE DOES NOT YET EXIST.\n sw2 = 0\n for each ofile in OutputFileList\n if(ofile = thestrlist.Get(3)) then\n theOverlayTheme = thestrlist.Get(3)\n sw2 = 1\n end\n end \n \n if (sw2 = 0) then \n theOverlayTheme = nil\n ' MAKE THE THEME. SINCE AN INVALID SOURCE WILL GENERATE A SCRIPT-STOPPING ERROR, WE DO THIS IN A CALLED SCRIPT.\n if(theOverlaySrcName <> nil) then\n theOverlayTheme = av.Run(\"aanView.Sub-MakeTheme\", theOverlayS rcName)\n end\n if(theOverlayTheme = nil) then\n theXtErrorFile.WriteElt(\"Batch File Line \"+bline.AsString+\": Overlay Theme Source ''\"+thestrlist.Get(3)+\n \"'' either does not exist or is not a valid theme source.\")\n else\n if(theOverlayTheme.Is(FTheme) = false) then\n theXtErrorFile.WriteElt(\"Batch File Line \"+bline.AsString+\": Overlay Theme Source ''\"+thestrlist.Get(3)+\n \"'' needs to be a feature theme.\")\n else \n theOverlayShapeType = theOverlayTheme.GetFt ab.FindField(\"Shape\").GetType\n if(theOverlayShapeType <> #FIELD_SHAPEPOLY) then\n theXtErrorFile.WriteElt(\"Batch File Line \"+bline.AsString+\": Overlay Theme Source ''\"+thestrlist.Get(3)+\n \"'' needs to be a polygon theme.\") \n end\n end \n end\n end ' if (sw2 = 0) then \n \n ' STEP 4: CHECK FOR THE OUTPUT THEME FILE NAME ALREADY EXISTS.\n OutputFile = Filename.Make(thestrlist.Get(5))\n OutputFileExists = File.Exists(OutputFile)\n if(OutputFileExists = true) t hen\n theXtErrorFile.WriteElt(\"Batch File Line \"+bline.AsString+\": Output file ''\"+thestrlist.Get(5)+\n \"'' already exists. Choose a different name.\")\n else\n OutputFileList.Add(thestrlist.Get(5))\n end\n \n ' STEP 5: CHECK FOR ERROR IN THE FEATURE TYPE.\n feat = thestrlist.Get(2)\n if((feat <> \"Point\") and (feat <> \"Arc\") and (feat <> \"Line\") and (feat <> \"Polygon\") and \n (feat.Left(7) <> \"Region.\") and (feat.Left(6) <> \"Route.\")) then\n theXtErrorFile.WriteElt(\"Batch File Line \"+bline.As String+\": Input Theme Feature type ''\"+feat+\n \"'' is invalid. Needs to be Point, Multipoint, Arc, Line, Polygon, Region.xxxx, or Route.xxxx.\")\n end \n feat = thestrlist.Get(4) \n if((feat <> \"Polygon\") and (feat.Left(7) <> \"Region.\")) then\n theXtErrorFile.WriteElt(\"Batch File Line \"+bline.AsString+\": Overlay Theme Feature type ''\"+feat+\n \"'' is invalid. Needs to be Polygon or Region.xxxx\")\n end \n\n \n ' STEP 6: MAKE THE LIST FOR BATCH OPERATION\n theBatchList.Add({op, theInputTheme, the OverlayTheme, OutputFile})\n\nend \n\n' STEP 7: CHECK FOR DUPLICATE OUTPUT THEME FILE NAMES.\nocnt1 = OutputFileList.Count\nOutputFileList.RemoveDuplicates\nocnt2 = OutputFileList.Count\nif(ocnt1 <> ocnt2) then\n theXtErrorFile.WriteElt(\"The Batch File contains duplicate output file names. Please \"+\n \"specify unique output file names and try again.\")\nend\n\nErrorCnt = theXtErrorFile.GetSize - 1\nif(Errorcnt > 0) then\n theXtErrorFile.WriteElt(\" \"+nl+\"Please correct the errors in the batch file and try again!\")\n t heXtErrorFile.Close\n ErrorWin = TextWin.Make(theXtBatchErrorFile, \"XTOOLS OVERLAY PROCESSING ERROR FILE: \"+ErrorCnt.AsString+\" ERRORS.\")\n ErrorWin.Maximize\n ErrorWin.Open\n return nil\nelse\n theXtErrorFile.Close \nend\n\n'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''\n\n' SET UP THE PROGRESS BAR.\ncurrentop = 0 \ntotalop = theBatchList.Count\nxtdial = av.FindDialog(\"XTMessages\")\ntheStopMsg = xtdial.FindByName(\"xtstopop\")\nthePro cMsg = xtdial.FindByName(\"xtproc\")\nthextop = xtdial.FindByName(\"xtop\")\nthextinput = xtdial.FindByName(\"xtinput\")\nthextover = xtdial.FindByName(\"xtover\")\n\ntheStopMsg.SetText(\"To stop a running XTools Batch Overlay Operation, find and delete the following file: \"+theXtStopFileName.GetFullName+nl+nl+\n\"The batch operation will stop after completing the current operation.\")\n\nxtdial.Open \n\n' START THE XTOOLS OVERLAY BATCH OPERATION LOOP. \nfor each blist in theBatchList\n\n' msgbox.listasstring(blist,\"\",\"ERROR MES SAGE\")\n\n if(File.Exists(theXtStopFileName) = false) then\n MsgBox.Info(\"Batch overlay process stopped by the user!\",\"\")\n xtdial.Close\n exit\n end\n\n ' Show Progress routine:\n currentop = currentop + 1\n av.ShowMsg(\"Batch operation \"+currentop.AsString+\" of \"+totalop.AsString+\" in progress.\")\n theProcMsg.SetLabel(\"Batch operation \"+currentop.AsString+\" of \"+totalop.AsString+\" in progress....\")\n thextop.SetLabel(\"The current operation is \"+blist.Get(0))\n thextinput.SetLabel(\"The Input Theme is \" +blist.Get(1).GetName)\n thextover.SetLabel(\"The Overlay Theme is \"+blist.Get(2).GetName)\n av.ProcessAllInvals\n\n \n av.Run(\"aanView.OverlayThemes\", blist)\n \nend\n \nMsgBox.Info(\"XTools Batch Overlay process completed!\",\"\")\nxtdial.Close" ) (Script.353 Name: "aanSpace.Xtools1" ) (Script.354 Name: "XTDisplaySelected.Open" SourceCode: "' Name: XTDisplaySelected.Open\n'\n' Title: Display Selected Shapes Info\n'\n' Topics: \n'\n' Description: See the \"Shift click\" instructions below for a script description.\n'\n' Requires: \n'\n' Self: \n'\n' Returns: \n\n'===========================================================\n \n' Check for the shift key, if the shift key is down, pop up instructions for using this script\n \nif (System.IsShiftKeyDown) then\n message =\n \" \"+nl+\n \"Instructions For Display Selected Shapes Info:\"+nl+nl+\n \"This script shows the user the number of shapes selected and the total acres and hectares in selected \"+nl+\n \"shapes for polygon themes, or total length in selected shapes (as appropriate) for polyline themes, in \"+nl+\n \"each theme with selected shapes.\"+nl+nl+\n \"Script by Mike DeLaune, (Email: mike.g.delaune@state.or.us), Oregon Department of Forestry, 4/22/2000. \"+nl+nl+\n \"Instructions:\"+nl+nl+\n \"1. Click on this button to see information about selected shapes, in themes that \"+nl+\n \"have selected shapes.\"+nl+nl+\n \"2. Press and hold the ALT button and click on this button to see selected shapes information about all \"+NL+\n \"themes in the View.\"+nl+nl+\n \"3. To clear all selections, press the ''Clear All Selections'' button on the dialog.\"+nl\n \n msgbox.report(message,\"Display Selected Shapes Info Instructions\")\n \n Clipboard.The.Empty\n Clipboard.The.Add(message)\n Clipboard.The.Update\n \n MsgBox.Info(\"These instructions were copied to the system clipboard. To print them, open a text editor\"++\n \"(like notepad), p aste in the contents of the clipboard, and print them from the text editor.\",\"PRINT INSTRUCTIONS\")\n \n return nil\nend\n\n\n''''''''''''''''''''''''''''''''''''''\n' Initial set up and error checks:\n''''''''''''''''''''''''''''''''''''''\n\n\nxtdial = av.FindDialog(\"XTDisplaySelected\")\ntheMessage = xtdial.FindByName(\"lblXTDisplaySelectedMessage\")\n theMessage.SetLabel(\"Selected features in all themes:\")\ntheSelected = xtdial.FindByName(\"txtbxSelected\")\n\nif (System.IsAltKeyDown) then\n showall = true\n showstr = \"L ist includes all themes.\"\nelse\n showall = false\n showstr = \"List includes only themes with selected shapes. [Hold Alt key down for all themes].\"\nend\n\n\n' Get the active document, which should be a view. Bail if not a view:\ntheView=av.GetActiveDoc\nif (theView.Is(View).Not) then\n MsgBox.Error(\"This script must be run from a view. Exiting\",\"Error\")\n return nil\nend\n\n\n' Check to see if there are themes in the View. Bail if no themes:\ntnum = theView.GetThemes.Count\nif (tnum = 0) then\n MsgBox.Error(\"There are no themes in the View. Add Themes and re-run. Exiting\",\"Error\")\n return nil\nend\n\n' Get info on the data and view units and the projection\nReturnList = av.Run(\"aan.Sub-CalcSize\",{nil})\nDataMapUnitsEnum = ReturnList.Get(0)\nViewMapUnitsEnum = ReturnList.Get(1)\nViewMapUnits = ReturnList.Get(2)\ntheSpheroidUnits = ReturnList.Get(3)\nthePrj = ReturnList.Get(4) \n\n\n' END OF THE INITIAL SETUP\n\n''''''''''''''''''''''''''''''''''''''''''''''''''''''''''\n' Collect the Info\n''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''' \n\n' Build a list of numbers of selected records by ftheme in the theme list.\nSelRecStr = \"\"\nfor each t in theView.GetThemes\n if (t.Is(Ftheme)) then\n theFTab = t.GetFtab\n theShapeField = theFtab.FindField(\"Shape\")\n shapetype = theShapeField.GetType\n theSelrecs = theFtab.GetSelection\n theSelrecNum = theSelrecs.Count\n \n ' Skip remainder if no selected features:\n if ((theSelRecNum = 0) and (showall = false))then\n continue\n end\n \n tname = t.GetName\n \n if((shapetype = #FIELD_SHAPEPOINT) or (shapetype = #FIELD_SHAPEMULTIPOINT)) then\n theString = tname.AsString++\" [ Contains \"+theSelrecNum.AsString+\" Selected Point(s) ]\"+nl\n elseif (shapetype = #FIELD_SHAPEPOLY) then \n theString = tname.AsString++\" [ Contains \"+theSelrecNum.AsString+\" Selected Polygon(s) ]\"+nl\n elseif (shapetype = #FIELD_SHAPELINE) then\n theString = tname.AsString++\" [ Contains \"+theSelrecNum.AsString+\" Selected Line(s) ]\"+nl\n end\n SelRecStr = SelRecStr + theString \n \n if (theSelrecNum = 0) then\n SelRecStr = SelRecStr +\"****************************************************************************\"+nl\n continue\n end \n\n if ( DataMapUnitsEnum = #UNITS_LINEAR_DEGREES ) then\n theAcres = 0\n theHectares = 0\n theLength = 0\n if (shapetype = #FIELD_SHAPEPOLY) then\n for each rec in theSelrecs\n theShape = theFtab.ReturnValue(theShapeField,rec)\n ReturnList = av.Run(\"aan.Sub-CalcSize\",{theShape}) \n theAcres = ReturnList.Get(0) + theAcres\n theHectares = ReturnList.Get(1) + theHectares\n end\n theAcStr = av.run(\"aanView.NumComma\",theAcres.SetFormat(\"d.ddd\"))\n theHecStr = av.run(\"aanView.NumComma\",theHectares.SetFormat(\"d.ddd\"))\n theString = theAcStr + \" Acres and \"+theHecStr+\" Hectares are in selected polygons.\"+nl\n SelRecStr = SelRecStr + theString\n elseif (shapetype = #FIELD_SHAPELINE) then\n for each rec in theSelrecs\n th eShape = theFTab.ReturnValue(theShapeField,rec)\n ReturnList = av.Run(\"aan.Sub-CalcSize\",{theShape})\n theLength = ReturnList.Get(0) + theLength\n end\n theLenStr = av.run(\"aanView.NumComma\",theLength.SetFormat(\"d.ddd\"))\n theString = theLenStr ++ ViewMapUnits+\" are in selected lines.\"+nl\n SelRecStr = SelRecStr + theString\n end \n else\n total = 0\n Area = 0\n Length = 0\n if (shapetype = #FIELD_SHAPEPOLY) then\n for each rec in theSelr ecs\n Area = theFtab.ReturnValue(theShapeField,rec).ReturnArea\n total = total + Area\n end\n theAcres = Units.ConvertArea(total,DataMapUnitsEnum,#UNITS_LINEAR_FEET) / 43560\n theHectares = Units.ConvertArea(total,DataMapUnitsEnum,#UNITS_LINEAR_METERS) / 10000\n \n theAcStr = av.run(\"aanView.NumComma\",theAcres.SetFormat(\"d.ddd\"))\n theHecStr = av.run(\"aanView.NumComma\",theHectares.SetFormat(\"d.ddd\"))\n theString = theAcStr + \" Acres and \"+theHecStr+\" Hectares are in selected polygons.\"+nl\n SelRecStr = SelRecStr + theString\n elseif (shapetype = #FIELD_SHAPELINE) then\n for each rec in theSelrecs\n Length = theFTab.ReturnValue(theShapeField,rec).ReturnLength\n total = total + Length\n end\n theLength = Units.Convert(total,DataMapUnitsEnum,ViewMapUnitsEnum)\n theLenStr = av.run(\"aanView.NumComma\",total.SetFormat(\"d.ddd\"))\n theString = theLenStr ++ ViewMapUnits+\" are in selected lines.\"+nl\n SelRecStr = SelRecStr + theString\n end \n end\n \n SelRecStr = SelRecStr +\"****************************************************************************\"+nl\n end\nend\n''''''''''''''''''''''''''''''''''''''''''''''''''''''''''\n' Display the Info\n'''''''''''''''''''''''''''''''''''''''''''''''''''''''''' \nunsel = false\nif (SelRecStr.Count > 0) then\n theSelected.SetText(SelRecStr)\nelse\n theMessage.SetLabel(\"There are no selected features in this View!\")\nend\n\nxtdial.Open" ) (Script.355 Name: "XTdefaults.Open" SourceCode: "' OPEN UP THE DEFAULTS DIALOG AND FIND THE OBJECTS CONTAINING THE DEFAULTS.\n\nxtdial = av.FindDialog(\"XTDefaults\")\nxtdial.Open \nXTDefPrjExists = FALSE\n\ntheMapUnitsListBox = xtdial.FindByName(\"MapUnitsComboBox\")\ntheViewMapUnitsListBox = xtdial.FindByName(\"ViewMapUnitsComboBox\")\ntheDistanceUnitsListBox = xtdial.FindByName(\"DistanceUnitsComboBox\")\ntheAreaListBox = xtdial.FindByName(\"AreaComboBox\")\ntheOverlayConvertListBox = xtdial.FindByName(\"OverlayConvertComboBox\")\ntheAreaCalcListBox = xtdial.FindByName(\"Are aCalcComboBox\")\ntheProjectionLabel = xtdial.FindByName(\"ProjectionLabel\")\ntheSpheroidLabel = xtdial.FindByName(\"SpheroidLabel\")\ntheNewViewWarn = xtdial.FindByName(\"cbNewViewWarn\")\ntheXTdefaultsWarn = xtdial.FindByName(\"cbXTdefaultsWarn\")\n\n' POPULATE THE COMBO BOX LISTS AND SET THE LABELS.\ntheMUnitsList = {\"Feet\", \"Meters\", \"Degrees\", \"Inches\", \"Yards\", \"Miles\", \"Millimeters\", \"Centimeters\", \"Kilometers\"}\ntheDUnitsList = {\"Feet\", \"Meters\", \"Inches\", \"Yards\", \"Miles\", \"NauticalMiles\", \"Millimeters\", \"Centime ters\", \"Kilometers\"}\ntheMapUnitsListBox.DefineFromList(theMUnitsList)\ntheViewMapUnitsListBox.DefineFromList(theMUnitsList)\ntheDistanceUnitsListBox.DefineFromList(theDUnitsList)\ntheAreaListBox.DefineFromList({\"Acres\", \"Hectares\", \"Both Acres and Hectares\"})\ntheOverlayConvertListBox.DefineFromList({\"No\", \"Yes\"})\ntheAreaCalcListBox.DefineFromList({\"No\", \"Yes\"})\ntheSpheroidLabel.SetLabel(\" \")\ntheProjectionLabel.SetLabel(\"VIEW DEFAULT PROJECTION NOT SET.\")\n\ntheDefaultsLocation = \"No Stored XTools Defaults\"\nthePr ojectionLocation = \"No Stored XTools Default Projection\"\n\n' IF THE DEFAULTS ARE STORED LOCALLY, GET THEM AND SET THE DEFAULTS DIALOG. IF NOT, THE XTDEFAULTS.OPEN SCRIPT WILL \n' CHECK FOR EXTERNAL DEFAULTS FILES IN THE PROJECT DIRECTORY AND AT $HOME.\nxtdefset = FALSE\ntheDefScript = av.GetProject.FindScript( \"XTprojectDefaults\" )\nif(theDefScript <> nil) then\n\n ' READ IN THE DEFAULTS AND SET THEM IN THE DIALOG.\n theDefStr = theDefScript.AsString\n DefaultList = theDefStr.AsList\n \n theCount = DefaultLis t.Count\n if(theCount < 9) then\n Msgbox.Info(\"The XTools Defaults stored in this project are in an older format and \" + \n \"need to be updated. Please respecify your defaults, and then \"\n + \"press the ''Save Defaults'' button.\", \"UPDATE DEFAULTS FOR NEW XTOOLS VERSION\")\n return nil\n end\n\n theMapUnitsListBox.FindByValue(DefaultList.Get(1))\n theMapUnitsListBox.SelectCurrent\n theViewMapUnitsListBox.FindByValue(DefaultList.Get(2))\n theViewMapUnitsListBox.SelectCurrent\n theDistanceUnitsListBox. FindByValue(DefaultList.Get(3))\n theDistanceUnitsListBox.SelectCurrent\n theStr = DefaultList.Get(4)\n if (theStr = \"Both\") then\n theStr = theStr + \" Acres and Hectares\"\n end\n theAreaListBox.FindByValue(theStr)\n theAreaListBox.SelectCurrent\n theOverlayConvertListBox.FindByValue(DefaultList.Get(5))\n theOverlayConvertListBox.SelectCurrent\n theAreaCalcListBox.FindByValue(DefaultList.Get(6))\n theAreaCalcListBox.SelectCurrent\n if (DefaultList.Get(7) = \"TRUE\") then\n theNewViewWarn.SetSelected(TRUE) \n else\n theNewViewWarn.SetSelected(FALSE)\n end\n if (DefaultList.Get(8) = \"TRUE\") then\n theXTdefaultsWarn.SetSelected(TRUE)\n else\n theXTdefaultsWarn.SetSelected(FALSE)\n end \n xtdefset = TRUE \nend\n\n' IF THE DEFAULT PROJECTION FILE EXISTS, OPEN IT AND GET THE DEFAULT PROJECTION.\n' FIRST CHECK IN THE CURRENT PROJECT:\nXTDefViewDoc = av.FindDoc( \"XTDefView\")\nif(XTDefViewDoc <> nil) then\n XTDefPrj = XTDefViewDoc.GetProjection\n if(XTDefPrj.IsNull = False) then\n theProjectionLabel.SetLabel(\" View Default Projection: \"+XTDefPrj.ReturnDescription)\n theSpheroidUnits = XTDefPrj.GetSpheroid.GetUnits\n theSpheroidLabel.SetLabel(\"Projection Units (set by #2 above): \"+theSpheroidUnits.AsString.Middle(13,10))\n XTDefPrjExists = TRUE\n end\nend\n" ) (Script.356 Name: "aanProject.SeeEnvironmentPaths" SourceCode: "' Name: aanProject.SeeEnvironmentPaths\n' \n' Title: See Environment Paths\n'\n' Topics: GeoData\n'\n' Description: Shows the settings of the standard environment paths\n'\n' Script by Mike DeLaune (Email: mike.g.delaune@state.or.us), \n' Oregon Department of Forestry, 10/18/97.\n'\n' Requires: Nothing.\n'\n' Self: \n'\n' Returns: a messagebox displaying the environment paths.\n'===========================================================\n\n\n' MAKE A LIST OF PATHS:\nthePathlist = \"\"\nfor each var in {\"HOME\", \"TEMP\", \"CWD \", \"WORKDIR\", \"AVHOME\", \"AVEXT\", \"AVBIN\", \"USEREXT\", \"DEVEXT\", \"TMPDIR\"}\n if(var = \"CWD\") then\n thePath = FileName.GetCWD.AsString\n elseif(var = \"WORKDIR\") then\n thePath = av.GetProject.GetWORKDIR.AsString\n else \n thePath = System.GetEnvVar(var)\n end \n \n if(thePath = nil) then\n thePath = \"Not Set\"\n end \n thePathList = thePathList + var ++ \" = \"++thePath.Ucase +NL\nend\n\n' SHOW THE PATHS TO THE USER:\nMsgBox.Report(thePathlist, \"ArcView Environment Paths:\")\n\nClipboard.The.Empty\nClipboard.T he.Add(thePathlist)\nClipboard.The.Update\n \nav.ShowMsg(\"This information was copied to the system clipboard. To print it, open a text editor\"++\n \"(like notepad), paste in the contents of the clipboard, and print it from the text editor.\")\n\n \n" ) (Script.357 Name: "aanProject.AboutXTools" SourceCode: "' Name: aanProject.AboutXTools\n'\n' Title: About XTools\n'\n' Topics: Misc\n'\n' Description: See the \"Shift click\" instructions below for a script description.\n'\n' Requires: \n'\n' Self: Not Applicable\n'\n' Returns: Not Applicable.\n'===========================================================\n\nmessage = \" \"+nl+\n\"Xtools Version 6/1/2001 Description: \"+nl++nl+\n\"This extension contains useful vector spatial analysis, shape conversion and table \"+nl+\n\"management tools developed, collected, or modified by Mike DeL aune, Oregon \"+nl+\n\"Department of Forestry. \"+nl++nl+\n\"All of the more complicated tools have Shift click instructions. That is, you hold \"+nl+\n\"down the shift key and click on the menu item to get a description of the tool and \"+nl+\n\"instructions for running it. The description and instructions are copied to the \"+nl+\n\"system clipboard, so you can paste them into a text editor and thus print them out.\"+nl+nl+\n\"Xtools has been tested on Windows 95, 98 and Windows NT machines with ArcView 3.0a, \"+nl+\n\"3.1, a nd 3.2.. It has also been used on Unix and Macintosh machines.\"+nl+nl+\n\"So, what is in Xtools?\"+nl+nl+\n\"Xtools makes these additions to the View GUI:\"+nl+nl+\n\"1. An Xtools View Document Menu with menu items that are equivalent in purpose to some\"+nl+ \n\"ArcInfo Commands. In the following list, the equivalent ArcInfo commands are in\"+nl+ \n\"parentheses:\"+nl+nl+\n\"* Buffer Selected Features (BUFFER)\"+nl+\n\"* Clip With Polygon(s) (CLIP)\"+nl+\n\"* Erase Features (ERASE)\"+nl+\n\"* Identity (IDENTITY)\"+nl+\n\"* Intersect T hemes (INTERSECT)\"+nl+\n\"* Merge Themes (PUT, GET)\"+nl+\n\"* Union Polygon themes (UNION)\"+nl+\n\"* Update Polygon Theme (UPDATE) \"+nl+nl+\n\"2. Additional features in this menu include:\"+nl+\n\"* View/Change XTools Defaults\"+nl+\n\"* XTools Batch Overlay (batch operation of the Clip, Erase, Identity, Intersect, \"+nl+\n\" Union, and Update scripts).\"+nl+\n\"* View XTools Overlay Log File\"+nl+\n\"* Recalculate Area, Perimeter , Length , Acres, Hectares\"+nl+\n\"* Transfer / Convert Selected Features\"+nl+\n\"* Convert Multipart S hapes To Single Part\"+nl+\n\"* Convert Polygons to Polylines\"+nl+\n\"* Make One Polygon From Polylines\"+nl+\n\"* Make One Polygon From Points\"+nl+\n\"* Make One PolyLine From Points\"+nl+\n\"* Convert Shapes To Graphics\"+nl+\n\"* Convert Graphics To Shapes\"+nl+\n\"* Convert Shapes to Centroids\"+nl+\n\"* Batch Import Active themes To Shapefiles\"+nl+\n\"* Manage Shapefiles.\"+nl+nl+\n\"3. Xtools also adds one button (with a Sum Icon) to the View GUI. This button\"+nl+ \n\"provides information on the number of selected features in eac h theme, the total \"+nl+\n\"acres in selected features for polygon themes, the total length in selected \"+nl+\n\"features for polyline themes, and the ability to clear all selected features in all\"+nl+ \n\"themes in one operation. XTools also provides an improved ''Set Working Directory'' function\"+nl+ \n\"item in the View, File menu.\"+nl+nl+\n\"Other changes to the View GUI include: Setting the View map units and distance units \"+nl+\n\"to user-specified defaults when a new View is created, displaying acres (hectares ) when \"+nl+\n\"digitizing in a new polygon feature or graphic; and displaying the acres (hectares) of \"+nl+\n\"an existing polygon feature or graphic and the length of a polyline feature or graphic \"+nl+\n\"when selecting features.\"+nl+nl+\n\"Xtools makes these additions to the Table GUI:\"+nl+nl+\n\"An Xtools Menu with the following menu items:\"+nl+nl+\n\"* View/Change XTools Defaults\"+nl+\n\"* Field Properties\"+nl+\n\"* Table Structure Information\"+nl+\n\"* Table Statistics\"+nl+\n\"* Summarize Multiple Fields\"+nl+\n\"* Delete Multiple Fields\"+nl+\n\"* Recalculate Area, Perimeter , Length , Acres, Hectares\"+nl+\n\"* Export Table to Excel Spreadsheet. (MS Windows users only)\"+nl+nl+\n\"Xtools makes this addition to the Project GUI:\"+nl+nl+\n\"An Xtools Menu with:\"+nl+nl+\n\"* View/Change XTools Defaults\"+nl+\n\"* See Environment Paths: Shows the paths currently assigned to the following \"+nl+\n\" environment variables: HOME, TEMP, CWD, AVHOME, AVEXT, AVBIN, USEREXT, DEVEXT, TMPDIR.\"+nl+\n\"* About XTools...\"+nl+nl+\n\"Additional Information About XTools:\"+nl++nl+\n\"XTools has a web site at http://www.odf.state.or.us/stateforests/sfgis\"+nl++nl+\n\"At that web site you can find the latest version of XTools available for free download, \"+nl+\n\"an XTools FAQ, a comparison of XTools overlay operations to ArcInfo overlay operations, a \"+nl+\n\"description of spatial overlay bugs in ESRIs Avenue language at AV3.1 and AV3.2, a list \"+nl+\n\"of the new features available at each version of XTools, a list of known bugs in XTools, \"+nl+\n\"and XTools documentation.\"+nl+ +nl+\n\"Feedback:\"+nl+nl+\n\"Note: This ArcView Extension is not guaranteed to be free of bugs. Please report \"+nl+\n\"any bugs you find to mike.g.delaune@state.or.us\"+nl+nl+\n\"Give as complete a description of the problem as you can, along with the exact \"+nl+\n\"wording of any error messages. Before deciding that you have encountered a \"+nl+\n\"bug, please eliminate these potential sources of problems:\"+nl+nl+\n\"1. Many Xtools scripts create new shapefiles or alter existing shapefiles. Verify \"+nl+\n\"that you have wr ite permission in the location where the new or altered \"+nl+\n\"shapefile is being written. \"+nl+nl+\n\"2. Many Xtools scripts operate only on selected features in the input themes \"+nl+\n\"and overlay themes. If you do an overlay when no selected features overlap, \"+nl+\n\"you will get an empty shapefile as output.\"+nl+nl+\n\"Acknowledgements: \"+nl+nl+\n\"Buffer Selected Features is a script by Jim Peroutky. I picked \"+nl+\n\"it up off the ESRI site and made a couple of minor changes. Two of the scripts\"+nl+\n\"(Field Properties, and Table Structure Information) are ESRI sample scripts with no changes.\"+nl+nl+\n\"''Convert Shapes to Centroids'' was provided by Marco Boerlinga\"+nl+nl+\n\"''Make One PolyLine From Points\"\" was written by Mike Schuft.\"+nl++nl+\n\"The rest of the scripts were written by Mike DeLaune.\"+nl++nl+\n\"Have fun!\"+nl+nl+\n\"Mike DeLaune - 6/1/2001\"+nl\n\n msgbox.report(message,\"Description of the XTools Extension\")\n\n Clipboard.The.Empty\n Clipboard.The.Add(message)\n Clipboard.The.Update\n \n MsgBox.Info(\"Thes e instructions were copied to the system clipboard. To print them, open a text editor\"++\n \"(like notepad), paste in the contents of the clipboard, and print them from the text editor.\",\"PRINT INSTRUCTIONS\")" ) (Script.358 Name: "XTBatchWiz.Buttons" SourceCode: "' Name: XTBatchWiz.Buttons\n'\n' Title: XTools Batch Overlay\n'\n' Topics: Analysis, Themes\n'\n' Description: This script contains the processing instructions for all of the buttons in the XTBatchWiz Dialog. \n' When any of the buttons is pressed, this script is run.\n'\n' Requires: The XTBatchWiz Dialog must be open. \n'\n' SELF is the button on the XTBatchWiz Dialog that was pressed\n'\n' Returns: Not Applicable\n'\n'===========================================================\n\n\n' GET THE DIA LOG.\nxtdial = av.FindDialog(\"XTBatchWiz\")\n\n' OPEN THE DIALOG.\nif(SELF.Is(Choice))then\n if(SELF.GetLabel = \"XTools Batch Overlay\") then\n ' OPEN UP THE DIALOG AND FIND THE OBJECTS.\n xtdial = av.FindDialog(\"XTBatchWiz\")\n xtdial.Open \n \n theOpsList = {\"Clip\", \"Erase\", \"Intersect\", \"Identity\", \"Union\", \"Update\"}\n theOpsCombBox = xtdial.FindByName(\"cmbOperation\")\n theOpsCombBox.DefineFromList(theOpsList)\n if (xtdial.FindByName(\"txtBatch\").GetText = \"\") then \n xtdial.FindByName(\"lbl BatchFileSize\").SetLabel(\"\")\n end\n xtdial.FindByName(\"rbutSelect\").Select\n exit\n end\nend\n\n' \"SELECT OR CREATE A BATCH FILE\" BUTTON\nif (SELF.GetName = \"btnBatch\") then\n theFileBox = xtdial.FindByName(\"txtBatch\")\n theBatchLabel = xtdial.FindByName(\"lblBatchFileSize\")\n theWorkDir = av.GetProject.GetWorkDir\n theWorkDir.SetCWD\n if(xtdial.FindByName(\"rbutSelect\").IsSelected) then\n outputfile = FileDialog.Show(\"*.txt\",\"Xtools Batch File\",\"SELECT EXISTING BATCH FILE\")\n else\n defname = theWork Dir.MakeTMP(\"XTBat\", \"txt\")\n outputfile = FileDialog.Put(defname,\"*.txt\",\"CREATE NEW BATCH FILE\") \n end\n if (outputfile = nil) then exit end\n\n theFileBox.SetText(outputfile.GetFullName.AsString)\n theXtBatchFN = Filename.Make(theFileBox.GetText).GetFullName.AsFilename\n if (File.Exists(theXtBatchFN) = false) then\n xtdial.FindByName(\"lblBatchFileSize\").SetLabel(\"Batch File\"++theXtBatchFN.AsString++\"does not currently exist.\")\n else\n theXtBatchFile = LineFile.Make(theXtBatchFN, #FILE_PERM_READ)\n theBatchLabel.SetLabel(\"Batch File\"++theXtBatchFN.AsString++\"contains\"++theXtBatchFile.GetSize.AsString++\"operation(s).\")\n theXtBatchFile.Close \n end\n\n exit\n\n' \"SELECT AN INPUT THEME\" BUTTON\nelseif (SELF.GetName = \"btnInput\") then\n theFileBox = xtdial.FindByName(\"txtInput\")\n ' SELECT THE INPUT THEME\n srcnames = SourceDialog.Show(\"CHOOSE ONE INPUT THEME\")\n if (srcnames.Count = 0) then\n MsgBox.Warning(\"No Input Theme selected. Bailing!\",\"\")\n exit\n end\n \n if (srcnames.Count = 1 ) then \n theSRC = srcnames.Get(0)\n theFileBox.SetText(theSRC.GetDataSource + \" \" + theSRC.GetSubName) \n elseif ( srcnames.Count >= 2 ) then\n MsgBox.Warning(\"You may select only one Input theme. Bailing!\",\"\")\n end\n exit\n \n' \"SELECT AN OVERLAY THEME\" BUTTON\nelseif (SELF.GetName = \"btnOverlay\") then\n theFileBox = xtdial.FindByName(\"txtOverlay\")\n srcnames = SourceDialog.Show(\"CHOOSE ONE OVERLAY THEME (MUST BE POLYGON!)\")\n if (srcnames.Count = 0) then\n MsgBox.Warning(\"No Overlay Theme selected. Ba iling!\",\"\")\n exit\n end \n \n if (srcnames.Count = 1 ) then\n theSRC = srcnames.Get(0)\n if ((theSRC.GetSubName <> \"Polygon\") and (theSRC.GetSubName.Left(7) <> \"region.\")) then\n MsgBox.Warning(\"Overlay Theme Must Be Polygon. Bailing!\",\"\")\n exit\n end \n theFileBox.SetText(theSRC.GetDataSource + \" \" + theSRC.GetSubName)\n elseif ( srcnames.Count >= 2 ) then\n MsgBox.Warning(\"You may select only one Overlay theme. Bailing!\",\"\")\n exit\n end\n\n' \"NAME THE OUTPUT THEME\" BUTTON\nelsei f (SELF.GetName = \"btnOutput\") then\n theFileBox = xtdial.FindByName(\"txtOutput\")\n theWorkDir = av.GetProject.GetWorkDir\n theWorkDir.SetCWD\n defname = theWorkDir.MakeTMP(\"Output\", \"shp\")\n outputfile = FileDialog.Put(defname,\"*.shp\",\"NAME OUTPUT SHAPEFILE\")\n if (outputfile = nil) then exit end\n theFileBox.SetText(outputfile.GetFullName.AsString)\n exit\n \n' \"ADD BATCH OPERATION\" BUTTON\nelseif (SELF.GetName = \"btnAdd\") then\n if( (xtdial.FindByName(\"txtBatch\").GetText = \"\") or (xtdial.FindByName(\"txtIn put\").GetText = \"\") or\n (xtdial.FindByName(\"txtOverlay\").GetText = \"\") or (xtdial.FindByName(\"txtOutput\").GetText = \"\")) then\n MsgBox.Warning(\"Missing one or more batch file specifications! Enter all specifications and try again.\",\"\")\n exit\n end \n theBatchLabel = xtdial.FindByName(\"lblBatchFileSize\")\n theBatchLabel.SetLabel(\" \")\n theFileBox = xtdial.FindByName(\"txtBatch\")\n if (theFileBox.GetText = \"\") then\n MsgBox.Warning(\"No Batch File selected. Bailing!\",\"\")\n exit\n end\n theXtBatch FN = Filename.Make(theFileBox.GetText).GetFullName.AsFileName\n theXtBatchFile = LineFile.Make(theXtBatchFN, #FILE_PERM_APPEND)\n theStr = xtdial.FindByName(\"cmbOperation\").GetSelection++xtdial.FindByName(\"txtInput\").GetText++\n xtdial.FindByName(\"txtOverlay\").GetText++xtdial.FindByName(\"txtOutput\").GetText \n theXtBatchFile.WriteElt(theStr)\n theXtBatchFile.Close\n theXtBatchFile = LineFile.Make(theXtBatchFN, #FILE_PERM_READ)\n theBatchLabel.SetLabel(\"Batch File\"++theXtBatchFN.AsString++\"contains\"++theXtBa tchFile.GetSize.AsString++\"operation(s).\")\n theXtBatchFile.Close\n exit\n\n' \"VIEW BATCH FILE\" BUTTON\nelseif (SELF.GetName = \"btnView\") then\n theFileBox = xtdial.FindByName(\"txtBatch\")\n if (theFileBox.GetText = \"\") then\n MsgBox.Warning(\"No Batch File selected. Bailing!\",\"\")\n exit\n end\n theBFName = Filename.Make(theFileBox.GetText).GetFullName.AsFilename\n if (File.Exists(theBFName) = false) then\n MsgBox.Info(\"The XTools Batch file does not exist yet. Create a file using the Add Batch Operatio n button.\",\"\")\n exit\n end\n \n LogWin = TextWin.Make(theBFName, \"XTools Batch File View (Note: file can not be edited in this view. \"\n + \"Open it in a text editor if you wish to edit it directly.)\")\n Logwin.SetFixedFont(true)\n LogWin.Maximize\n LogWin.Open\n exit\n \n' \"HELP\" BUTTON\nelseif (SELF.GetName = \"btnHelp\") then\n message =\n\" \"+nl+\n\"Instructions For XTools Batch Overlay:\"+nl+nl+\n\"XTools Batch Overlay allows the user to run the XTools overlay functions (Clip, Erase, Identity,\"+nl+\n\"Intersec t, Union, and Update) from a batch file. The batch file must be in text file format and contain \"+nl+\n\"the following six pieces of information on one line for each batch operation request: \"+nl+nl+\n\"* The type of operation, \"+nl+\n\"* The full path name of the Input Theme source, \"+nl+\n\"* The feature type of the Input Theme (Point, Arc, Line, Polygon, Region.xxx, or Route.xxx). \"+nl+ \n\"* The full path name of the Overlay Theme source,\"+nl+\n\"* The feature type of the Overlay Theme (Polygon, or Region.xx x).\"+nl+ \n\"* The full path name of the Output shapefile. \"+nl+nl+ \n\"Examples: \"+nl+nl+\n\"Clip c:\\workplace\\citys.shp Point c:\\workplace\\states.shp Polygon c:\\workplace\\clip1.shp\"+nl+\n\"(This request will clip the cities.shp Input Theme with the states.shp Overlay theme and output the results \"+nl+\n\"as clip1.shp)\"+nl+nl+\n\"Intersect c:\\workplace\\roads route.paved c:\\workplace\\states.shp region.west c:\\workplace\\clip2.shp\"+nl+\n\"(This request will intersect the paved route coverage Input Theme with the west re gion coverage Overlay \"+nl+\n\"theme and output the results as inter1.shp)\"+nl+nl+\n\"Note: path names for input, overlay, and output sources can not contain any spaces. This is an ArcView limitation.\"+nl+nl+\n\"If the Input and Overlay themes are present in the View when the Batch Overlay script is run, the program \"+nl+\n\"will use only the selected features (if any) of those themes in the overlay operation. The program does \"+nl+\n\"not require the Input or Overlay theme to be present in the View. If a theme is not present in the View, \"+nl+\n\"all of its features are used in the overlay operation. The Output theme is added to the View when the \"+nl+\n\"overlay operation is complete.\"+nl+nl+\n\"The XTools Batch Overlay script checks the entire batch file for potential errors before starting the \"+nl+\n\"process. The batch requests are checked for the proper formatting. The Input and Overlay\"+nl+\n\"themes are checked to see if they are valid sources for the requested overlay operation. The Output\"+nl+ \n\"shapefile name is checked to be sure that there is no existing shapefile with the same name at the \"+nl+\n\"specified location.\"+nl+nl+\n\"* Valid Operation names are Clip, Erase, Identity, Intersect, Union, and Update.\"+nl+\n\"* For the Clip, Erase, Identity, and Intersect operations, valid Input Theme types are Point, Arc, Line, \"+nl+\n\" Polygon, Region.xxx, and Route.xxx. Line is used only for CAD files. Arc is used both for polyline \"+nl+\n\" shapefiles and arc features in ArcInfo coverages.\"+nl+\n\"* For the Union and Update operations, Polygon and Region.xxx are the only valid Input Theme types.\"+nl+\n\"* For the Overlay Theme, Polygon and Region.xxx are the only valid types.\"+nl+nl+\n\"If the error check finds errors in any of the batch file requests, the script will open a text window \"+nl+\n\"containing a message about each error.\"+nl+nl+\n\"The user may include comment lines in the batch file. Any line containing an apostrophe (') is treated as a \"+nl+\n\"comment line.\"+nl+nl+\n\"A batch overlay operation may be halted by th e user as follows:\"+nl+\n\"* Navigate to your $Home subdirectory.\"+nl+\n\"* Delete the file named XtStop.txt.\"+nl+\n\"* The batch overlay operation will halt as soon as the current operation is completed.\"+nl+\n\"While the batch operation is running there will be a dialog in the View with these instructions.\"+nl+nl+\n\"Additional information about the XTools overlay operations is available in the Shift Click instructions \"+nl+\n\"for the individual overlay operations. For instance, if you want information about the Un ion operation,\"+nl+ \n\"hold down the Shift key and click on the Union Polygon Themes item on the View XTools menu.\"+nl+nl+\n\"The batch file may be created in one of two ways:\"+nl+\n\"1. Create the batch file directly in a text editor.\"+nl+\n\"2. Use the XTools Batch File Dialog to create the batch file.\"+nl+nl+\n\"The instructions below assume that the XTools Batch File Dialog is being used to create the batch file.\"+nl+nl+\n\"Script by Mike DeLaune, (Email: mike.g.delaune@state.or.us), Oregon Department of Forestr y, 9/6/99. Updated 4/3/01.\"+nl+nl+\n\"Requires: A text file with XTools overlay commands.\"+nl+nl+\n\"Instructions:\"+nl+nl+\n\"Select the XTools Batch Overlay menu option in the View XTools menu. A dialog labeled ''XTools Batch File Dialog'' \"+nl+\n\"will appear. Each of the text boxes may be either filled in manually by the user, or filled in by the program as \"+nl+\n\"described below.\"+nl+nl+\n\"1. Select or Create a Batch File. The user may either select an existing batch file, or get a path and name for \"+nl+ \n\"a new batch file. To select an existing batch file, click on the Select Existing Batch File radio button, press \"+nl+\n\"the Open button on right of the text box, navigate to the subdirectory where the batch file exists, and select the \"+nl+\n\"file. If you do not need to make any additions to the batch file and want to run the existing batch file, skip \"+nl+\n\"steps 2 - 8 and go to step 9.\"+nl+nl+\n\" To create a new batch file, click on the Create New Batch File radio button, press the Open button on righ t of \"+nl+\n\" the text box, navigate to the subdirectory where the batch file exists, and select the file.\"+nl+nl+ \n\"2. Select an Overlay Operation. Click on the down arrow on the right side of the combo box and select the desired\"+nl+ \n\"operation.\"+nl+nl+\n\"3. Select an Input theme. Click on the Open button on the right of the text box, navigate to the subdirectory \"+nl+\n\"where data exists, select one data source and click on the OK button. The Input theme full path name and feature \"+nl+\n\"type will be entered in the text box.\"+nl+nl+\n\"4. Select an Overlay theme. Click on the Open button on the right of the text box, navigate to the subdirectory \"+nl+\n\"where data exists, select one data source and click on the OK button. The Overlay theme full path name and feature \"+nl+\n\"type will be entered in the text box.\"+nl+nl+\n\"5. Name the Output theme. Click on the Open button on the right of the text box, navigate to the subdirectory \"+nl+\n\"where you wish the output shapefile to reside, change the name of th e output file in the File Name box (if necessary) \"+nl+\n\"and click on the OK button. The Output shapefile full path name will be entered in the text box.\"+nl+nl+\n\"6. Press the Add Batch Operation button. This will add a line to the batch file in the appropriate batch file \"+nl+\n\"format and will display a message at the bottom of the dialog stating how many lines of operations the batch file \"+nl+\n\"contains.\"+nl+nl+ \n\"7. To add more operations, make appropriate changes in the specifications per steps 2 - 5 above and press the \"+nl+\n\"Add Batch Operation button. Any parameters of steps 2 - 5 that are not different for the new operation do not need \"+nl+\n\"to be respecified. For instance, if you wish to clip a number of shapefiles with the same overlay file, you only \"+nl+\n\"need to change items 3 and 5 and then press the Add Batch Operation button.\"+nl+nl+\n\"8. When all batch operations have been added, you may view the batch file by pressing the View Batch file button. \"+nl+ \n\"If you see an error in your b atch file specifications, you will need to open the file in a text editor program and \"+nl+\n\"make the edits directly. You can use the Edit Batch File button to do this.\"+nl+nl+\n\"9. When the batch file is ready to go, press the Run Batch File button to start the batch run process. \"+nl+nl+\n\"Note on Chaining Operations:\"+nl+nl+\n\"XTools batch overlay operations may be chained. This means that you can use the output theme of one step as the \"+nl+\n\"input or overlay theme of a subsequent step. However, since that output theme does not exist at the point when you \"+nl+\n\"are creating the batch file, you will need to enter the full path name and feature type of the theme manually.\"\n\n \n msgbox.report(message,\"XTools Batch Overlay Instructions\")\n \n Clipboard.The.Empty\n Clipboard.The.Add(message)\n Clipboard.The.Update\n \n MsgBox.Info(\"These instructions were copied to the system clipboard. To print them, open a text editor\"++\n \"(like notepad), paste in the contents of the clipboard, and print them from the text editor.\",\"PRINT INSTRUCTIONS\")\n exit\n \n' \"RUN BATCH FILE\" BUTTON\nelseif (SELF.GetName = \"btnRun\") then\n theFileBox = xtdial.FindByName(\"txtBatch\")\n if (theFileBox.GetText = \"\") then\n MsgBox.Warning(\"No Batch File selected. Bailing!\",\"\")\n exit\n end\n theBFName = Filename.Make(theFileBox.GetText).GetFullName.AsFilename\n if (File.Exists(theBFName) = false) then\n MsgBox.Info(\"The XTools Batch file does not exist yet. Create a file using the Add Batch Operation button.\",\"\")\n e xit\n end\n av.Run(\"XTBatchWiz.Run\",theBFName)\n exit\n \n' \"EDIT BATCH FILE\" BUTTON\nelseif (SELF.GetName = \"btnEdit\") then\n' CHECK $HOME FOR A TEXT FILE NAMED TEXTPATH.TXT CONTAINING THE PATH TO THE SYSTEM TEXT EDITER. IF NOT THERE, \n' ASK THE USER WHERE IT IS LOCATED, THEN MAKE AND STORE A FILE NAMED TEXTPATH.TXT\n\n' CHECK FOR THE EXISTENCE OF THE FILE NAMED TEXTPATH.TXT:\nthePathFileName = Filename.Make(\"$HOME/textpath.txt\").GetFullName.AsFilename\nthePathFileExists = File.Exists(thePathFileName)\n\n' IF TE XTPATH.TXT EXISTS, OPEN IT, AND READ THE PATH TO EXCEL:\nif (thePathFileExists = true) then\n thePathFile = LineFile.Make(thePathFileName, #FILE_PERM_MODIFY)\n theRecord = thePathFile.ReadElt\n theTextEditFile = Filename.Make(theRecord)\n theTextEditFileExists = File.Exists(theTextEditFile)\n thePathFile.Close \nend\n\n' IF EITHER FILE IS MISSING OR IN THE WRONG LOCATION, GET THE CORRECT LOCATION AND MAKE A NEW PATH FILE:\nif ((thePathFileExists = false) or (theTextEditFileExists = false)) then\n MsgBox.Info(\"X Tools needs to know where to find a text editor program. In the next dialog box, please navigate \" +\n \"to a text editor progam (like notepad.exe in Windows) and select it.\", \"\")\n theTextEditFile = FileDialog.Show(\"*.*\",\"Text Editor Program\", \"SELECT A TEXT EDITOR PROGRAM.\")\n if(theTextEditFile = nil) then exit end\n theTextEditFileExists = File.Exists(theTextEditFile)\n thePathFile2 = LineFile.Make(thePathFileName, #FILE_PERM_CLEARMODIFY)\n thePathFile2.WriteElt(theTextEditFile.GetName)\n thePathFile2.C lose\nend \n\nav.PurgeObjects\n\n' START THE TEXT EDITOR PROGRAM\nif (theTextEditFileExists = true) then\n system.Execute(theTextEditFile.AsString ++ xtdial.FindByName(\"txtBatch\").GetText)\nelse\n exit\nend\n\n' DELETE BATCH FILE BUTTON\nelseif (SELF.GetName = \"btnDelete\") then\n if(MsgBox.YesNo(\"Do you want to delete \" + xtdial.FindByName(\"txtBatch\").GetText + \"?\", \"DELETE BATCH FILE\", FALSE)) then\n theBFName = xtdial.FindByName(\"txtBatch\").GetText.AsFileName\n File.Delete(theBFName)\n xtdial.FindByName(\"tx tBatch\").SetText(\"\")\n xtdial.FindByName(\"lblBatchFileSize\").SetLabel(\"\")\n end\n\n' \"CLOSE\" BUTTON\nelseif (SELF.GetName = \"btnClose\") then\n xtdial.close\n exit\n\nend 'END OF ALL BUTTON CHECKS" ) (Script.359 Name: "aanView.XToolsLogFile" SourceCode: "' Name: aanView.XToolsLogFile\n'\n' Title: View XTools Log File\n'\n' Topics: View\n'\n' Description: See the \"Shift click\" instructions below for a script description.\n'\n' Requires: A file named $HOME/xtlog.txt.\n'\n' Self: Not Applicable\n'\n' Returns: Not Applicable\n'\n'===========================================================\n \n' Check for the shift key, if the shift key is down, pop up instructions for using this script\n \nif (System.IsShiftKeyDown) then\n message =\n \" \"+nl+\n \"Instructions For View XTools L og File:\"+nl+nl+\n \"The XTools Log File contains information about each XTools Clip, Erase, Identity, Intersect,\"+nl+\n \"Union, and Update operation run. The information includes the type of operation, full path name of the\"+nl+\n \"Input Theme source, full path name of the Overlay Theme source, full path name of the Output shapefile,\"+nl+\n \"the date and time that the operation completed, and the number of seconds that the operation took.\"+nl++nl+\n \"The log file also contains entries for most other XTools operations. Entries for other operations \"+nl+\n \"contain information appropriate for the specific operation.\"+nl++nl+\n \"The log file is named XTlog.txt. It is created automatically if it does not already exist, and log \"+nl+\n \"information for subsequent runs is appended. If the log file becomes too large, the user can delete \"+nl+\n \"old log entrys using any text editor.\"+nl++nl+\n \"Script by Mike DeLaune, (Email: mike.g.delaune@state.or.us), Oregon Department of Forestry, 9/6/99.\"+nl+ \n \"Requires: A file named $HOME/xtlog.txt.\"+nl+nl+\n \"Instructions:\"+nl+nl+\n \"1. Select the View XTools Log File menu option. This \"+nl+\n \"will open the log file for viewing only in a text window.\"+nl+nl+\n \"2. Close the text window when you are done viewing the log file. \"\n \n msgbox.report(message,\"View XTools Log File\")\n \n Clipboard.The.Empty\n Clipboard.The.Add(message)\n Clipboard.The.Update\n \n MsgBox.Info(\"These instructions were copied to the system clipboard. To print them, open a text editor\"+ +\n \"(like notepad), paste in the contents of the clipboard, and print them from the text editor.\",\"PRINT INSTRUCTIONS\")\n \n return nil\nend\n\n\n' OUTPUT TO AN XTOOLS LOG FILE:\ntheXtLogName = Filename.Make(\"$HOME/xtlog.txt\").GetFullName.AsFilename\nxtlogexists = File.Exists(theXtLogName)\nif(xtlogexists = false) then\n MsgBox.Info(\"The XTools Overlay Processing Log file does not exist yet. Run an overlay operation and a log file will be created.\",\"\")\n return nil\nend\n\nLogWin = TextWin.Make(theXtLogName, \"XTool s Overlay Processing Log File\")\nLogwin.SetFixedFont(true)\nLogWin.Maximize\nLogWin.Open\n\nreturn nil" ) (Script.360 Name: "aanSpace.Xtools2" ) (Script.361 Name: "aanView.ClipWithPolygons" SourceCode: "' Name: aanView.ClipWithPolygons\n'\n' Title: Clip With Polygon(s)\n'\n' Topics: Analysis, Themes\n'\n' Description: See the \"Shift click\" instructions below for a script description.\n'\n' Requires: At least two Fthemes in a View, one of which is a polygon theme. \n' Two additional scripts must be available: aanView.Sub-SetUp and aan.Sub-CalcSize\n'\n' Self: Not Applicable\n'\n' Returns: Not Applicable\n'\n'===========================================================\n \n' Check for the shift key, if the shif t key is down, pop up instructions for using this script\n \nif (System.IsShiftKeyDown) then\n message =\n \" \"+nl+\n \"Instructions For Clip With Polygon(s):\"+nl+nl+\n \"CLIP creates a new theme by overlaying two sets of features. The polygons of the overlay theme \"+nl+\n \"define the clipping region. CLIP uses the clipping region as a cookie cutter; only those input\"+nl+\n \"theme features that are within the clipping region are stored in the output theme. Input theme \"+nl+\n \"features can be points, polylines, or polygons. Overlay theme features must be polygons.\"+nl+\n \"Output theme features are of the same class as the input theme features. They are clipped to the \"+nl+\n \"outer boundary of the overlay theme. The feature table for the output theme contains the same fields\"+nl+\n \"as the input theme feature table. CLIP is one of several overlay commands available in ArcView. \"+nl+\n \"ERASE is similar to CLIP, except that input theme features which overlap the clip theme are erased\"+nl+\n \"instead of preserved. \"+nl+nl+\n \"If so specified in the XTools Defaults, CLIP will automatically update Area, Perimeter, and Acres (Hectares) fields \"+nl+\n \"present in a polygon output theme and update the length field in a polyline output theme. If these \"+nl+\n \"fields are not present in the input theme, the fields are automatically added to the output theme and \"+nl+\n \"then updated.\"+nl+nl+\n \"Script by Mike DeLaune, (Email: mike.g.delaune@state.or.us), Oregon Department of Forestry, 10/29/97.\"+nl+ \n \"Major revisions on 9/6/99, 11/1/2000.\"+nl+nl+\n \"Requires: At least two Fthemes in a View, one of which is a polygon theme.\"+nl+nl+\n \"Instructions:\"+nl+nl+\n \"1. Add some themes to the view, at least one of which \"+nl+\n \"is polygon.\"+nl+nl+\n \"2. If any features in the input theme are selected, Clip\"+nl+\n \"will only be applied to the selected features.\"+nl+nl+\n \"3. If you wish to use only some of the polygons in\"+nl+\n \"the Overlay theme, then select the ones you wish to use.\"+nl+nl+\n \"4. Select the Clip With Polygon(s) menu option.\"+nl+nl+\n \"5. In the first dialog box, select the theme containing \"+nl+\n \"the features that you want to clip. \"+nl+nl+\n \"6. In the second dialog box, select the polygon theme \"+nl+\n \"containing the features that you want to use to clip \"+nl+\n \"features in the first theme. \"+nl+nl+\n \"7. You will be asked for an output shapefile name for\"+nl+\n \"the new theme in the third dialog box.\"+nl\n \n msgbox.report(message,\"Clip With Polygon(s) Instructions\")\n \n Clipboard.The.Empty\n Clipb oard.The.Add(message)\n Clipboard.The.Update\n \n MsgBox.Info(\"These instructions were copied to the system clipboard. To print them, open a text editor\"++\n \"(like notepad), paste in the contents of the clipboard, and print them from the text editor.\",\"PRINT INSTRUCTIONS\")\n \n return nil\nend\n \n' RUN THE OVERLAY THEMES SCRIPT\nav.Run(\"aanView.OverlayThemes\", {\"Clip\"})" ) (Script.362 Name: "aanView.EraseFeatures" SourceCode: "' Name: aanView.EraseFeatures\n'\n' Title: Erase Features\n'\n' Topics: Analysis, Themes\n'\n' Description: See the \"Shift click\" instructions below for a script description. \n'\n' Requires: At least two Fthemes in a View, one of which is a polygon theme. \n' Two additional scripts must be available: aanView.Sub-SetUp and aan.Sub-CalcSize\n'\n' Self: Not Applicable\n'\n' Returns: Not Applicable\n'\n'===========================================================\n \n' Check for the shift key, if the shift key is down, pop up instructions for using this script\n \nif (System.IsShiftKeyDown) then\n message =\n \" \"+nl+\n \"Instructions For Erase Features:\"+nl+nl+\n \"ERASE creates a new theme by overlaying two sets of features. The polygons of the overlay theme \"+nl+\n \"define the erasing region. Input theme features that are within the erasing region are removed.\"+nl+\n \"The output theme contains only those input theme features that are outside the erasing region. \"+nl+\n \"Input theme features can be polygons, polyline s, or points; but erase theme features\"+nl+\n \"must be polygons. Output theme features are of the same class as the input theme features. They \"+nl+\n \"are clipped to the outer boundary of the erase theme polygons. The attribute table for the output\"+nl+\n \"theme contains the same items as the input theme feature attribute table.\"+nl+nl+\n \"If so specified in the XTools Defaults, ERASE will automatically update Area, Perimeter, and Acres (Hectares) fields \"+nl+\n \"present in a polygon output theme and updat e the length field in a polyline output theme. If these \"+nl+\n \"fields are not present in the input theme, the fields are automatically added to the output theme and \"+nl+\n \"then updated.\"+nl+nl+\n \"Script by Mike DeLaune, (Email: mike.g.delaune@state.or.us), Oregon Department of Forestry, 10/15/97. \"+nl+\n \"Major revision on 9/6/99, 11/1/2000.\"+nl+nl+\n \"Requires: At least two Fthemes in a View, one of which is a polygon theme.\"+nl+nl+ \n \"Instructions:\"+nl+nl+\n \"1. Add some themes to the view, at l east one of which \"+nl+\n \"is polygon.\"+nl+nl+\n \"2. If any features in the input theme are selected, Erase\"+nl+\n \"will only be applied to the selected features.\"+nl+nl+\n \"3. If you wish to use only some of the polygons in\"+nl+\n \" the Overlay theme, then select the ones you wish to use.\"+nl+nl+\n \"4. Select the Erase Features menu option.\"+nl+nl+\n \"5. In the first dialog box, select the theme containing \"+nl+\n \"the features that you want to erase. \"+nl+nl+\n \"6. In the second dialog box, select the pol ygon theme \"+nl+\n \"containing the features that you want to use to erase \"+nl+\n \"features in the first theme. \"+nl+nl+\n \"7. You will be asked for an output shapefile name for\"+nl+\n \"the new theme in the third dialog box.\"+nl\n \n msgbox.report(message,\"Erase Features Instructions\")\n \n Clipboard.The.Empty\n Clipboard.The.Add(message)\n Clipboard.The.Update\n \n MsgBox.Info(\"These instructions were copied to the system clipboard. To print them, open a text editor\"++\n \"(like notepad), paste in the contents of the clipboard, and print them from the text editor.\",\"PRINT INSTRUCTIONS\")\n \n return nil\nend\n \n' RUN THE OVERLAY THEMES SCRIPT\nav.Run(\"aanView.OverlayThemes\", {\"Erase\"})" ) (Script.363 Name: "aanView.IdentityTheme" SourceCode: "' Name: aanView.IdentityTheme\n'\n' Title: Identity\n'\n' Topics: Analysis, Themes\n'\n' Description: See the \"Shift click\" instructions below for a script description. \n'\n' Requires: At least two Fthemes in a View, one of which is a polygon theme. \n' Two additional scripts must be available: aanView.Sub-SetUp and aan.Sub-CalcSize\n'\n' Self: Not Applicable\n'\n' Returns: Not Applicable\n'\n'===========================================================\n \n' Check for the shift key, if the shift key is down, pop up instructions for using this script\n \nif (System.IsShiftKeyDown) then\n message =\n \" \"+nl+\n \"Instructions For Identity:\"+nl+nl+\n \"IDENTITY creates a new theme by overlaying two sets of features. The Output theme\"+nl+\n \"contains all of the Input theme features, and only those portions of Overlay theme features that overlap\"+nl+\n \"the Input theme. Input theme features can be points, polylines, or polygons. Overlay \"+nl+ \n \"theme features must be polygons. Output theme features resulting from t he overlay are of the same \"+nl+\n \"class as the Input theme features. Feature tables are also updated. The feature table for the Output\"+nl+\n \"theme contains all selected fields from the Input and Overlay theme feature tables. Selecting only \"+nl+\n \"the fields that you need in the output speeds up processing significantly.\"+nl+nl+\n \"If so specified in the XTools Defaults, IDENTITY will automatically update Area, Perimeter, and Acres (Hectares) fields \"+nl+\n \"present in a polygon output theme and upda te the length field in a polyline output theme. If these \"+nl+\n \"fields are not present in the input theme, the fields are automatically added to the output theme and \"+nl+\n \"then updated.\"+nl+nl+\n \"Script by Mike DeLaune, (Email: mike.g.delaune@state.or.us), Oregon Department of Forestry, 11/5/97. \"+nl+\n \"Major revision on 9/6/99, 11/1/2000.\"+nl+nl+\n \"Requires: At least two Fthemes in a View, one of which is a polygon theme.\"+nl+nl+\n \"Instructions:\"+nl+nl+\n \"1. Add some themes to the view, at leas t one of which \"+nl+\n \"is polygon.\"+nl+nl+\n \"2. Identity will be applied to all features in both themes.\"+nl+\n \"Any existing selections will be ignored.\"+nl+nl+\n \"3. Select the Identity menu option.\"+nl+nl+\n \"4. In the first dialog box, select the theme containing \"+nl+\n \"the features that you want to do an Identity operation on. \"+nl+nl+\n \"5. In the second dialog box, select the fields from the Input\"+nl+\n \"theme that you want in the Output theme.\"+nl+nl+\n \"6. In the third dialog box, select the p olygon theme \"+nl+\n \"containing the features that you want to use to do the\"+nl+\n \"Identity operation. \"+nl+nl+\n \"7. In the fourth dialog box, select the fields from the Overlay\"+nl+\n \"theme that you want in the Output theme.\"+nl+nl+\n \"8. You will be asked for an Output shapefile name for\"+nl+\n \"the new theme in the fifth dialog box.\"+nl\n \n msgbox.report(message,\"Identity Instructions\")\n \n Clipboard.The.Empty\n Clipboard.The.Add(message)\n Clipboard.The.Update\n \n MsgBox.Info(\"These inst ructions were copied to the system clipboard. To print them, open a text editor\"++\n \"(like notepad), paste in the contents of the clipboard, and print them from the text editor.\",\"PRINT INSTRUCTIONS\")\n \n exit\nend\n \n' RUN THE OVERLAY THEMES SCRIPT\nav.Run(\"aanView.OverlayThemes\", {\"Identity\"})" ) (Script.364 Name: "aanView.IntersectThemes" SourceCode: "' Name: aanView.IntersectThemes\n'\n' Title: Intersect Themes\n'\n' Topics: Analysis, Themes\n'\n' Description: See the \"Shift click\" instructions below for a script description. \n'\n' Requires: At least two Fthemes in a View, one of which is a polygon theme. \n' Two additional scripts must be available: aanView.Sub-SetUp and aan.Sub-CalcSize\n'\n' Self: Not Applicable\n'\n' Returns: Not Applicable\n'\n'===========================================================\n \n' Check for the shift key, if the shift ke y is down, pop up instructions for using this script\n \nif (System.IsShiftKeyDown) then\n message =\n \" \"+nl+\n \"Instructions For Intersect Themes:\"+nl+nl+\n \"INTERSECT creates a new theme by overlaying two sets of features. The Output theme contains only \"+nl+\n \"those portions of features that are in the area occupied by both the Input and Overlay themes. \"+nl+\n \"Input theme features can be points, polylines, or polygons. Overlay theme features \"+nl+\n \"must be polygons. Output theme features resulting fr om the overlay are of the same class as the \"+nl+\n \"Input theme features. They are split when they intersect with the polygons of the Overlay theme.\"+nl+\n \"Feature tables are also updated. The feature table for the Output theme contains selected fields from \"+nl+\n \"the Input and Overlay theme feature tables. Selecting only the fields that you need in the output\"+nl+\n \"speeds up processing significantly. INTERSECT is one of several overlay commands \"+nl+\n \"available in ArcView. Two others that are sim ilar are UNION and IDENTITY. They differ from \"+nl+\n \"INTERSECT only in the features which remain in the output theme. The feature tables are updated\"+nl+\n \"for all three of the commands.\"+nl+nl+\n \"If so specified in the XTools Defaults, INTERSECT will automatically update Area, Perimeter, and Acres (Hectares) fields \"+nl+\n \"present in a polygon output theme and update the length field in a polyline output theme. If these \"+nl+\n \"fields are not present in the input theme, the fields are automatically added to the output theme and \"+nl+\n \"then updated.\"+nl+nl+\n \"Script by Mike DeLaune, (Email: mike.g.delaune@state.or.us), Oregon Department of Forestry, 10/29/97. \"+nl+\n \"Major revision on 9/6/99, 11/1/2000.\"+nl+nl+\n \"Requires: At least two Fthemes in a View, one of which is a polygon theme.\"+nl+nl+\n \"Instructions:\"+nl+nl+\n \"1. Add some themes to the view, at least one of which \"+nl+\n \"is polygon.\"+nl+nl+\n \"2. If any features in the Input theme are selected, Intersect\"+nl+\n \"will only be applied to the selected features.\"+nl+nl+\n \"3. If you wish to use only some of the polygons in\"+nl+\n \" the Overlay theme, then select the ones you wish to use.\"+nl+nl+\n \"4. Select the Intersect Themes menu option.\"+nl+nl+\n \"5. In the first dialog box, select the theme containing \"+nl+\n \"the features that you want to intersect. \"+nl+nl+\n \"6. In the second dialog box, select the fields from the Input\"+nl+\n \"theme that you want in the Output theme.\"+nl+nl+\n \"7. In the third dialog box, select the polygon theme \"+nl+\n \"containing the features that you want to use to intersect \"+nl+\n \"features in the first theme. \"+nl+nl+\n \"8. In the fourth dialog box, select the fields from the Overlay\"+nl+\n \"theme that you want in the Output theme.\"+nl+nl+\n \"9. You will be asked for an Output shapefile name for\"+nl+\n \"the new theme in the fifth dialog box.\"+nl\n \n msgbox.report(message,\"Intersect Themes Instructions\")\n \n Clipboard.The.Empty\n Clipboard.The.Add(message)\n Clipboard.The.Update\n \n MsgBox.Info(\"T hese instructions were copied to the system clipboard. To print them, open a text editor\"++\n \"(like notepad), paste in the contents of the clipboard, and print them from the text editor.\",\"PRINT INSTRUCTIONS\")\n \n exit\nend\n \n' RUN THE OVERLAY THEMES SCRIPT\nav.Run(\"aanView.OverlayThemes\", {\"Intersect\"})" ) (Script.365 Name: "aanView.MergeThemes" SourceCode: "' Name: aanView.MergeThemes\n'\n' Title: Merge Themes\n'\n' Topics: Analysis, Themes\n'\n' Description: See the \"Shift click\" instructions below for a script description. \n'\n' Script by Mike DeLaune, (Email: mike.g.delaune@state.or.us), \n' Oregon Department of Forestry, 1997. Last Revised 5/17/2001.\n'\n' Requires: At least two Fthemes in a View. Two additional scripts must be available: aanView.Sub-SetUp \n' and aan.Sub-CalcSize\n'\n' Self: Not Applicable\n'\n' Returns: Not Applicable\n'\n'============================ ===============================\n \n' Check for the shift key, if the shift key is down, pop up instructions for using this script\n \nif (System.IsShiftKeyDown) then\n message =\n \" \"+nl+\n \"Instructions For Merge Themes:\"+nl+nl+\n \"MERGE creates a new theme by combining selected features from an input theme with selected\"+nl+\n \"features from a user-specified list of merge themes. In either theme, if user selects\"+nl+\n \"no features, all features are selected. The output theme contains all selected feature s \"+nl+\n \"from the input and merge theme(s). MERGE does not intersect features. Each selected\"+nl+\n \"feature in the input and merge theme(s) is maintained as a separate entity in the output\"+nl+\n \"theme. Input theme features can be points, multipoints, polylines, or polygons. \"+nl+\n \"However, all merge themes must have the same feature type as the input theme. In other words,\"+nl+\n \"you can not use Merge Themes to combine themes with different feature types.\" +nl+nl+\n \"Feature tables are also update d. Attributes of the input theme are maintained in the output\"+nl+\n \"theme. Each selected shape in the merge theme(s) will have one record in the output theme.\"+nl+\n \"Attributes of the merge theme(s) will be transferred to the output theme, for those fields \"+nl+\n \"that have names and field types that match a field name and type in the input theme.\"+nl+nl+\n \"If so specified in the XTools Defaults, MERGE will automatically update Area, Perimeter, and Acres (Hectares) fields \"+nl+\n \"present in a polygon output theme and update the length field in a polyline output theme. If these \"+nl+\n \"fields are not present in the input theme, the fields are automatically added to the output theme and \"+nl+\n \"then updated.\"+nl+nl+\n \"Script by Mike DeLaune, (Email: mike.g.delaune@state.or.us), Oregon Department of Forestry, 10/30/97.\"+nl+\n \"Updated 7/28/98, 11/1/2000.\"+nl+nl+\n \"Requires: At least two Fthemes in a View with the same feature type.\"+nl+nl+\n \"Instructions:\"+nl+nl+\n \"1. Add some themes to the view.\" +nl+nl+\n \"2. If any features in the input or merge themes are selected, Merge\"+nl+\n \"will be applied to the selected features. Otherwise, merge will be\"+nl+\n \"applied to all features in the theme.\"+nl+nl+\n \"3. Select the Merge Themes menu option.\"+nl+nl+\n \"4. In the first dialog box, select the input theme containing \"+nl+\n \"the fields that you want to preserve in the output theme. \"+nl+nl+\n \"5. In the second dialog box, select the theme(s) from the view\"+nl+\n \"that you wish to merge with the input theme.\"+nl+nl+\n \"6. In the third dialog box, you will be asked for an output shapefile name for\"+nl+\n \"the new theme.\"+nl\n \n msgbox.report(message,\"Merge Themes Instructions\")\n \n Clipboard.The.Empty\n Clipboard.The.Add(message)\n Clipboard.The.Update\n \n MsgBox.Info(\"These instructions were copied to the system clipboard. To print them, open a text editor\"++\n \"(like notepad), paste in the contents of the clipboard, and print them from the text editor.\",\"PRINT INSTRUCTIONS\")\n \n exit\nend\n \n''''''''''''''''''''''''''''''''''''''\n' INITIAL SET UP AND ERROR CHECKS:\n''''''''''''''''''''''''''''''''''''''\n' GET THE ACTIVE DOCUMENT, WHICH SHOULD BE A VIEW. BAIL IF NOT A VIEW:\ntheView=av.GetActiveDoc\nif (theView.Is(View).Not) then\n MsgBox.Error(\"This script must be run from a view. Exiting\",\"Error\")\n exit\nend\n \n' BUILD A LIST OF FTHEMES FROM THE THEME LIST. THE USER WILL BE ASKED TO SELECT FROM THE LIST.\nthms=List.Make\nfor each t in theView.GetThemes\n if (t.Is(Ftheme)) then\n thms.Add(t)\n end\nend\nav.PurgeObjects\n\n \n' IF < 2 THEMES ARE FTHEMES, BAIL OUT.\nif (thms.Count < 2) then\n System.Beep\n MsgBox.Error(\"There must be at least two feature themes in the View to proceed! Exiting.\",\"Error\")\n exit\nend\n\n\n' END OF THE INITIAL SETUP\n \n''''''''''''''''''''''''''''''''''''''''''''''''''''''''''\n' ASK FOR USER INPUT:\n'''''''''''''''''''''''''''''''''''''''''''''''''''''''''' \n \n' ASK THE USER WHICH THEME TO USE AS INPUT:\ntheInputTheme = MsgBox.Choice(thms,\"Select the theme that contains t he fields you wish \"+\n\"to preserve in the output:\",\"Merge! SELECT INPUT THEME\")\nif(theInputTheme = nil) then exit end\n\n' CHECK TO SEE IF MORE THAN ONE THEME IN THE VIEW HAS THE SAME NAME AS THE INPUT THEME.\ntcount = 0\nfor each t in thms\n if( t.GetName = theInputTheme.GetName ) then\n tcount = tcount + 1\n end\nend\n\nif( tcount > 1 ) then\n MsgBox.Warning(\"MERGE requires that the Input Theme name be unique in the View. \" +\n tcount.AsString ++ \"instances of \" + theInputTheme.GetName ++ \"were found in th e View.\"+\n \" Rename themes in Theme Properties and try again!\",\"\")\n exit\nend \n\n' GET THE SHAPE TYPE OF THE INPUT THEME:\ntheInputFTab = theInputTheme.GetFTab\ntheInputShapeFieldType = theInputFTab.FindField(\"shape\").GetType\n\n' BUILD A LIST OF FTHEMES FROM THE THEME LIST THAT HAVE THE SAME FEATURE TYPE AS THE INPUT THEME. \n' THE USER WILL BE ASKED TO SELECT FROM THE LIST.\nmThemes=List.Make\nfor each t in thms\n shapetype = t.GetFtab.FindField(\"Shape\").GetType\n if (shapetype = theInputShapeFieldType ) then \n mThemes.Add(t.GetName) \n end\n av.PurgeObjects\nend\n\n' REMOVE THE INPUT THEME FROM THE LIST OF MERGE THEMES, IF PRESENT:\ntheInputThemeIndex = mThemes.FindByValue(theInputTheme.GetName)\nif(theInputThemeIndex > -1) then\n mThemes.Remove(theInputThemeIndex)\nend\n \n' IF THERE ARE NO QUALIFIED MERGE FTHEMES, BAIL OUT.\nif (mThemes.Count < 1) then\n System.Beep\n MsgBox.Error(\"There must be at least one other feature theme in the View with the same feature type\"+ \n \" as the input theme to pro ceed! Exiting.\",\"Error\")\n exit\nend\n\ni=0\nFor Each i in 1..1000\n mergeThemes = Msgbox.MultiListAsString(mThemes,\"(Single click to toggle selection,\"+nl+\n \" click and drag for multiple selection,\"+nl+\"Press SHIFT + OK to select all themes)\",\n \"THEMES TO MERGE WITH\"++theInputTheme.AsString)\n\n if (System.IsShiftKeyDown) then\n mergeThemes = mThemes\n end\n\n if(mergeThemes = nil) then\n exit\n elseif (mergeThemes.Count < 1) then\n MsgBox.Info(\"Select a theme to merge.\",\"\")\n i=i+1\n else\n break\n end\nend \nav.PurgeObjects\n\n' CHECK TO SEE IF THE LIST CONTAINS MULTIPLE THEMES WITH THE SAME NAME.\ntheMcnt = mergeThemes.Count\nmergeThemes.RemoveDuplicates\nif( mergeThemes.Count <> theMcnt) then\n MsgBox.Warning(\"MERGE requires that all Merge Theme names be unique in the View. \" +\n \"Multiple instances of some names were found in the View.\"+\n \" Rename themes in Theme Properties and try again!\",\"\")\n exit\nend \n\n' ASK THE USER FOR A FILENAME AND LOCATION FOR THE NEW SHAPEFILE. EXIT IF USER CANCE LS.\ntheWorkDir = av.GetProject.GetWorkDir\ntheWorkDir.SetCWD\ndefname = theWorkDir.MakeTMP(\"Merge\", \"shp\")\noutputfile = FileDialog.Put(defname,\"*.shp\",\"NAME NEW THEME\")\nif (outputfile = nil) then exit end\n \n' END OF USER INPUT.\n \n'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''\n' BEGIN THE MERGE PROCESS\n'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''\n\ntime1 = Date.Now.AsSeconds\n \n' CHECK FOR ERRORS\ntheInputFields = theInputFTab.GetFields\nthecnt = 0\nfor each f in theInputFields \n if(f.isVisible = true) then\n thecnt = thecnt + 1\n end\nend \nif (thecnt < 2) then\n MsgBox.Info(\"In addition to the shape field, you need at least one other visible field in the Input Theme. Exiting!!\",\"\")\n exit\nend\n\n' CREATE A SHAPEFILE ON DISK FOR THE NEW FTAB. \nnewFtab = theInputFTab.Export(outputfile,Shape,theInputFTab.GetSelection.Count>0)\n\n' GET INFO ABOUT THE NEW FTAB\ntheNewShapeField = newFtab.FindField(\"shape\")\ntheNewShapeType = newFtab.FindField(\"shape\").GetType\ntheNewRecs = newFTab.Get NumRecords\nnewFTab.SetEditable(False)\nnewFTab.SetEditable(True)\nnewFTab.StartEditingWithRecovery\n\n' ADD A SOURCETHM FIELD, IF NOT ALREADY PRESENT, AND CALC IT TO THE INPUT THEME NAME\nif (newFTab.FindField(\"Sourcethm\") = nil) then\n theSourceTheme = Field.Make(\"Sourcethm\",#FIELD_CHAR,16,0)\n newFTab.AddFields({theSourceTheme})\nelse\n theSourceTheme = newFTab.FindField(\"Sourcethm\")\nend\n\ntheName = theInputTheme.GetName\nfor each rec in newFTab\n newFTab.SetValue(theSourceTheme,rec,theName)\nend \n\n' MAKE A LIS T OF OUTPUT THEME FIELDS, EXCLUDING THE SHAPE, AREA, LENGTH, ACRES, AND LENGTH FIELDS. \n' THEY WILL BE ADDED LATER.\nthenewFields = List.Make\nfor each f in newFTab.GetFields\n if ((f.GetAlias = \"Shape\") or (f.GetAlias = \"Area\") or (f.GetAlias = \"Perimeter\") or \n (f.GetAlias = \"Acres\") or (f.GetAlias = \"Length\")) then\n continue\n else \n fCopy = f.Clone\n thenewFields.Add(fCopy)\n end\nend\nav.PurgeObjects\n\n\n' FIGURE OUT THE TOTAL RECORDS TO BE PROCESSED:\ncurrentrec = 0\ntotalrec = 0 \nav.ShowStopB utton\nav.ShowMsg(\"Merging shapes....\")\n\nfor each t1 in mergeThemes\n t = theView.FindTheme(t1)\n if (t.GetFTab.GetSelection.Count=0) then\n totalrec = totalrec + t.GetFTab.GetNumRecords\n else\n totalrec = totalrec + t.GetFTab.GetNumSelRecords\n end \n av.PurgeObjects\nend\n \n' BEGIN THE LOOP THROUGH THE LIST OF THEMES:\n\nfor each t1 in mergeThemes\n t = theView.FindTheme(t1)\n ' GET MERGE THEME INFO\n theMergeFTab = t.GetFTab\n theMergeShapeField = theMergeFTab.FindField(\"shape\")\n theName = t .GetName\n \n ' GET THE FIELDS THAT ARE COMMON TO THE OUTPUT AND MERGE THEMES\"\n theMergeFields = theMergeFTab.GetFields\n theCommonFields = List.Make\n for each nf in thenewFields\n for each mf in theMergeFields\n if ((nf.GetAlias = mf.GetAlias) and (nf.GetType = mf.Gettype)) then\n theCommonFields.Add(nf)\n end\n end\n end\n \n ' DETERMINE WHICH RECORDS FROM THEMERGEFTAB ARE SELECTED, OR SELECT ALL IF NONE SELECTED\n theMergeSelRecs = theMergeFTab.GetSelection\n theOldMergeSel = theMer geFTab.GetSelection.Clone\n if (theMergeSelRecs.count=0) then\n theMergeSelRecs.SetAll\n end\n \n ' BEGIN TO LOOP THROUGH RECORDS IN THE MERGE THEME\n \n for each mergerec in theMergeSelRecs\n\n ' SHOW PROGRESS ROUTINE:\n currentrec = currentrec + 1\n progress = (currentrec / totalrec) * 100\n proceed = av.SetStatus( progress )\n if (proceed.Not) then\n av.ShowMsg( \"Stopped\" )\n exit\n end\n \n ' GET THE SHAPE FROM THE MERGE THEME RECORD.\n theMergeShape = theMergeFTab.returnvalu e(theMergeShapeField,mergerec)\n \n ' BAIL OUT IF THE SHAPE IS NULL (LIKE THE UNIVERSAL POLYGON IN AN ARCINFO POLYGON COVERAGE.)\n if(theMergeShape.IsNull = true) then\n continue\n end \n \n ' MAKE A NEW RECORD & SET THE VALUE OF THE SHAPEFIELD\n thenewRec = newFTab.AddRecord\n newFtab.SetValue(theNewShapeField,thenewRec,theMergeShape)\n newFTab.SetValue(theSourceTheme,thenewrec,theName)\n \n ' Transfer the values from merge theme fields that match output fields.\n if ((theCom monFields = nil).Not) then\n for each mf in theCommonFields\n theMField = theMergeFTab.FindField(mf.GetAlias)\n theNField = newFTab.FindField(mf.GetAlias)\n theMVal = theMergeFTab.ReturnValue(theMField,mergerec)\n newFtab.SetValue(theNField,thenewRec,theMVal)\n end\n end \n end ' end of for each mergerec in theMergeSelRecs\n \n\n theMergeFTab.SetSelection(theOldMergeSel)\n theMergeFTab.UpdateSelection\n av.PurgeObjects\nend ' end of for each t in mergeThemes\nx = totalrec + theNewRecs\nav.ShowMsg(\"Merging completed! Merged\"++x.AsString++\"shapes.\")\n \n \n' END OF THE MERGE PROCESS\n \n'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''\n' BEGIN THE POST-EDITING CALCULATIONS AND CLEANUP. \n'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''\n'Set editing OFF and clear selection.\nnewFTab.seteditable(false)\nnewFTab.GetSelection.Clearall\n \n' THE CALLED SCRIPT BELOW CONTAINS STANDARD ENDING ROUTINES FOR ALL ANALYSIS SCRIPTS. IT ADDS \n' AND CALCULATES AREA, PER IMETER, ACRES, AND LENGTH FIELDS AS NECESSARY AND APPRPRIATE.\nav.Run(\"aan.Sub-CalcSize\",{newFTab})\n\n' CREATE THE NEW THEME AND ADD IT TO THE VIEW\ntheOutputTheme = FTheme.Make(newFTab)\ntheView.AddTheme(theOutputTheme)\n\n' INDEX THE THEME, IF NECESSARY.\nif (newFTab.IsFieldIndexed(theNewShapeField) = False) then\n newFTab.CreateIndex(theNewShapeField)\nend\n\n' BRING THE VIEW TO THE FRONT AND CLEAN UP.\ntheView.InvalidateTOC(nil)\ntheView.GetWin.Activate\n\ntime2 = Date.Now.AsSeconds\ntottime = time2 - time1\n\n' OUTPUT TO AN XTOOLS LOG FILE:\ntheStr = \"MergeThemes \"+theInputFTab.GetBaseTableFilename.AsString+\" Merged with \"+mergeThemes.Count.AsString+\" other theme(s) into \"+\nnewFTab.GetBaseTableFilename.AsString+\" \"+\"[\"+Date.Now.AsString+\"] [\"+tottime.SetFormat(\"d\").AsString++\"secs]\"\nav.Run(\"aan.Sub-LogFile\", theStr)\nav.ShowMsg(theStr)" ) (Script.366 Name: "aanView.UnionPolygonThemes" SourceCode: "' Name: aanView.UnionPolygonThemes\n'\n' Title: Union\n'\n' Topics: Analysis, Themes\n'\n' Description: See the \"Shift click\" instructions below for a script description. \n'\n' Requires: At least two Fthemes in a View, both of which are polygon themes. \n' Two additional scripts must be available: aanView.Sub-SetUp and aan.Sub-CalcSize\n'\n' Self: Not Applicable\n'\n' Returns: Not Applicable\n'\n'===========================================================\n \n' Check for the shift key, if the shift key is do wn, pop up instructions for using this script\n \nif (System.IsShiftKeyDown) then\n message =\n \" \"+nl+\n \"Instructions For UNION POLYGON THEMES:\"+nl+nl+\n \"Description: UNION creates a new theme by overlaying two polygon themes. The Output theme contains\"+nl+\n \"the combined polygons of both themes. Only polygon themes can be combined using UNION. Arcs of the\"+nl+\n \"Input theme polygons are split at their intersection with polygons of the Overlay theme. Feature \"+nl+\n \"tables are also updated. The featu re table for the Output theme contains all user-selected fields\"+nl+\n \"from the Input and Overlay theme feature tables. Selecting only the fields that you need in the \"+nl+\n \"Output theme speeds up processing significantly.\"+nl++nl+\n \"If so specified in the XTools Defaults, UNION will automatically update Area, Perimeter, and Acres \"+nl+\n \"(Hectares) fields present in a polygon output theme. If these fields are not present in the input \"+nl+\n \"theme, the fields are automatically added to the output th eme and then updated.\"+nl+nl+\n\n \"Script by Mike DeLaune, (Email: mike.g.delaune@state.or.us),\"+nl+\n \"Oregon Department of Forestry, 11/7/97.\"+nl+\n \"Major revision on 9/6/99, 11/1/2000.\"+nl+nl+\n \"Requires: At least two Fthemes in a View, both of which are polygon themes.\"+nl+nl+\n \" Brief Instructions:\"+nl+nl+\n \"1. Add some themes to the view, at least two of which \"+nl+\n \"are polygon.\"+nl+nl+\n \"2. Union will be applied to all features in both themes.\"+nl+\n \"Any existing selections will be ignored.\" +nl+nl+\n \"3. Select the Union Polygon Themes menu option.\"+nl+nl+\n \"4. In the first dialog box, select the Input theme containing \"+nl+\n \"the features that you want to do a Union operation on. \"+nl+nl+\n \"5. In the second dialog box, select the fields from the Input\"+nl+\n \"theme that you want in the Output theme.\"+nl+nl+\n \"6. In the third dialog box, select the polygon theme \"+nl+\n \"containing the features that you want to union with the\"+nl+\n \"features of the Input theme. \"+nl+nl+\n \"7. In the fourt h dialog box, select the fields from the Overlay\"+nl+\n \"theme that you want in the Output theme.\"+nl+nl+\n \"8. You will be asked for an Output shapefile name for\"+nl+\n \"the new theme in the fifth dialog box.\"+nl\n \n msgbox.report(message,\"Union Polygon Themes Instructions\")\n \n Clipboard.The.Empty\n Clipboard.The.Add(message)\n Clipboard.The.Update\n \n MsgBox.Info(\"These instructions were copied to the system clipboard. To print them, open a text editor\"++\n \"(like notepad), paste in the cont ents of the clipboard, and print them from the text editor.\",\"PRINT INSTRUCTIONS\")\n \n exit\nend\n \n' RUN THE OVERLAY THEMES SCRIPT\nav.Run(\"aanView.OverlayThemes\", {\"Union\"})" ) (Script.367 Name: "aanView.UpdatePolygonTheme" SourceCode: "' Name: aanView.UpdatePolygonTheme\n'\n' Title: Update Polygon Theme\n'\n' Topics: Analysis, Themes\n'\n' Description: See the \"Shift click\" instructions below for a script description. \n'\n' Requires: At least two Fthemes in a View, both of which are polygon themes. \n' Two additional scripts must be available: aanView.Sub-SetUp and aan.Sub-CalcSize\n \n'\n' Self: \n'\n' Returns:\n'\n'===========================================================\n\n' Check for the shift key, if the shift key is down, pop up ins tructions for using this script\n\nif (System.IsShiftKeyDown) then\n message =\n \" \"+nl+\n \"Instructions for UPDATE POLYGON THEME:\"+nl+nl+\n \"UPDATE POLYGON THEME creates a new theme by overlaying two sets of features. The features of\"+nl+\n \"the Overlay theme define the updating extent. UPDATE uses the updating extent in a `cut-and-paste'\"+nl+\n \"operation; Overlay theme features replace the area they overlap in the Input theme. The result\"+nl+\n \"is stored in the Output theme. Both the Input and Overlay the mes must have polygon features.\"+nl+\n \"Attributes of the Input theme are maintained in the Output theme. Each polygon shape in the \"+nl+\n \"Overlay theme will have one record in the Output theme. Attributes of the Overlay theme will be\"+nl+ \n \"transferred to the Output theme, for those fields that have names and field types that\"+nl+ \n \"match a field name and type in the Input theme. \"+nl+nl+\n \"If so specified in the XTools Defaults, UPDATE will automatically update Area, Perimeter, and Acres \"+nl+\n \"(Hectares) fields present in a polygon output theme. If these fields are not present in the input \"+nl+\n \"theme, the fields are automatically added to the output theme and then updated.\"+nl+nl+\n \"UPDATE is one of several overlay tools available in XTools. ERASE is similar to UPDATE, except that \"+nl+\n \"the input theme features which overlap the updating extent are erased instead of updated. ERASE can \"+nl+\n \"also be used on arc and point features. Other overlay tools are CLIP, INTERSECT, MERGE, UNION \"+nl+\n \"and IDENTITY. See the individual script descriptions for more information about each.\"+nl+nl+\n \"Script by Mike DeLaune, (Email: mike.g.delaune@state.or.us), Oregon Department of Forestry, 10/13/97. \"+nl+\n \"Major revision on 9/6/99, 11/1/2000.\"+nl+nl+\n \"Requires: At least two Fthemes in a View, both of which are polygon themes.\"+nl++nl+\n \"Instructions:\"+nl+nl+\n \"1. Add some themes to the view, two of which are polygon.\"+nl+nl+\n \"2. If any features in the Input theme are selected, Update\"+nl+ \n \"will only be applied to the selected features.\"+nl+nl+\n \"3. If you wish to use only some of the polygons in\"+nl+\n \" the Overlay theme, then select the ones you wish to use.\"+nl+nl+\n \"4. Select the Update Polygon Theme XTools menu option.\"+nl+nl+\n \"5. In the first dialog box, select the polygon theme \"+nl+\n \" containing the features that you want to update. \"+nl+nl+\n \"6. In the second dialog box, select the polygon theme \"+nl+\n \"containing the features that you want to use to update the \"+nl+\n \" features in the first theme. \"+nl+nl+\n \"7. You will be asked for an Output shapefile name for\"+nl+\n \"the new theme in the third dialog box.\"+nl\n \n msgbox.report(message,\"UPDATE POLYGON THEME Instructions\")\n \n Clipboard.The.Empty\n Clipboard.The.Add(message)\n Clipboard.The.Update\n \n MsgBox.Info(\"These instructions were copied to the system clipboard. To print them, open a text editor\"++\n \"(like notepad), paste in the contents of the clipboard, and print them from the text editor.\",\"PRINT INSTRUCTIONS\")\n \n exit\nend\n\n' RUN THE OVERLAY THEMES SCRIPT\nav.Run(\"aanView.OverlayThemes\", {\"Update\"})" ) (Script.368 Name: "aanSpace.Xtools3" ) (Script.369 Name: "aanView.CalcSize" SourceCode: "' Name: aanView.CalcSize\n' \n' Title: Calculate Area, Perimeter , Length & Acres / Hectares\n' \n' Topics: GeoData\n'\n' Description: See the \"Shift click\" instructions below for a script description.\n'\n' Requires: A View with at least one polygon or polyline theme. The User must have write \n' access to the selected theme(s).\n'\n' Self:\n'\n' Returns:\n'===========================================================\n\n' Check for the shift key, if the shift key is down, pop up instructions for using this scr ipt\n\nif (System.IsShiftKeyDown) then\n message =\n \" \"+nl+\n \"Instructions for Calculate Area, Perimeter , Length & Acres / Hectares:\"+nl+nl+\n \"This script calculates the area, perimeter, acres and/or hectares for polygon themes, and length\"+nl+\n \"for line themes. Calculations are based on the user specifications set in the XTools Defaults dialog.\"+nl++nl+\n \"The script processes the list of polygon and polyline themes selected by the user and makes the \"+nl+\n \"appropriate calculation based on theme ty pe.\"+nl+nl+\n \"The script will add the fields: Area, Perimeter, and Acres and/or Hectares to polygon themes; and Length\"+nl+\n \"to line themes if the fields do not exist. If the fields exist, their values will be recalculated.\"+nl+nl+\n \"If a theme was open for editing when the script began running, the theme will be left open for editing\"+nl+\n \"when the script completes.\"+nl++nl+\n \"The script was written by Mike DeLaune, (Email: mike.g.delaune@state.or.us),\"+nl+\n \"Oregon Department of Forestry on 10/19/ 97 and revised on April 13, 2000.\"+nl+nl+\n \"Requires: A View with at least one polygon or polyline theme. The User must have write\"+nl+\n \"access to the selected theme(s). Calls the aan.Sub-CalcSize script. \"+nl+nl+\n \"Instructions:\"+nl+nl+\n \"1. Set the XTools Defaults. The Defaults dialog can be called from XTools menus in the Project, View, \"+nl+\n \"and Table windows.\"+nl++nl+\n \"2. Have at least one polygon or polyline theme in the view.\"+nl+nl+\n \"3. Select the Recalculate Area, Perimeter , Lengt h & Acres / Hectares XTools menu option.\"+nl+nl+\n \"4. In the dialog box, select the theme(s) that you wish to update. \"\n \n msgbox.report(message,\"Calculate Area, Perimeter , Length & Acres / Hectares Instructions\")\n \n Clipboard.The.Empty\n Clipboard.The.Add(message)\n Clipboard.The.Update\n \n MsgBox.Info(\"These instructions were copied to the system clipboard. To print them, open a text editor\"++\n \"(like notepad), paste in the contents of the clipboard, and print them from the text edito r.\",\"PRINT INSTRUCTIONS\")\n \n exit\nend\n\n''''''''''''''''''''''''''''''''''''''''''''''''''''''''''\n' BEGIN INITIAL SETUP:\n'''''''''''''''''''''''''''''''''''''''''''''''''''''''''' \n\n' GET THE ACTIVE DOCUMENT, WHICH SHOULD BE A VIEW. BAIL IF NOT A VIEW:\ntheView=av.GetActiveDoc\nif (theView.Is(View).Not) then\n MsgBox.Error(\"This script must be run from a view. Exiting\",\"Error\")\n return nil\nend\n\n' BUILD A LIST OF FTHEMES FROM THE THEME LIST. THE USER WILL BE ASKED TO SELECT FROM THE LIST.\nppthms=List.M ake\nfor each t in theView.GetThemes\n if (t.Is(Ftheme)) then\n shapetype = t.GetFtab.FindField(\"Shape\").GetType\n if ((shapetype = #FIELD_SHAPELINE) or (shapetype = #FIELD_SHAPEPOLY)) then \n ppthms.Add(t)\n end\n end\n av.PurgeObjects\nend\n\n' IF < 1 THEMES ARE POLYLINE OR POLYGON FTHEMES, BAIL OUT.\nif (ppthms.Count < 1) then\n System.Beep\n MsgBox.Error(\"There must be at least one polyline or polygon feature theme in the View to proceed! Exiting.\",\"Error\")\n exit\nend\n\n \n' END OF TH E INITIAL SETUP\n\n''''''''''''''''''''''''''''''''''''''''''''''''''''''''''\n' ASK FOR USER INPUT:\n'''''''''''''''''''''''''''''''''''''''''''''''''''''''''' \n\n' ASK THE USER WHICH THEMES TO UPDATE:\nselList = Msgbox.MultiList(ppthms,\"Select Themes To Calculate Feature Size\"+nl+\"(single click to toggle selection,\"+nl+\n\" click and drag for multiple selection)\",\"CALCULATE FEATURE SIZE\")\n\n' CHECK TO SEE IF SOME THEMES WERE SELECTED, BAIL IF NOT:\nif ((nil = selList) or (sellist.count = 0)) then\n msgbox.info (\"No themes were selected, bailing.\",\"CALCULATE FEATURE SIZE\")\n exit\nend\n\nav.PurgeObjects \n\n' END OF USER INPUT.\n\ntime1 = Date.Now.AsSeconds\n\ntotRecs = 0\nselRecs = 0\nfor each theThm in selList\n totRecs = theThm.GetFtab.GetNumRecords + totRecs\n tmpRecs = theThm.GetFtab.GetNumSelRecords\n if(tmpRecs = 0) then\n tmpRecs = theThm.GetFtab.GetNumRecords \n end \n selRecs = tmpRecs + selRecs\nend \n\n' FIND OUT IF A PROJECTION IS SET, SAVE IT, UNSET IT AND CUT GRAPHICS UNTIL THE END.\nthesaveprj = theView.Ge tProjection.clone\nif(thesaveprj.IsNull = false) then\n theView.GetGraphics.SelectAll\n theView.GetGraphics.CutSelected\n themapunits = theView.GetUnits.Clone\n theView.SetProjection(prj.MakeNull)\nend\n \n\nav.Run(\"aan.Sub-CalcSize\", selList )\n\n' RESET THE PROJECTION AND THE GRAPHICS, IF NECESSARY.\nif(thesaveprj.IsNull = false) then\n theView.SetProjection(thesaveprj)\n theView.SetUnits(themapunits)\n theView.GetGraphics.Paste\nend\n\ntime2 = Date.Now.AsSeconds\ntottime = time2 - time1\n\n' OUTPUT TO AN XTOOLS LOG F ILE:\ntheStr = \"ViewCalcSize\"+\" \"+selList.Count.AsString+\" theme(s) calculated \"+\"[\"+Date.Now.AsString+\"] [\"+\ntotRecs.AsString+\" records calculated.] [\"+tottime.AsString++\"secs]\"\nav.Run(\"aan.Sub-LogFile\", theStr)\nav.ShowMsg(theStr)" ) (Script.370 Name: "aanView.XtoolsTransferSelectedFeatures" SourceCode: "' Name: aanView.XtoolsTransferSelectedFeatures\n'\n' Title: Transfer / Convert Selected Features\n'\n' Topics: Analysis, Themes\n'\n' Description: See the \"Shift click\" instructions below for a script description. \n'\n' Requires: At least two Fthemes in a View.\n'\n' Self: Not Applicable\n'\n' Returns: Not Applicable\n'\n'===========================================================\n \n' Check for the shift key, if the shift key is down, pop up instructions for using this script\n \nif (System.IsShiftKeyDown) then\n messa ge =\n \" \"+nl+\n \"Instructions For Transfer / Convert Selected Features script:\"+nl+nl+\n \"This script provides an easy process for copying selected spatial features \"+nl+\n \"from one theme and pasting them into another theme. The ''paste to'' theme\"+nl+\n \"must have either the same feature type as the ''copy from'' theme, or have \"+nl+\n \"a less complex feature type. If the ''paste to'' theme feature type is less \"+nl+\n \"complex than the ''copy from'' theme, the script will automatically convert \"+nl+\n \"the copied features to the less complex feature type before pasting. For \"+nl+\n \"instance, copied polygon features would be converted to polylines, multipoints,\"+nl+\n \"or points (whichever is appropriate) if the ''paste to'' theme is not polygon.\"+nl+\n \"Feature types decrease in complexity in this order: Polygon, Polyline, Multipoint,\"+nl+\n \"Point.\"+nl++nl+\n \"This script can not be used to build features that are more complex than the source \"+nl+\n \"features. This means that you can not use this s cript to build Polylines from\"+nl+\n \"Points, Polygons from Polylines or Points, etc. Such operations are beyond the \"+nl+\n \"scope of this script.\"+nl++nl+\n \"Brief instructions:\"+nl++nl+\n \"1. Make the theme that you want to copy features from active, and select the features\"+nl+\n \" that you want to copy. Feature selection may be done using any of the selection \"+nl+\n \" tools provided in the standard ArcView user interface.\" +nl++nl+\n \"2. Select the ''Transfer / Convert Selected Features'' option on the View XEdit menu.\"+nl++nl+\n \"3. In the first message box, select the name of the ''copy from'' theme.\"+nl++nl+\n \"4. In the second message box, select the name of the ''paste to'' theme.\"+nl++nl+\n \"5. The selected features are then pasted into the selected 'paste to'' theme.\"+nl++nl+\n \"Script by Mike DeLaune, (Email: mike.g.delaune@state.or.us), Oregon Department of Forestry, 1/18/98.\"\n \n \n msgbox.report(message,\"Transfer / Convert Selected Features Instructions\")\n \n Clipboard.The.Empty \n Clipboard.The.Add(message)\n Clipboard.The.Update\n \n MsgBox.Info(\"These instructions were copied to the system clipboard. To print them, open a text editor\"++\n \"(like notepad), paste in the contents of the clipboard, and print them from the text editor.\",\"PRINT INSTRUCTIONS\")\n \n return nil\nend\n \n''''''''''''''''''''''''''''''''''''''\n' Initial set up and error checks:\n''''''''''''''''''''''''''''''''''''''\n\n' Get the active document, which should be a view. Bail if not a view:\ntheView=av.GetAc tiveDoc\nif (theView.Is(View).Not) then\n MsgBox.Error(\"This script must be run from a view. Exiting\",\"Error\")\n exit\nend\n\n \n' Build a list of fthemes from the theme list. The user will be asked to select from the list.\nthms = List.Make\nfor each t in theView.GetThemes\n if (t.Is(Ftheme) and t.CanEdit) then\n thms.Add(t)\n end\nend\n \n' If < 2 themes are fthemes, bail out.\nif (thms.Count < 2) then\n System.Beep\n MsgBox.Error(\"There must be at least two feature themes in the View to proceed! Exiting.\",\"Er ror\")\n exit\nend\n \n \n' END OF THE INITIAL SETUP\n \n''''''''''''''''''''''''''''''''''''''''''''''''''''''''''\n' Ask for User input:\n'''''''''''''''''''''''''''''''''''''''''''''''''''''''''' \n\n' Ask the user which theme to copy from:\ntheFromTheme = MsgBox.Choice(thms,\"Select the theme that contains features that you wish to copy (only\"+\n\" shapefiles can be opened for copying):\",\"Copy Features! SELECT ''FROM'' THEME\")\nif(theFromTheme = nil) then exit end\n\n'Get info about the From them e:\ntheFromFTab = theFromTheme.GetFtab\ntheFromClass = theFromFTab.GetShapeClass.GetClassName\ntheFromFields = theFromFTab.GetFields\ntheFromSelRecNum = theFromFtab.GetSelection.Count\ntheFromShapeField = theFromFtab.FindField(\"shape\")\n\nif (theFromSelRecNum = 0) then\n MsgBox.Warning(\"There are no selected records in the ''From'' theme. Exiting\",\"\")\n exit\nend\n\n\n' Remove the \"From\" theme from the list of themes, if present:\ntheFromThemeIndex = thms.Find(theFromTheme)\nif(theFromThemeIndex > -1) then\n thms.Remov e(theFromThemeIndex)\nend \n \n' Ask the user which theme the features should be pasted into:\ntheToTheme = MsgBox.Choice(thms,\"Select the theme that the copied features should be pasted into. \",\n\"Paste Features! SELECT ''TO'' THEME\")\nif(theToTheme = nil) then exit end\n \n \n' END OF USER INPUT.\n \n'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''\n' Begin the Transfer / Convert Features process\n'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''\n\n'Set the select mode to Normal, if n ecessary (note: this insures that all selected features will be transferred.\nSelectionReset = FALSE\nif(theView.GetSelectMode = #GRAPHICS_SELECT_VERTEX) then\n theView.SetSelectMode (#GRAPHICS_SELECT_NORMAL)\n SelectionReset = TRUE\nend\n\n'Get info about the To theme:\ntheToFTab = theToTheme.GetFtab\ntheToClass = theToFTab.GetShapeClass.GetClassName\ntheToFields = theFromFTab.GetFields\ntheToShapeField = theToFtab.FindField(\"shape\")\n\n\n' Do this routine if the shape classes are the same.\nif (theFromClass = TheToCl ass) then\n theView.SetEditableTheme(theFromTheme)\n theFromTheme.CopySelected\n theFromTheme.StopEditing(FALSE)\n \n theView.SetEditableTheme(theToTheme)\n theToTheme.GetFTab.BeginTransaction\n theToTheme.Paste\n theToTheme.GetFTab.EndTransaction\n theToTheme.StopEditing(TRUE)\n theToTheme.ClearSelection\n \n ' The called script below contains standard ending routines for all analysis scripts. It adds \n ' and calculates area, perimeter, acres, and length fields as necessary and appropriate.\n av.Run(\"aan .Sub-CalcSize\",{theToFTab})\n \n theView.Invalidate\n av.GetProject.SetModified(true)\n exit\nend\n\n' If the shapes are different do the following:\n\n' Get the dimension of the shapes for the From and To Themes:\ntheFromShape = theFromFTab.ReturnValue(theFromShapeField,0)\ntheFromDimension = theFromShape.GetDimension\nif (theToClass = \"Polygon\") then\n theToDimension = 2\nelseif (theToClass = \"Polyline\") then\n theToDimension = 1\nelse\n theToDimension = 0\nend\n\n\n' Exit if the shape conversion can not be done (ie the dimension of the \"to\" shape \n' is higher than the \"from\" shape.\nif( theFromDimension < theToDimension) then\nMsgBox.Warning(\"This script can not convert \"+theFromClass+\" shapes to \"+theToClass+\" shapes. Exiting\",\"\")\n exit\nend\n\n' Make a list of selected \"From\" shapes:\ntheFromShapeList = List.Make\ntheToShapeList = List.Make\nfor each rec in theFromFTab.GetSelection\n theFromShapeList.Add(theFromFTab.ReturnValue(theFromShapeField,rec))\nend\n\n\n' Feature conversion routines:\n\n' Polygon Conversion Routines: \nif ((theFromClass = \"Polygon\") and (theToClass = \"Polyline\")) then \n for each fromShape in theFromShapeList\n theToShapeList.Add(fromShape.AsPolyline)\n end \nelseif ((theFromClass = \"Polygon\") and (theToClass = \"MultiPoint\")) then \n for each fromShape in theFromShapeList\n theToShapeList.Add(fromShape.AsPolyline.AsMultipoint)\n end \nelseif ((theFromClass = \"Polygon\") and (theToClass = \"Point\")) then \n theTempList = List.Make\n for each fromShape in theFromShapeList\n theTempList.Add(fromShape.AsPo lyline.AsList)\n end\n for each tList in theTempList\n for each tp in tList\n for each pt in tp\n theToShapeList.Add(pt)\n end \n end \n end\n\n \n' Polyline Conversion Routines:\nelseif ((theFromClass = \"Polyline\") and (theToClass = \"MultiPoint\")) then \n for each fromShape in theFromShapeList\n theToShapeList.Add(fromShape.AsMultipoint)\n end \nelseif ((theFromClass = \"Polyline\") and (theToClass = \"Point\")) then \n theTempList = List.Make\n for each fromShape in theFromShapeList\n th eTempList.Add(fromShape.AsList)\n end\n for each tList in theTempList\n for each tp in tList\n for each pt in tp\n theToShapeList.Add(pt)\n end \n end \n end\n \n \n' MultiPoint Conversion Routine:\nelseif ((theFromClass = \"MultiPoint\") and (theToClass = \"Point\")) then \n theTempList = List.Make\n for each fromShape in theFromShapeList\n theTempList.Add(fromShape.AsList)\n end\n for each tList in theTempList\n for each pt in tList\n theToShapeList.Add(pt)\n end \n end\n\n \nend \n\n' Add the converted \"From\" shapes to the \"To\" Theme:\ntheToFTab.SetEditable(False)\ntheToFTab.SetEditable(True)\ntheToFTab.StartEditingWithRecovery\nfor each toShape in theToShapeList\n thenewRec = theToFTab.AddRecord\n theToFtab.SetValue(theToShapeField,thenewRec,toShape)\nend\n\n' END OF THE Transfer / Convert Selected Features PROCESS\n \n'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''\n' Begin the post-editing calculations and cleanup. \n'''''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''\n'Set editing OFF .\ntheToFTab.seteditable(false)\n\n' The called script below contains standard ending routines for all analysis scripts. It adds \n' and calculates area, perimeter, acres, and length fields as necessary and appropriate.\nif(theToClass <> \"Point\") then\n av.Run(\"aan.Sub-CalcSize\",{theToFTab})\nend\n\n'Set the select mode to Vertex, if necessary\nif(SelectionReset = TRUE) then\n theView.SetSelectMode (#GRAPHICS_SELECT_VERTEX)\nend\n\n\ntheView.Invalidate\nav.GetProject.SetModified(true)\nav.Sho wMsg(theFromClass+\" features copied from \"+theFromTheme.AsString+\" and pasted as \"\n+theToClass+\" features in \"+theToTheme.AsString+\".\")\n" ) (Script.371 Name: "aanSpace.Xtools4" ) (Script.372 Name: "aauView.BufferFeatures" SourceCode: "' Program: aauView.BufferFeatures\n' Purpose: ArcView3 Buffer Script (will not work with ArcView2)\n'\n' Headline: Buffers points, nodes, lines, or polygons using input distances from the\n' feature attribute table, a related (lookup) table, or interactively.\n'\n' Description: See the script's \"Shift\" click instructions\"\n'===========================================================\n \n' Check for the shift key, if the shift key is down, pop up instructions for using this script\n \nif (System.IsShift KeyDown) then\n message =\n \" \"+nl+\n \"Instructions For Buffer Selected Features:\"+nl+nl+\n \"Description: Buffers points, nodes, lines, or polygons using input distances from the\"+nl+\n \"feature attribute table, a related (lookup) table, or interactively.\"+nl++nl+\n \"OPTIONS: - MAP UNITS MUST BE SET!!! Can select from units list.\"+nl+\n \" Buffer Units - Same as map units or select from units list.\"+nl++nl+\n \" In-Theme - Select from theme list.\"+nl+\n \" Out-Theme - Enter output theme name.\"+nl++nl+\n \" Buffer Input:\"+nl+ \n \" - Buffer Field: Distance values taken from feature attribute table field (item).\"+nl+\n \" - Buffer Table: Distance values taken from related table field 'DIST' (related by buffer field).\"+nl+\n \" - Buffer Distance: Distance value entered interactively.\"+nl++nl+\n \" Line Buffer Options:\"+nl+\n \" - Line: Buffers lines.\"+nl+\n \" - Nodes: Buffers all nodes.\"+nl+\n \" - NodeF: Buffers FROM nodes.\"+nl+\n \" - NodeT: Buffers TO nodes.\"+nl++nl+\n \" Polygon Buffer Options\"+nl+\n \" - Inside/Outside: Buffers the outside (+value) or inside (-value) of a polygon.\"+nl+\n \" - Polygon+/Polygon-: Grows (+value) or shrinks (-value) input polygon.\"+nl+\n \" - Boundary: Buffers polygon boundary as a line.\"+nl++nl+\n \" Out Structure:\"+nl+\n \" - Noncontiguous: Output buffer polygons may overlap.\"+nl+\n \" - Contiguous: Output buffer polygons do not overlap. THIS\"+nl+\n \" IS VERY SLOW FOR LARGE DATA SETS!!!\"+nl+nl+\n \"Notes: The program will not work unless map units are set. If map units are not set\"+nl+\n \"(unknown) they can be selected from a selection list. Buffer units (different from \"+nl+\n \"map units) can be selected from a selection list. View projections are taken into \"+nl+\n \"account. The program buffers one theme at a time. The In-Theme (theme to buffer) \"+nl+\n \"is selected from a selection list. All or only selected features can be buffered.\"+nl+\n \"The default Out-Theme (output buffer polygons) is buff#.shp. Any output theme name\"+nl+\n \"can be entered. Buffer input can be from a field (item) in the In-Theme feature \"+nl+\n \"attribute table (field definition must be number or string, but value must be a \"+nl+\n \"number). Buffer input can be from a related table. The relate field (buffer field)\"+nl+\n \"must be setup and named the same in both tables, a nd the distance values must be\"+nl+\n \"contained in a field (item) called 'DIST' in the related table. Related tables\"+nl+\n \"may be dBase (.dbf), INFO, or delimited text. Buffer distances can be input\"+nl+\n \"interactively and all selected features will be buffered using this distance.\"+nl+\n \"Line buffer will buffer lines or nodes (node buffer distances are input from\"+nl+\n \"the line feature attribute table). ARC/INFO nodes (.NAT) can be buffered as\"+nl+\n \"points. All nodes, FROM nodes, or TO nodes can be buffered.\"+nl++nl+\n \"Polygon buffer will buffer the outside or inside of the polygon based on the\"+nl+\n \"sign of the buffer distance value (negative distances will buffer the inside of\"+nl+\n \"polygons). Polygons can be grown (Polygon+) or shrunk (Polygon-). The polygon\"+nl+\n \"boundary can be buffered as a line. All line (and polygon boundary), point, and\"+nl+\n \"node buffers are calculated as positive buffers.\"+nl++nl+\n \"Output structure may contain polygon overlap (Noncontiguous), or no poly gon\"+nl+\n \"overlap (Contiguous). Warning!: Use the Noncontiguous option only for making a theme\"+nl+\n \"to use for display, not for further analysis. Overlapping polygons will generate erroneous\"+nl+\n \"results if used in a subsequent clipping or intersecting operation.\"+nl++nl+\n \"Cancel will exit the program from any message box.\"+nl++nl+\n \" History: Script by Jim Peroutky - Initial coding 4/08/96. Streamlined and \"+nl+\n \"updated for projections 7/26/96. Added additional functionality 8/12/96, 10 /96\"+nl+nl+\n \"Script added to XTools in 1997. Changes by Mike DeLaune (mike.g.delaune@state.or.us)\"+nl+\n \"1997 - 5/6/2000.\"\n \n msgbox.report(message,\"Buffer Selected Features Instructions\")\n \n Clipboard.The.Empty\n Clipboard.The.Add(message)\n Clipboard.The.Update\n \n MsgBox.Info(\"These instructions were copied to the system clipboard. To print them, open a text editor\"++\n \"(like notepad), paste in the contents of the clipboard, and print them from the text editor.\",\"PRINT INSTRUCTIONS\")\n \n exit\nend\n\n\n\n' CHECK ARCVIEW VERSION\n\nif (av.GetVersion.AsTokens(\".\").Get(0).AsNumber < 3.0) then\n MsgBox.Error(\"Script will not work with ArcView 2, exiting ...\",\"ArcView2 - Error\")\n exit\nend\n\n' SET MSGBOX TITLES\n\nmu_T = \"Map Units\"\nbu_T = \"Buffer Units\"\n\nit_T = \"In Theme\"\not_T = \"Out Theme\"\n\nbi_T = \"Buffer Input\"\nbiiT = \"Buffer Field\"\nbitT = \"Buffer Table\"\nbidT = \"Buffer Distance\"\n\nlo_T = \"Line Buffer Options\"\npo_T = \"Polygon Buffer Options\"\n\nos_T = \"Output Structure\"\n\ner_T = \"Error\"\nwr_T = \"Warni ng\"\n\n' SET MSGBOX TEXT\n\nmu_X = \"Map units are Unknown.\"\nmu_X2 = \"Select map units:\"\nbu_X = \"Buffer units are: \"\nbu_X2 = \"To change, select new buffer units:\"\n\nit_X = \"Select input theme to buffer:\"\n\nbiSX = \"Select buffer input:\"\nbiiX = \"Select field containing distance values:\"\nbitX = \"Select field for table relate:\"\nbidX = \"Enter buffer distance in\"\n\nloSX = \"Select line buffer options:\"\npoSX = \"Select polygon buffer options:\"\n\nos_X = \"Select output structure:\"\n\n' SET MSGBOX SELECTION LISTS\n\nmu_S = {\"Deg rees\",\"Meters\",\"Feet\",\"Kilometers\",\"Miles\",\"NauticalMiles\",\"Millimeters\",\"Centimeters\",\"Inches\",\"Yards\"}\n\nbi_S = {\"Buffer Field\",\"Buffer Table\",\"Buffer Distance\"}\nbitpS = {\"*.dbf\",\"arcdr9\",\"*.txt\",\"*\"}\nbitlS = {\"dBASE\",\"INFO\",\"Delimited Text\",\"All Files\"}\n\nlo_S = {\"Line\",\"Nodes\",\"NodeF\",\"NodeT\"}\npo_S = {\"Outside/Inside\",\"Polygon+/Polygon-\",\"Boundary\"}\n\nos_S = {\"Noncontiguous\",\"Contiguous\"}\n\n' SET MSGBOX ERROR NOTES\n\nbitEX = \"Relate table field not found, exiting ...\"\nbitEX2 = \"'DIST' field not found, exiti ng ...\"\nbitEX3 = \"'DIST' field not NUM or STR, exiting ...\"\n\n' SET MSGBOX WARNING NOTES\n\not_WX = \"Output theme name not specified, re-enter.\"\n\nbiiWX = \"Buffer field not NUM or STR, re-enter.\"\nbidWX = \"Buffer distance not specified, re-enter.\"\n\n' SET PROGRAM PARAMETERS\n\ntheWDir = av.GetProject.GetWorkDir\ntheView = av.GetActiveDoc\n\ntheThemeList = theView.GetThemes\nthePrj = theView.GetProjection\n\n' SET PROGRAM DEFAULTS\n\nbUFrom = theView.GetUnits\nbUTo = \"#UNITS_LINEAR_DEGREES\".AsEnum\nbufUnits = Units.GetFull UnitString(bUFrom)\n\nlOption = \"Line\"\npOption = \"Nonpoly\"\n\nrepFlag = 0\n\n' SELECT MAP UNITS\n\nif (thePrj.AsString.IsNull) then\n if (bufUnits <> \"Degrees\") then\n if (bufUnits = \" \") then\n mUnit = MsgBox.ChoiceAsString(mu_S,mu_X+nl+mu_X2,mu_T)\n if (mUnit = NIL) then\n exit\n end\n theView.SetUnits((\"#UNITS_LINEAR_\"+mUnit.UCase).AsEnum)\n bUFrom = theView.GetUnits\n bufUnits = Units.GetFullUnitString(bUFrom)\n end\n bUTo = bUFrom\n end\nend\n\n' SELECT BUFFER UNITS\nx = 0 \nmu_S.Remove(mu_S.FindByValue(bufUnits))\nmu_S.Insert(bufUnits)\nbufUnits = MsgBox.ChoiceAsString(mu_S,bu_X+bufUnits+nl+bu_X2,bu_T)\nif (bufUnits = NIL) then\n exit\nend\nbUFrom = (\"#UNITS_LINEAR_\"+bufUnits.UCase).AsEnum\n\n' SELECT INPUT THEME\n\ninTheme = MsgBox.Choice(theThemeList,it_X,it_T)\nif (inTheme = NIL) then\n exit\nend\n\n' GET INPUT THEME PARAMETERS\n\ninName = inTheme.GetName\n\ninFTab = inTheme.GetFTab\ninFields = inFTab.GetFields\ninShapeField = inFTab.FindField(\"Shape\")\ninShapeT ype = inShapeField.GetType\n\n' SPECIFY OUTPUT THEME NAME\n\nfName = FileName.Make(theWDir.AsString).MakeTmp(\"buff\",\"shp\")\nwhile (repFlag = 0)\n outName = FileDialog.Put(fName,\"*.shp\",ot_T)\n if (outName = NIL) then\n exit\n elseif (outName.GetBaseName.AsTokens(\".\").Get(0).Contains(\" \")) then\n MsgBox.Warning(ot_WX,wr_T)\n else\n repFlag = 1\n end\nend\nrepFlag = 0\n\n' CREATE OUTPUT FTAB\n\noutFTab = FTab.MakeNew(outName,Polygon)\n\noutFields = List.Make\noutFields.Add(Field.Make(\"Buff_id\",#FIELD_LON G,8,0))\noutFields.Add(Field.Make(\"Buff_dist\",#FIELD_FLOAT,12,5))\n\noutFTab.AddFields(outFields)\noutShapeField = outFTab.FindField(\"Shape\")\noutIdField = outFTab.FindField(\"Buff_id\")\noutDistField = outFTab.FindField(\"Buff_dist\")\n\n\n' GET THE XTOOLS DEFAULTS\ntheDefScript = av.GetProject.FindScript( \"XTprojectDefaults\" )\nif(theDefScript <> nil) then\n DefList = theDefScript.AsString.AsList\nelse\n MsgBox.Error(\"Please set XTools Defaults\",\"XTOOLS DEFAULTS NOT SET\")\n return nil\nend\ntheAreaCalc = DefList.Get(6) \nt heArea = DefList.Get(4)\n\n' CALCULATE AREA, PERIMETER, ACRES, AND LENGTH FIELDS AS NECESSARY AND APPROPRIATE.\nif(theAreaCalc = \"Yes\") then\n theAreaField = Field.Make(\"Area\",#FIELD_DOUBLE,16,3)\n outFTab.AddFields({theAreaField})\n thePerimeterField = Field.Make(\"Perimeter\",#FIELD_DOUBLE,16,3)\n outFTab.AddFields({thePerimeterField})\n theAcresField = Field.Make(\"Acres\",#FIELD_DOUBLE,16,3)\n theHectaresField = Field.Make(\"Hectares\",#FIELD_DOUBLE,16,3)\n if(theArea = \"Acres\") then\n outFTab.AddFields({theA cresField})\n elseif(theArea = \"Hectares\") then\n outFTab.AddFields({theHectaresField})\n else\n outFTab.AddFields({theAcresField})\n outFTab.AddFields({theHectaresField})\n end \nend\n\n\n\n\n' SELECT BUFFER INPUT\n\nbufInput = MsgBox.ChoiceAsString(bi_S,biSX,bi_T++\"(\"+inName+\")\")\nif (bufInput = NIL) then\n outFTab.DeActivate 'added by Mike DeLaune 11/4/97\n outFTab = nil 'added by Mike DeLaune 11/4/97\n File.Delete(outName)\n File.Delete((outName.AsString.AsTokens(\".\").Get(0)+\".shx\").AsFileName)\n File.Delete((outName.AsString.AsTokens(\".\").Get(0)+\".dbf\").AsFileName)\n exit\nelseif (BufInput = \"Buffer Field\") then\n while (repFlag = 0)\n bf = MsgBox.ChoiceAsString(inFields,bu_X++bufUnits+nl+biiX,biiT++\"(\"+inName+\")\")\n if (bf = NIL) then\n outFTab.DeActivate 'added by Mike DeLaune 11/4/97\n outFTab = nil 'added by Mike DeLaune 11/4/97\n File.Delete(outName)\n File.Delete((outName.AsString.AsTokens(\".\").Get(0)+\".shx\").AsFileName)\n File.Delete((outName.AsS tring.AsTokens(\".\").Get(0)+\".dbf\").AsFileName)\n exit\n elseif ((bf.IsTypeNumber.Not) and (bf.IsTypeString.Not)) then\n MsgBox.Warning(biiWX,wr_T)\n else\n repFlag = 1\n end\n end\nelseif (bufInput = \"Buffer Table\") then\n bf = MsgBox.ChoiceAsString(inFields,bu_X++bufUnits+nl+bitX,bitT++\"(\"+inName+\")\")\n if (bf = NIL) then\n outFTab.DeActivate 'added by Mike DeLaune 11/4/97\n outFTab = nil 'added by Mike DeLaune 11/4/97\n File.Delete(outName)\n File.Delet e((outName.AsString.AsTokens(\".\").Get(0)+\".shx\").AsFileName)\n File.Delete((outName.AsString.AsTokens(\".\").Get(0)+\".dbf\").AsFileName)\n exit\n end\nelse\n while (repFlag = 0)\n bf = MsgBox.Input(bidX++bufUnits+\":\",bidT++\"(\"+inName+\")\",\"1.0\")\n if (bf = NIL) then\n outFTab.DeActivate 'added by Mike DeLaune 11/4/97\n outFTab = nil 'added by Mike DeLaune 11/4/97\n File.Delete(outName)\n File.Delete((outName.AsString.AsTokens(\".\").Get(0)+\".shx\").AsFileName)\n File.Delete((outName.AsString.AsTokens(\".\").Get(0)+\".dbf\").AsFileName)\n exit\n elseif (bf.AsString.Contains(\" \")) then\n MsgBox.Warning(bidWX,wr_T)\n else\n repFlag = 1\n end\n end\nend\nrepFlag = 0\n\nif ((bufInput = \"Buffer Field\") or (bufInput = \"Buffer Table\")) then\n bufField = inFTab.FindField(bf.AsString)\n if (bufInput = \"Buffer Table\") then\n bufTabList = FileDialog.ReturnFiles(bitpS,bitlS,bitT++\"(\"+inName+\")\",0)\n if (bufTabList.Count = 0) then\n o utFTab.DeActivate 'added by Mike DeLaune 11/4/97\n outFTab = nil 'added by Mike DeLaune 11/4/97\n File.Delete(outName)\n File.Delete((outName.AsString.AsTokens(\".\").Get(0)+\".shx\").AsFileName)\n File.Delete((outName.AsString.AsTokens(\".\").Get(0)+\".dbf\").AsFileName)\n exit\n end\n bufTab = VTab.Make(bufTabList.Get(0),FALSE,FALSE)\n joinField = bufTab.FindField(bf.AsString)\n if (joinField = NIL) then\n MsgBox.Error(bitEX,er_T)\n outFTab.DeActi vate 'added by Mike DeLaune 11/4/97\n outFTab = nil 'added by Mike DeLaune 11/4/97\n File.Delete(outName)\n File.Delete((outName.AsString.AsTokens(\".\").Get(0)+\".shx\").AsFileName)\n File.Delete((outName.AsString.AsTokens(\".\").Get(0)+\".dbf\").AsFileName)\n exit\n end\n inFTab.Join(bufField,bufTab,joinField)\n distField = inFTab.FindField(\"DIST\")\n if (distField = NIL) then\n MsgBox.Error(bitEX2,er_T)\n inFTab.UnjoinAll\n outFTab.DeActiva te 'added by Mike DeLaune 11/4/97\n outFTab = nil 'added by Mike DeLaune 11/4/97\n File.Delete(outName)\n File.Delete((outName.AsString.AsTokens(\".\").Get(0)+\".shx\").AsFileName)\n File.Delete((outName.AsString.AsTokens(\".\").Get(0)+\".dbf\").AsFileName)\n exit\n elseif ((distField.IsTypeNumber.Not) and (distField.IsTypeString.Not)) then\n MsgBox.Warning(bitEX3,er_T)\n inFTab.UnjoinAll\n outFTab.DeActivate 'added by Mike DeLaune 11/4/97\n outF Tab = nil 'added by Mike DeLaune 11/4/97\n File.Delete(outName)\n File.Delete((outName.AsString.AsTokens(\".\").Get(0)+\".shx\").AsFileName)\n File.Delete((outName.AsString.AsTokens(\".\").Get(0)+\".dbf\").AsFileName)\n exit\n end\n end\nend\n\n' SELECT BUFFER OPTIONS\n\nif (inShapeType.AsString = \"FIELD_SHAPELINE\") then\n lOption = MsgBox.ChoiceAsString(lo_S,loSX,lo_T++\"(\"+inName+\")\")\nelseif (inShapeType.AsString = \"FIELD_SHAPEPOLY\") then\n pOption = MsgBox.ChoiceAsString(po_S,poSX, po_T++\"(\"+inName+\")\")\nend\nif ((lOption = NIL) or (pOption = NIL)) then\n outFTab.DeActivate 'added by Mike DeLaune 11/4/97\n outFTab = nil 'added by Mike DeLaune 11/4/97\n File.Delete(outName)\n File.Delete((outName.AsString.AsTokens(\".\").Get(0)+\".shx\").AsFileName)\n File.Delete((outName.AsString.AsTokens(\".\").Get(0)+\".dbf\").AsFileName)\n exit\nend\n\n' SELECT OUTPUT THEME STRUCTURE\n\noutStructure = MsgBox.ChoiceAsString(os_S,os_X,os_T)\nif (outStructure = NIL) then\n outFTab.DeActivate 'added by Mike DeLaune 11/4/97\n outFTab = nil 'added by Mike DeLaune 11/4/97\n File.Delete(outName)\n File.Delete((outName.AsString.AsTokens(\".\").Get(0)+\".shx\").AsFileName)\n File.Delete((outName.AsString.AsTokens(\".\").Get(0)+\".dbf\").AsFileName)\n exit\nend\n\ntime1 = Date.Now.AsSeconds\n\n' GET SELECTED INPUT THEME RECORDS\n\ninNumRecs = inFTab.GetNumRecords\ninNumSel = inFTab.GetSelection.Count\nif (inNumSel = 0) then\n inFTab.GetSelection.SetAll\n inFTab.UpdateSelection\nelse\n inNumRecs = inNumSel\nend\n\n' SET BUFFER ROUTINE STATUS BAR\n\nav.ShowMsg(\"Buffering\"++inTheme.GetName+\"...\")\nav.ShowStopButton\nav.SetStatus(0)\n\n' START BUFFER ROUTINE\n\nfor each irec in inFTab.GetSelection\n\n' GET INPUT THEME FEATURE SHAPE\n\n if (pOption = \"Boundary\") then\n fShape = inFTab.ReturnValue(inShapeField,irec).AsPolyline\n elseif (lOption.Contains(\"Node\")) then\n pList = inFTab.ReturnValue(inShapeField,irec).AsMultiPoint.AsList\n if (lOption = \"Nodes\") then\n fShape = Point.Make(pList.Get(0).GetX,pList.Get(0).GetY)\n tShape = Point.Make(pList.Get(pList.Count - 1).GetX,pList.Get(pList.Count - 1).GetY)\n elseif (lOption = \"NodeF\") then\n fShape = Point.Make(pList.Get(0).GetX,pList.Get(0).GetY)\n else\n fShape = Point.Make(pList.Get(pList.Count - 1).GetX,pList.Get(pList.Count - 1).GetY)\n end\n else\n fShape = inFTab.ReturnValue(inShapeField,irec)\n end\n\n' CALCULATE BUFFER DISTANCE\n\n if (bufInput = \"Buffer Field\") then\n bufNum = inFTab.ReturnValue(bufField,irec)\n elseif (b ufInput = \"Buffer Table\") then\n bufNum = inFTab.ReturnValue(distField,irec)\n elseif (bufInput = \"Buffer Distance\") then\n bufNum = bf.AsNumber\n end\n\n if (bufNum.IsNull) then\n bufNum = 0\n end\n if (bufNum <> 0) then\n bufDist = Units.Convert(bufNum,bUFrom,bUTo)\n if ((bufNum < 0) and (bufDist > 0)) then\n bufDist = bufDist * -1\n end\n\n if ((pOption = \"Nonpoly\") or (pOption = \"Boundary\")) then\n bufNum = bufNum.Abs\n bufDist = bufDist.Abs\n end\n \n' CREATE BUFFER POLYGON\n\n xPoly = fShape.ReturnBuffered(bufDist)\n if (pOption = \"Outside/Inside\") then\n bufPoly = fShape.ReturnMerged(xPoly)\n if (xPoly.IsEmpty) then\n bufPoly = fShape\n end\n elseif (lOption = \"Nodes\") then\n bufPoly = xPoly\n tPoly = tShape.ReturnBuffered(BufDist)\n else\n bufPoly = xPoly\n end\n\n' CALCULATE BUFFER POLYGON AREA\n\n bufArea = Units.ConvertArea(bufPoly.ReturnArea,bUTo,buFrom)\n if (lOption = \"Nodes\") then\n tArea = Units.ConvertArea(tPoly.ReturnArea,bUTo,buFrom)\n end\n\n' CREATE BUFFER POLYGON ATTRIBUTE RECORD\n\n if (bufArea > 0.0) then\n orec = outFTab.AddRecord\n outFTab.SetValue(outShapeField,orec,bufPoly)\n outFTab.SetValueNumber(outIdField,orec,irec + 1)\n outFTab.SetValueNumber(outDistField,orec,bufNum)\n if (lOption = \"Nodes\") then\n orec = outFTab.AddRecord\n outFTab.SetValue(outShapeField,orec,tPoly)\n ou tFTab.SetValueNumber(outIdField,orec,irec + 1)\n outFTab.SetValueNumber(outDistField,orec,bufNum)\n end\n end\n end\n\n' DISPLAY BUFFER ROUTINE STATUS\n\n proceed = av.SetStatus((irec / inNumRecs) * 100)\n if (proceed.Not) then\n av.ClearStatus\n av.ShowMsg(\"Stopped\")\n outFTab.DeActivate 'added by Mike DeLaune 11/4/97\n outFTab = nil 'added by Mike DeLaune 11/4/97\n File.Delete(outName)\n File.Delete((outName.AsString.AsTokens(\".\").Get(0)+\".shx\").AsFileName)\n File.Delete((outName.AsString.AsTokens(\".\").Get(0)+\".dbf\").AsFileName)\n exit\n end\n\n' END BUFFER ROUTINE\n\nend\n\nav.SetStatus(100)\n\nif (inNumSel = 0) then\n inTheme.ClearSelection\nend\n\ninFTab.UnjoinAll\noutFtab.Flush\n\n' CREATE OUTPUT THEME\n\noutSrc = SrcName.Make(outName.AsString)\noutTheme = Theme.make(outSrc)\n\n' GET SYMBOL PARAMETERS\n\npfList = av.GetSymbolWin.GetPalette.GetList(#PALETTE_LIST_FILL)\naSym = pfList.Get(29).GetStipple.Clone\n\npcList = av.GetSymbolWin.GetPalette.GetList(#PALETTE_LIST_ COLOR)\nfgColor = pcList.Get(9).Clone\nbgColor = pcList.Get(0).Clone\n\n' CREATE OUTPUT THEME LEGEND\n\ntheSymbols = outTheme.GetLegend.GetSymbols\ntheSymbols.Get(0).SetStyle(#RASTERFILL_STYLE_OPAQUESTIPPLE)\ntheSymbols.Get(0).SetStipple(aSym)\ntheSymbols.Get(0).SetColor(fgColor)\ntheSymbols.Get(0).SetBGColor(bgColor)\n\n' ADD OUTPUT THEME TO VIEW\n\noutTheme.UpdateLegend\ntheView.AddTheme(outTheme)\n\n' MODIFY OUTPUT THEME\n\nif (outStructure = \"Contiguous\") then\n theView.SetEditableTheme(outTheme)\n outTheme.SelectByR ect(outTheme.ReturnExtent,#VTAB_SELTYPE_NEW)\n\n' SET MODIFY ROUTINE STATUS BAR\n av.ShowMsg(\"Modifying\"++outTheme.GetName+\"...\")\n\n' UNION SHAPES\n outTheme.UnionSelected\n outTheme.StopEditing(TRUE)\n theView.SetEditableTheme(nil)\n outTheme.ClearSelection\n outTheme.Invalidate(TRUE)\n\n' END MODIFY ROUTINE\nend\n\noutFTab = outTheme.GetFTab\noutFTab.SetEditable(TRUE)\n\n' START UPDATE ROUTINE\n\nif (outStructure = \"Contiguous\") then\n for each orec in outFTab\n\n' UPDATE OUTPUT THEME FTAB\n\n outIdField = ou tFTab.FindField(\"Buff_id\")\n outDistField = outFTab.FindField(\"Buff_dist\")\n\n outFTab.SetValue(outIdField,orec,orec)\n if (bufInput = \"Buffer Distance\") then\n outFTab.SetValue(outDistField,orec,bufNum)\n else\n outFTab.SetValue(outDistField,orec,-0)\n end\n\n' END UPDATE ROUTINE\n end\nend \n \n' GET THE XTOOLS DEFAULTS\ntheDefScript = av.GetProject.FindScript( \"XTprojectDefaults\" )\nif(theDefScript <> nil) then\n DefList = theDefScript.AsString.AsList\nelse\n MsgBox.Error(\"Please set XTool s Defaults\",\"XTOOLS DEFAULTS NOT SET\")\n return nil\nend\ntheAreaCalc = DefList.Get(6) \n\n' CALCULATE AREA, PERIMETER, ACRES, AND LENGTH FIELDS AS NECESSARY AND APPROPRIATE.\nif(theAreaCalc = \"Yes\") then\n outFTab = av.Run(\"aan.Sub-CalcSize\",{outFTab})\nend\n\noutFTab.SetEditable(FALSE)\n\ntime2 = Date.Now.AsSeconds\ntottime = time2 - time1\n\n' OUTPUT TO AN XTOOLS LOG FILE:\ntheType = outTheme.GetSRCName.GetSubName\ntheStr = \"BufferFeatures\"+\" \"+inTheme.GetSRCName.GetFileName.AsString+\" \"+outTheme.GetSRCName.GetFile Name.AsString+\" \"+\ntheType+\" \"+\"[\"+Date.Now.AsString+\"] [\"+inFTab.GetNumRecords.AsString+\" --> \"+outFTab.GetNumRecords.AsString++\n\"shapes] [\"+tottime.AsString++\"secs]\"\nav.Run(\"aan.Sub-LogFile\", theStr)\nav.ShowMsg(theStr)" ) (Script.373 Name: "aanView.ConvertMultiPart2SinglePart" SourceCode: "' Name: aanView.MultiPart2SinglePart\n' \n' Title: Convert MultiPart Shapes To Single Part\n'\n' Topics: GeoData\n'\n' Description: See the Shift click instructions below for a description of this script.\n'\n' Script by Mike DeLaune, (Email: mike.g.delaune@state.or.us), \n' Oregon Department of Forestry, 11/9/97. Last Revised 5/28/2001.\n'\n' Requires: a View must be the active document, there must be at least one feature theme in the View.\n'\n' Self: \n'\n' Returns:\n'============================================== =============\n \n' Check for the shift key, if the shift key is down, pop up instructions for using this script\n \nif (System.IsShiftKeyDown) then\n message =\n \" \"+nl+\n \"Instructions For Convert MultiPart Shapes To Single Part:\"+nl+nl+\n \"Multipart shapes can be found in polygon, polyline, and multipoint shapefiles. In addition \"+nl+\n \"to the XTools overlay tools, multipart shapes are created by the Edit, Union Features menu\"+nl+\n \"option in the standard ArcView user interface.\"+nl++nl+\n \"Many of the X Tools overlay tools create multipart polygons in the output shapefile. \"+nl+\n \"These multipart polygons result from overlay operations that result in breaking an input\"+nl+\n \"polygon into two or more parts due to intersections with overlay theme polygons. Examples \"+nl+\n \"of multipart polygons can be found in the ESRI sample data. The state of Alaska in the \"+nl+\n \"states.shp shapefile is one example. Alaska has only one record in its table, but it has \"+nl+\n \"32 parts including the mainland and 31 islands. Multipart polygons are not a problem for \"+nl+\n \"mapping and some analysis applications. They are not appropriate, however, if you need to \"+nl+\n \"know something about a specific individual part of a multipart - like it's size. For \"+nl+\n \"instance, as long as Alaska is a multipart, you would not be able to determine the size\"+nl+\n \"of one of the islands that are part of Alaska.\"+nl++nl+\n \"This script converts selected multipart shapes to single part shapes, and stores\"+nl+\n \"them in a ne w shapefile. If no shapes are currently selected, all shapes in the theme\"+nl+\n \"will be processed. Source shapes can be single part, multi-part or mixed in the theme.\"+nl+\n \"The output FTab will contain the same fields as the input FTab.\"+nl++nl+\n \"Script by Mike DeLaune, (Email: mike.g.delaune@state.or.us), \"+nl+\n \"Oregon Department of Forestry, 11/9/97. Revised 4/29/2000.\"+nl++nl+\n \"Requires that a View is the active document and that there is be at least one feature \"+nl+\n \"theme in the View.\"+NL +NL+\n \"Instructions:\"+nl+nl+\n \"1. Add at least one feature theme to the view.\"+nl+nl+\n \"2. Select the Convert MultiPart Shapes To Single Part menu option.\"+nl+nl+\n \"3. In the first dialog box, select the theme containing the shapes that you\"+nl+\n \"wish to convert from multipart to single part. \"+nl+nl+\n \"4. In the second dialog box you will be asked for a shapefile name for\"+nl+\n \"the new theme.\"+nl\n \n msgbox.report(message,\"Convert MultiPart Shapes To Single Part\")\n \n Clipboard.The.Empty\n Clipboard.The.Add(message)\n Clipboard.The.Update\n \n MsgBox.Info(\"These instructions were copied to the system clipboard. To print them, open a text editor\"++\n \"(like notepad), paste in the contents of the clipboard, and print them from the text editor.\",\"PRINT INSTRUCTIONS\")\n \n return nil\nend\n \n''''''''''''''''''''''''''''''''''''''''''''''''''''''''''\n' BEGIN INITIAL SETUP:\n'''''''''''''''''''''''''''''''''''''''''''''''''''''''''' \n \n' GET THE ACTIVE DOCUMENT, WHICH SHOULD BE A VIEW. BAIL IF NOT A VIEW:\ntheView=av.GetActiveDoc\nif (theView.Is(View).Not) then\n MsgBox.Error(\"This script must be run from a view. Exiting\",\"Error\")\n return nil\nend\n \n' BUILD A LIST OF FTHEMES FROM THE THEME LIST. THE USER WILL BE ASKED TO SELECT FROM THE LIST.\nLthms=List.Make\nfor each t in theView.GetThemes\n if (t.Is(Ftheme)) then\n shapetype = t.GetFtab.FindField(\"Shape\").GetType\n if ((shapetype = #FIELD_SHAPEPOINT).NOT) then\n Lthms.Add(t)\n end\n end \nend\n \n' IF < 1 THEMES ARE IN THE VIEW, BAIL O UT.\nif (Lthms.Count < 1) then\n System.Beep\n MsgBox.Error(\"There must be at least one feature theme in the View to proceed! Exiting.\",\"Error\")\n exit\nend\n \n \n' END OF THE INITIAL SETUP\n \n''''''''''''''''''''''''''''''''''''''''''''''''''''''''''\n' ASK FOR USER INPUT:\n'''''''''''''''''''''''''''''''''''''''''''''''''''''''''' \n \n' ASK THE USER WHICH THEME CONTAINS THE MULTIPART SHAPES THAT YOU WISH TO CONVERT TO SINGLE PART:\ntheInputTheme = MsgBox.Choice(Lthms,\n\"Select the theme that cont ains the multipart shapes that you wish to convert to single part:\",\n \"MultiPart 2 Single Part! SELECT INPUT THEME\")\nif(theInputTheme = nil) then exit end\n\n' GET SOME INFO ABOUT THE INPUT THEME.\ntheInputFTab = theInputTheme.GetFtab\ntheInputShapeField = theInputFTab.FindField(\"shape\")\ntheInputShapeFieldType = theInputFTab.FindField(\"shape\").GetType\ntheInputSelRecsOld = theInputFTab.GetSelection.Clone\nif(theInputSelRecsOld.Count = 0) then 'NEW\n theInputFTab.GetSelection.SetAll 'NEW\nend 'NEW\n \n' SET THE APPROPRIATE QUERY TO DETERMINE IF THERE ARE MULTIPART SHAPES IN THE FTAB. RETURN IF SHAPE TYPE IS POINT.\nif (theInputShapeFieldType = #FIELD_SHAPELINE) then \n theQueryStr = \"[Shape].CountParts > 1\"\n theNullShape = Polyline.MakeNull\nelseif (theInputShapeFieldType = #FIELD_SHAPEMULTIPOINT) then\n theQueryStr = \"[Shape].Count > 1\"\n theNullShape = MultiPoint.MakeNull\nelseif (theInputShapeFieldType = #FIELD_SHAPEPOINT) then\n Return nil\nelseif (theInputShapeFieldType = #FIELD_SHAPEPOLY) then\n theQueryStr = \"[Shape].Explode.Count > 1\"\n theNullShape = Polygon.MakeNull\nend\n\n'theInputFTab.Query(theQueryStr, theInputFTab.GetSelection, #VTAB_SELTYPE_NEW)\ntheInputFTab.Query(theQueryStr, theInputFTab.GetSelection, #VTAB_SELTYPE_AND) 'NEW\ntheMultiRecs = theInputFTab.GetSelection.Clone\ntheCount = theInputFTab.GetSelection.Count\ntheInputFTab.SetSelection(theInputSelRecsOld)\ntheInputFTab.UpdateSelection\n \n' IF NO RECORDS CONTAIN MULTIPART SHAPES, RETURN.\nif (theCount = 0) then\n MsgBox.Info(theInputTheme.GetName ++ \"ha s no multipart shapes. Bailing!\", \"MULTIPART TO SINGLE PART\")\n exit\nend \n\n' ASK THE USER FOR A FILENAME AND LOCATION FOR THE NEW SHAPEFILE. EXIT IF USER CANCELS.\ntheWorkDir = av.GetProject.GetWorkDir\ntheWorkDir.SetCWD\ndefname = theWorkDir.MakeTMP(\"Convrt\", \"shp\")\noutputfile = FileDialog.Put(defname,\"*.shp\",\"NAME NEW THEME\")\nif (outputfile = nil) then exit end\n\ntime1 = Date.Now.AsSeconds\n \n' END OF USER INPUT.\n \n'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''\n' BEGIN THE CONVERSION PROC ESS\n'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''\n\n' CREATE A TEMPORARY FTAB WITH ALL FIELDS VISIBLE AND ALIASES SET TO FIELD NAMES. THIS ENSURES THAT ALL FIELDS ARE EXPORTED AND THAT\n' THE FIELD NAMES WILL NOT BE CHANGED TO ALIAS NAMES. \ntheTempFTab = theInputFTab.Clone\n\ntheTempFields = theTempFTab.GetFields\nfor each fld in theTempFields\n if(fld.GetName <> \"Shape\") then\n fld.SetVisible(TRUE)\n fld.SetAlias(fld.GetName)\n end\nend\n\n' CREATE THE NEW FTAB AND RESET VISIBILITY AND FI ELD ALIASES.\nnewFTab = theTempFTab.Export(outputfile, Shape, FALSE)\n\ntheTempFTab.Deactivate\ntheTempFTab = nil\ntheNewFields = newFTab.GetFields\nfor each fld in theNewFields\n if(fld.GetName <> \"Shape\") then\n fld2 = theInputFTab.FindField(fld.GetName)\n fld.SetAlias(fld2.GetAlias)\n fld.SetVisible(fld2.IsVisible)\n end\nend \nnewFTab.SetSelection(theMultiRecs)\nnewFTab.UpdateSelection\n\ntheInputRecs = theInputFTab.GetNumRecords.AsString\ntheInputFTab.Deactivate\ntheInputFTab = nil\nav.PurgeObjects\n\n' RUN THE MULTIPART TO SINGLE PART SUBROUTINE.\nnewFTab.SetEditable(TRUE) \nnewFTab = av.Run(\"aan.Sub-Multi2Single\", newFTab)\n\n'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''\n' BEGIN THE POST-EDITING CLEANUP AND CALCULATIONS. \n'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''\n' GET THE XTOOLS DEFAULTS\ntheDefScript = av.GetProject.FindScript( \"XTprojectDefaults\" )\nif(theDefScript <> nil) then\n DefList = theDefScript.AsString.AsList\nelse\n MsgBox.Error(\"Please set XTools Defaults\",\"XTOOL S DEFAULTS NOT SET\")\n return nil\nend\ntheAreaCalc = DefList.Get(6) \n\n' CALCULATE AREA, PERIMETER, ACRES, AND LENGTH FIELDS AS NECESSARY AND APPROPRIATE.\nif(theAreaCalc = \"Yes\") then\n newFTab = av.Run(\"aan.Sub-CalcSize\",{newFTab})\nend \n\n' END OF EDITING THE NEW FTAB\nnewFTab.SetEditable(FALSE)\n\n' CREATE THE NEW THEME AND ADD IT TO THE VIEW\ntheOutputTheme = FTheme.Make(newFTab)\ntheView.AddTheme(theOutputTheme)\n\n' INDEX THE THEME.\nnewFTab.CreateIndex(newFTab.FindField(\"Shape\"))\n\n' BRING THE VIEW TO THE FRON T AND CLEAN UP.\ntheView.InvalidateTOC(nil)\ntheView.GetWin.Activate\n\ntime2 = Date.Now.AsSeconds\ntottime = time2 - time1\n\n' OUTPUT TO AN XTOOLS LOG FILE:\ntheType = theOutputTheme.GetSRCName.GetSubName\ntheStr = \"MultiPart2SinglePart\"+\" \"+theInputTheme.GetSRCName.GetFileName.AsString+\" \"+theOutputTheme.GetSRCName.GetFileName.AsString+\" \"+\ntheType+\" \"+\"[\"+Date.Now.AsString+\"] [\"+theInputRecs+\" --> \"+newFTab.GetNumRecords.AsString++\n\"shapes] [\"+tottime.AsString++\"secs]\"\nav.Run(\"aan.Sub-LogFile\", theStr) \nav.ShowMsg(theStr)" ) (Script.374 Name: "aanView.Polygon2Polyline" SourceCode: "' Name: aanView.Polygon2Polyline\n' \n' Title: Convert Polygons To Polylines\n'\n' Topics: GeoData\n'\n' Description: See the \"Shift click\" instructions below for a script description.\n'\n' Requires: a View must be the active document, there must be at least one polygon theme in the View.\n'\n' Self: \n'\n' Returns:\n'===========================================================\n\n' Check for the shift key, if the shift key is down, pop up instructions for using this script\n\nif (System.IsShiftKeyDown) then\n message =\n \" \"+nl+\n \"Instructions For Convert Polygons To Polylines:\"+nl+nl+\n \"This script converts selected polygons to single part polylines, and stores\"+nl+\n \"them in a new shapefile. If no polygons are currently selected, all polygons\"+nl+\n \"in the theme will be processed. Source polygons can be single part, multi-part\"+nl+\n \"or mixed in the theme. The output polyline FTab will contain the same fields \"+nl+\n \"as the input polygons, except that a length field will be added.\"+NL+NL+\n \"Script by Mike DeL aune, (Email: mike.g.delaune@state.or.us),\"+nl+\n 'Oregon Department of Forestry, 10/30/97.\"+NL+NL+\n \"Instructions:\"+nl+nl+\n \"1. Add at least one polygon theme to the view.\"+nl+nl+\n \"2. Select the Convert Polygon to Polyline menu option.\"+nl+nl+\n \"3. In the first dialog box, select the theme containing the polygons that you\"+nl+\n \"wish to convert to polylines. \"+nl+nl+\n \"4. In the second dialog box you will be asked for a shapefile name for\"+nl+\n \"the new theme.\"+nl\n \n msgbox.report(message, \"Convert Polygon to Polyline Instructions\")\n \n Clipboard.The.Empty\n Clipboard.The.Add(message)\n Clipboard.The.Update\n \n MsgBox.Info(\"These instructions were copied to the system clipboard. To print them, open a text editor\"++\n \"(like notepad), paste in the contents of the clipboard, and print them from the text editor.\",\"PRINT INSTRUCTIONS\")\n \n return nil\nend\n\n''''''''''''''''''''''''''''''''''''''''''''''''''''''''''\n' BEGIN INITIAL SETUP:\n'''''''''''''''''''''''''''''''''''''''''''''''''''''' '''' \n\n' GET THE ACTIVE DOCUMENT, WHICH SHOULD BE A VIEW. BAIL IF NOT A VIEW:\ntheView=av.GetActiveDoc\nif (theView.Is(View).Not) then\n MsgBox.Error(\"This script must be run from a view. Exiting\",\"Error\")\n return nil\nend\n\n' BUILD A LIST OF POLYGON FTHEMES FROM THE THEME LIST. THE USER WILL BE ASKED TO SELECT FROM THE LIST.\nLthms=List.Make\nfor each t in theView.GetThemes\n if(t.Is(Ftheme)) then\n shapetype = t.GetFtab.FindField(\"Shape\").GetType\n if (shapetype = #FIELD_SHAPEPOLY) then\n Lthms.Add (t)\n end\n end \nend\n\n' IF < 1 THEMES ARE POLYGON FTHEMES, BAIL OUT.\nif (Lthms.Count < 1) then\n System.Beep\n MsgBox.Error(\"There must be at least one polygon feature theme in the View to proceed! Exiting.\",\"Error\")\n exit\nend\n\n \n' END OF THE INITIAL SETUP\n\n''''''''''''''''''''''''''''''''''''''''''''''''''''''''''\n' ASK FOR USER INPUT:\n'''''''''''''''''''''''''''''''''''''''''''''''''''''''''' \n\n' ASK THE USER WHICH THEME CONTAINS THE POLYGONS TO CONVERT TO POLYLINES:\ntheInputTheme = MsgBox.Choice(Lthms,\"Select the theme that contains the polygons that you wish to convert to polylines:\",\n \"Polygon 2 Polyline! SELECT INPUT THEME\")\nif(theInputTheme = nil) then exit end\n\n' ASK THE USER FOR A FILENAME AND LOCATION FOR THE NEW SHAPEFILE. EXIT IF USER CANCELS.\ntheWorkDir = av.GetProject.GetWorkDir\ntheWorkDir.SetCWD\ndefname = theWorkDir.MakeTMP(\"Pline\", \"shp\")\noutputfile = FileDialog.Put(defname,\"*.shp\",\"NAME NEW THEME\")\nif (outputfile = nil) then exit end\n\n' END OF USER INPUT.\n\n'''''''' '''''''''''''''''''''''''''''''''''''''''''''''''''''''\n' BEGIN THE CONVERSION PROCESS\n'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''\ntime1 = Date.Now.AsSeconds\n\n' GET INFO ABOUT THE FTABS\nnewFTab = FTab.MakeNew(outputfile,POLYLINE)\nnewFTab.AddFields({Field.Make(\"ID\", #FIELD_LONG, 8, 0)})\ntheInputFTab = theInputTheme.GetFTab\ntheOldtheInputSelRecs = theInputFTab.GetSelection.Clone\n \n' SET THE SELECTION. USE SELECTED SHAPES IF THERE ARE ANY, OTHERWISE ITERATE THROUGH THE ENTIRE FTAB...\nif (theInputFTab.GetSelection.Count > 0) then\n theInputSelRecs = theInputFTab.GetSelection\n nRecs = theInputSelRecs.Count\nelse\n theInputSelRecs = theInputFTab.GetSelection\n theInputSelRecs.SetAll\n nRecs = theInputFTab.GetNumRecords\nend\n\n' MAKE THE INPUT THEME FTAB AND A LIST THAT WILL BE USED TO SELECT FIELDS FOR THE OUTPUT\ntheInputFTab = theInputTheme.GetFtab\n\n \n' MAKE A LIST OF INPUT THEME FIELDS, EXCLUDING THE SHAPE FIELD.\ntheInputfields = List.Make\nfor each f in theInputFTab.GetFields\n if ((f.GetN ame = \"Shape\") or (f.GetName = \"id\"))then\n continue\n else \n fCopy = f.Clone\n theInputFields.Add(fCopy)\n end\nend\n\nif (((theInputFields = nil).Not) and (theInputFields.Count > 0)) then\n newFTab.AddFields(theInputFields)\nend\n\ntheInputShapeField = theInputFTab.FindField(\"shape\")\ntheNewShapeField = newFTab.FindField(\"shape\")\ntheNewIdField = newFTab.FindField(\"id\")\n\n\ncurrentrec = 0 \nav.ShowStopButton\ntotalrec = theInputSelRecs.Count\nav.ShowMsg(\"Converting \"+nRecs.AsString+\" Polygons to Polyli nes....\")\nplnum = 0\n\n\n' MAKE A LIST OF VERTICES FROM THE POLYGON\nfor each rec in theInputSelRecs\n\n ' SHOW PROGRESS ROUTINE:\n currentrec = currentrec + 1\n progress = (currentrec / totalrec) * 100\n proceed = av.SetStatus( progress )\n if (proceed.Not) then\n av.ShowMsg( \"Stopped\" )\n exit\n end \n \n theInputShape = theInputFTab.ReturnValue(theInputShapeField,rec)\n theInputShape.Clean\n \n ' BAIL OUT IF THE POLYGON IS NULL (LIKE THE UNIVERSAL POLYGON IN AN ARCINFO POLYGON COVERAGE.)\n if(theInput Shape.IsNull = true) then\n continue\n end \n \n polylist = theInputShape.Explode\n \n for each poly in polylist\n plnum = plnum + 1\n ' MAKE THE POLYLINE AND CLEAN IT.\n thePolyline = poly.AsPolyline\n thePolyline.Clean\n \n ' ADD THE POLYLINE TO THE NEW FTAB\n theoutrec = newFtab.AddRecord\n newFtab.SetValue(theNewShapeField,theoutrec,thePolyline)\n newFtab.SetValue(theNewIdField,theoutrec,theoutrec)\n\n ' ADD THE ATTRIBUTE DATA FROM THE INPUT THEME:\n if (((theInputFields = nil) .Not) and (theInputFields.Count > 0)) then\n for each afield in theInputFields\n oldfield = theInputFTab.FindField(afield.GetAlias)\n oldvalue = theInputFTab.ReturnValue(oldfield,rec)\n newFtab.SetValue(afield,theoutrec,oldvalue)\n end\n end\n\n end \n \n \nend ' END OF FOR EACH REC IN THEINPUTSELRECS\n\n\n' END OF EDITING THE NEW FTAB\nnewFTab.seteditable(false)\n\n\n' END OF THE POLYLINE TO POLYGON PROCESS\n\n'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''\n' BEGIN THE POST-EDITING CLEANUP AND CALCULATIONS. \n'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''\nav.purgeobjects\n\nnewFTab.GetSelection.Clearall\ntheInputFTab.SetSelection(theOldtheInputSelRecs)\ntheInputFTab.UpdateSelection\n\n' GET THE XTOOLS DEFAULTS\ntheDefScript = av.GetProject.FindScript( \"XTprojectDefaults\" )\nif(theDefScript <> nil) then\n DefList = theDefScript.AsString.AsList\nelse\n MsgBox.Error(\"Please set XTools Defaults\",\"XTOOLS DEFAULTS NOT SET\")\n return nil\nend\ntheAreaCalc = DefLi st.Get(6)\n\n' CALCULATE AREA, PERIMETER, ACRES, AND LENGTH FIELDS AS NECESSARY AND APPROPRIATE.\nif(theAreaCalc = \"Yes\") then\n av.Run(\"aan.Sub-CalcSize\",{newFTab})\nend \n\n' CREATE THE NEW THEME AND ADD IT TO THE VIEW\ntheOutputTheme = FTheme.Make(newFTab)\ntheView.AddTheme(theOutputTheme)\n\n' INDEX THE THEME, IF NECESSARY.\nif (newFTab.IsFieldIndexed(theNewShapeField) = False) then\n newFTab.CreateIndex(theNewShapeField)\nend\n\n' BRING THE VIEW TO THE FRONT AND CLEAN UP.\ntheView.InvalidateTOC(nil)\ntheView.GetWin. Activate\n\ntime2 = Date.Now.AsSeconds\ntottime = time2 - time1\n\n' OUTPUT TO AN XTOOLS LOG FILE:\ntheType = theOutputTheme.GetSRCName.GetSubName\ntheStr = \"Polygon2Polyline\"+\" \"+theInputTheme.GetSRCName.GetFileName.AsString+\" \"+theOutputTheme.GetSRCName.GetFileName.AsString+\" \"+\ntheType+\" \"+\"[\"+Date.Now.AsString+\"] [\"+theInputFTab.GetNumRecords.AsString+\" --> \"+newFTab.GetNumRecords.AsString++\n\"shapes] [\"+tottime.AsString++\"secs]\"\nav.Run(\"aan.Sub-LogFile\", theStr)\nav.ShowMsg(theStr)" ) (Script.375 Name: "aanView.Polylines2Polygon" SourceCode: "' Name: aanView.Polylines2Polygon\n' \n' Title: Make One Polygon From Polylines\n'\n' Topics: GeoData\n'\n' Description: See the \"Shift click\" instructions below for a script description.\n'\n' Requires: a View must be the active document, there must be at least one polyline theme in the View.\n'\n' Self: \n'\n' Returns:\n'===========================================================\n\n' Check for the shift key, if the shift key is down, pop up instructions for using this script\n\nif (System.IsShiftKeyDown) then\n mes sage =\n \" \"+nl+\n \"This script converts selected polylines in a theme to one single part polygon, \"+nl+\n \"and stores it in a new shapefile. If no polylines are currently selected,\"+nl+\n \"all polylines in the theme will be processed. The polylines do not need\"+nl+ \n \"to be snapped together. Gaps between polylines will be bridged with a \"+nl+\n \"straight line. Source polylines can be single part, multi-part or mixed \"+nl+\n \"in the theme. Neither the order of the polylines in the FTab, nor the \"+nl+\n \"order in which the polylines are selected is important.\"+NL+NL+\n \"If polylines from more than one theme will be used to build the polygon, the \"+nl+\n \"user will need to assemble the necessary polylines in a separate theme before \"+nl+\n \"running this script. A common example of this situation is the necessity to \"+nl+\n \"build a polygon from lines borrowed from PLS, Roads, Streams ... themes. If \"+nl+\n \"there are gaps between the source polylines that should not be bridged with a \"+nl+\n \"straight li ne, the user should digitize in polylines to fill the gaps prior to \"+nl+\n \"running the script. This script differs from the ArcInfo Build command (polygon\"+nl+\n \"option) in that only one polygon can be built in a single operation.\"+NL+NL+\n \"XTools checks the input theme for intersections, places where lines cross \"+nl+\n \"without a break at the crossing point. XTools will break the lines at the \"+nl+\n \"crossing points, but this results in ''dangles'', pieces of line (usually short) \"+nl+\n \"that will create a problem in the output polygon if not eliminated. If \"+nl+\n \"intersections are detected, XTools will create a new polyline theme with the \"+nl+\n \"lines broken at crossing points and with the crossing points marked with a red \"+nl+\n \"graphic. The user needs to manually delete the dangles related to the line \"+nl+\n \"crossings and then re-run the script on the new polyline theme.\"+nl++nl+\n \"Script by Mike DeLaune, (Email: mike.g.delaune@state.or.us), \"+nl+\n \"Oregon Department of Forestry, 10/1 7/97. Revised 5/17/2000.\"+NL+NL+\n\n \"Brief Instructions:\"+nl+nl+\n \"1. Add at least one polyline theme to the view.\"+nl+nl+\n \"2. Select polylines in a single theme or collect the necessary polylines in a \"+nl+\n \"new theme using feature cut and paste or other techniques.\"+nl++nl+\n \"3. Select the Make One Polygon From Polylines menu option.\"+nl+nl+\n \"4. In the first dialog box, select the theme containing the polylines that you\"+nl+\n \"wish to use to build a polygon. \"+nl+nl+\n \"5. In the second dialog b ox you will be asked for a shapefile name for\"+nl+\n \"the new theme.\"+nl\n \n msgbox.report(message,\"Make One Polygon From Polylines Instructions\")\n \n Clipboard.The.Empty\n Clipboard.The.Add(message)\n Clipboard.The.Update\n \n MsgBox.Info(\"These instructions were copied to the system clipboard. To print them, open a text editor\"++\n \"(like notepad), paste in the contents of the clipboard, and print them from the text editor.\",\"PRINT INSTRUCTIONS\")\n \n return nil\nend\n\n'''''''''''''''''''''''''' ''''''''''''''''''''''''''''''''\n' BEGIN INITIAL SETUP:\n'''''''''''''''''''''''''''''''''''''''''''''''''''''''''' \n\n' GET THE ACTIVE DOCUMENT, WHICH SHOULD BE A VIEW. BAIL IF NOT A VIEW:\ntheView=av.GetActiveDoc\nif (theView.Is(View).Not) then\n MsgBox.Error(\"This script must be run from a view. Exiting\",\"Error\")\n return nil\nend\n\n' BUILD A LIST OF POLYLINE FTHEMES FROM THE THEME LIST. THE USER WILL BE ASKED TO SELECT FROM THE LIST.\nLthms=List.Make\nfor each t in theView.GetThemes\n if (t.Is(Ftheme)) the n\n shapetype = t.GetFtab.FindField(\"Shape\").GetType\n if (shapetype = #FIELD_SHAPELINE) then\n Lthms.Add(t)\n end\n end \nend\n\n' IF < 1 THEMES ARE POLYLINE FTHEMES, BAIL OUT.\nif (Lthms.Count < 1) then\n System.Beep\n MsgBox.Error(\"There must be at least one polyline feature theme in the View to proceed! Exiting.\",\"Error\")\n exit\nend\n\n \n' END OF THE INITIAL SETUP\n\n''''''''''''''''''''''''''''''''''''''''''''''''''''''''''\n' ASK FOR USER INPUT:\n''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''' \n\n' ASK THE USER WHICH THEME CONTAINS THE POLYLINES TO CONVERT TO A POLYGON:\nthePLTheme = MsgBox.Choice(Lthms,\"Select the theme that contains the polylines that you wish to make into one polygon:\",\n \"Make One Polygon From Polylines! SELECT INPUT THEME\")\nif(thePLTheme = nil) then exit end\n\n' ASK THE USER FOR A FILENAME AND LOCATION FOR THE NEW SHAPEFILE. EXIT IF USER CANCELS.\ntheWorkDir = av.GetProject.GetWorkDir\ntheWorkDir.SetCWD\ndefname = theWorkDir.MakeTMP(\"bldshp\", \"shp\")\nout putfile = FileDialog.Put(defname,\"*.shp\",\"NAME NEW THEME\")\nif (outputfile = nil) then exit end\n\n' END OF USER INPUT.\n\n'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''\n' BEGIN THE CONVERSION PROCESS\n'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''\ntime1 = Date.Now.AsSeconds\n\n\nthePLTab = thePLTheme.GetFTab\noldSelRecs = thePLTab.GetSelection.Clone\n \n' SET THE SELECTION. USE SELECTED SHAPES IF THERE ARE ANY, OTHERWISE ITERATE THROUGH THE ENTIRE FTAB...\nif (thePLTab.GetSelection .Count > 0) then\n SelRecs = thePLTab.GetSelection\n nRecs = SelRecs.Count\nelse\n SelRecs = thePLTab.GetSelection\n SelRecs.SetAll\n nRecs = thePLTab.GetNumRecords\nend\n\n\nShapeIn = thePLTab.FindField(\"shape\")\nplList = List.Make ' THIS LIST WILL CONTAIN THE INDIVIDUAL POLYLINE SEGMENTS.\nfptList = List.Make ' THIS LIST WILL CONTAIN THE FIRST VERTEX IN EACH LINE SEGMENT.\nlptList = List.Make ' THIS LIST WILL CONTAIN THE LAST VERTEX IN EACH LINE SEGMENT.\npgList = List.Make ' THIS LIST WILL CONTAIN THE ALL THE VERTICES IN THE POLYGON.\n\n\n' MAKE A MULTIPART FROM THE POLYLINE SEGMENTS. THIS IS USED TO ELIMINATE OVERLAPPING LINE SEGMENTS.\nmrg = 0\nfor each r in SelRecs \n shpIn = thePLTab.ReturnValue(ShapeIn,r)\n if(shpin.IsNull = true) then continue end \n shpin.Clean\n if(mrg = 0) then\n multishape = shpin\n mrg = 1\n else\n multishape = multishape.ReturnUnion(shpin)\n end \nend\n\n' NOW BREAK THE MULTIPART INTO A LIST.\nshpList1 = multishape.Connect.Explode\n\n' BREAK DOWN ALL OF THE POLYLINES\nshpList2 = L ist.Make\nfor each shp1 in shpList1\n tmpList = shp1.AsMultiPoint.AsList\n pt1 = 0\n for each i in 1..(tmpList.Count-1)\n pl = Polyline.Make({{tmpList.Get(i-1), tmpList.Get(i)}})\n shpList2.Add(pl)\n end\nend \n\n'NOW INTERSECT THE POLYLINES WITH THE MULTIPART AND MAKE A LIST OF THE RESULTS.\n'shpList3 = List.Make\n'For each shp2 in shpList2\n' intList = shp2.Split(multishape)\n' shpchk = intList.Get(0).Clone\n' for each shp3 in intList\n' if(shp3.ReturnLength > shpchk.ReturnLength) then\n' shpchk = shp3.Clone\n' end \n' end \n' shpList3.Add(shpchk)\n'end \n\n'NOW INTERSECT THE POLYLINES WITH THE MULTIPART AND MAKE A LIST OF THE RESULTS.\nshpList3 = List.Make\nintcnt = 0\nintptList = List.Make\nfor each shp2 in shpList2\n intList = shp2.Split(multishape)\n if(INtList.Count > 1) then\n pl1List = intList.Get(0).AsList.Get(0)\n pl2List = intList.Get(1).AsList.Get(0)\n for each pt1 in pl1List\n for each pt2 in pl2List\n if (pt1 = pt2) then\n intptList.Add(pt1)\n continue\n end\n end\n end \n intcnt = intcnt + 1\n end\n for each shp3 in intList\n shpList3.Add(shp3.Clone)\n end \nend\n\nintcnt = intcnt / 2\n\nif(intcnt > 0) then \n newFTab = FTab.MakeNew(outputfile, POLYLINE )\n newFTab.AddFields({Field.Make(\"ID\", #FIELD_LONG, 8, 0)})\n ShapeOut = newFTab.FindField(\"shape\")\n IDOut = newFTab.FindField(\"id\")\n\n theStr = \"The input polyline theme has \"+intcnt.AsString+\" intersection(s). An Intersection is a location where two lines cross. \"+\n \"Intersections are usual ly a problem for polygon construction. They indicate that there will be dangling lines after XTools breaks \"+\n \"the lines at their crossing points. This problem must be fixed before a correct polygon can be created.\"+nl+nl+\n \"XTools will create a new polyline shapefile named \"+outputfile.GetBaseName.AsString+\" that has all lines intersected \"+\n \"(broken at crossing points). The intersection location(s) will be marked with red marker(s). Please edit the new theme, \"+\n \"delete any lines that you do no t want in the final polygon, and then run the program again on the new shapefile.\" \n MsgBox.Report(theStr,\"\")\n newFTab.StartEditingWithRecovery\n for each shp in shpList3\n theoutrec = newFTab.AddRecord\n newFTab.SetValue(ShapeOut,theoutrec,shp.Clone)\n end\n newFTab.StopEditingWithRecovery(TRUE)\n theOutputTheme = FTheme.Make(newFTab)\n theView.AddTheme(theOutputTheme)\n theOutputTheme.SetVisible(TRUE)\n theOutputTheme.SetActive(TRUE)\n theView.SetEditableTheme(theOutputTheme)\n theView.Invalidate\n av.ProcessAllInvals\n \n theGraphics = theView.GetGraphics\n for each shp in intptList\n theSymbol = Symbol.Make(#SYMBOL_MARKER)\n theSymbol.SetSize(30)\n av.GetSymbolWin.SetPanel(#SYMBOLWIN_PANEL_MARKER)\n theSymbol.SetColor(Color.GetRed)\n aGraphic = GraphicShape.Make(shp)\n aGraphic.SetSymbol(theSymbol)\n theGraphics.AddBatch(aGraphic)\n end\n theGraphics.EndBatch\n theGraphics.Invalidate\n exit \nelse\n newFTab = FTab.MakeNew(outputfile, POLYGON )\n newFTab.AddFields({Field.Make(\"ID\", #FI ELD_LONG, 8, 0)})\n ShapeOut = newFTab.FindField(\"shape\")\n IDOut = newFTab.FindField(\"id\") \nend\n\nshpList5 = List.Make \nshpList4 = shpList3.DeepClone\nfor each shp3 in shpList3\n tmpList = shp3.AsMultipoint.AsList\n pt1 = tmpList.Get(0)\n pt2 = tmpList.Get(1)\n pt1int = 0\n pt2int = 0\n for each pl in shpList4\n if(pl.Intersects(pt1)) then\n pt1int = pt1int + 1\n end\n end \n for each pl in shpList4\n if(pl.Intersects(pt2)) then\n pt2int = pt2int + 1\n end\n end \n if(((pt1int = 1) and (pt2int = 4)) or ((pt1int = 4) and (pt2int = 1))) then\n continue \n end\n shpList5.Add(shp3.Clone) \nend \nx = 0 \n\n' PROCESS THE LIST OF POLYLINE SEGMENTS AND MAKE A LIST OF FIRST VERTICES AND A LIST OF LAST VERTICES.\nfor each shpin in shpList5 \n tmpList = shpin.AsMultiPoint.AsList\n plList.Add(shpin)\n fptList.Add(tmpList.Get(0))\n lptList.Add(tmpList.Get(tmpList.Count - 1))\nend\n\n' SORT THE POLYLINE SEGMENTS AND VERTICES INTO THE PROPER ORDER:\ncurrentrec = 0 \nav.ShowStopButton\nlastPl = plList. Count\ntotalrec = lastPl\n\n' PROCESS THE LIST OF POLYLINES\nfor each pl in plList\n \n ' SHOW PROGRESS ROUTINE:\n currentrec = currentrec + 1\n progress = (currentrec / totalrec) * 100\n proceed = av.SetStatus( progress )\n if (proceed.Not) then\n av.ShowMsg( \"Stopped\" )\n exit\n end\n\n index = plList.Find(pl)\n if(index = 0) then\n continue\n end\n \n lastpoint = lptList.Get(index - 1)\n mindist = 100000000\n \n ' PROCESS THE LIST OF \"FROM\" VERTICES (THE FIRST VERTEX IN THE POINT LIST FOR EACH POLYL INE).\n ' FIGURE OUT IF ONE OF THESE IS THE CLOSEST TO THE LAST VERTEX OF THE PREVIOUS LINE SEGMENT (LASTPOINT).\n for each pt in fptlist\n ifpt = fptlist.Find(pt)\n if(ifpt < index) then\n continue\n end\n \n dist = pt.Distance(lastpoint)\n if(dist < mindist) then\n mindist = dist\n minindex = ifpt\n minlist = \"First\"\n end\n \n end ' END OF FOR EACH PT IN FPTLIST\n \n ' PROCESS THE LIST OF \"TO\" VERTICES (THE LAST VERTEX IN THE POINT LIST FOR EACH POLYLINE).\n ' FIGURE OUT IF ONE OF THESE IS THE CLOSEST TO THE LAST VERTEX OF THE PREVIOUS LINE SEGMENT (LASTPOINT).\n for each pt in lptlist\n ilpt = lptlist.Find(pt)\n if(ilpt < index) then\n continue\n end\n \n dist = pt.Distance(lastpoint)\n if(dist < mindist) then\n mindist = dist\n minindex = ilpt\n minlist = \"Last\"\n end\n \n end ' END OF FOR EACH PT IN FPTLIST\n \n' IF THE CLOSEST VERTEX IS A \"TO\" (OR LAST) VERTEX, FLIP THE POLYLINE AND SWITCH THE VERTICES \n' IN THE FIRST AND LAST LIST S.\n if(minlist = \"Last\") then\n tmppl = pllist.Get(minindex)\n tmppl.Flip\n pllist.Set(minindex,tmppl)\n tmpptf = fptlist.Get(minindex)\n tmpptl = lptlist.Get(minindex)\n fptlist.Set(minindex,tmpptl)\n lptlist.Set(minindex,tmpptf)\n end\n \n' MOVE THE POLYLINE AND VERTICES TO THE APPROPRIATE POSITION IN THEIR LISTS.\n plList.Shuffle((pllist.Get(minindex)),index)\n fptList.Shuffle((fptlist.Get(minindex)),index)\n LptList.Shuffle((lptlist.Get(minindex)),index)\n \nend ' END OF FOR EACH PL IN PLLIST\n\n' BREAK THE POLYLINES DOWN AND MAKE A SINGLE LIST OF POINTS TO BUILD THE POLYGON\nfor each pl in plList\n tmpList = pl.AsMultiPoint.AsList\n for each pt in tmpList\n pgList.Add(pt)\n end\nend \n\n' MAKE THE POLYGON AND CLEAN IT.\nthePolygon = Polygon.Make({pgList})\nthePolygon.Clean\n \n' ADD THE POLYGON TO THE NEW FTAB\ntheoutrec = newFtab.AddRecord\nnewFtab.SetValue(ShapeOut,theoutrec,thePolygon)\nnewFtab.SetValue(IDOut,theoutrec,theoutrec)\n \n\n' END OF EDITING THE NEW FTAB\nnewFTab.seteditabl e(false)\n\n\n' END OF THE MAKE ONE POLYGON FROM POLYLINES PROCESS\n\n'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''\n' BEGIN THE POST-EDITING CLEANUP AND CALCULATIONS. \n'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''\nav.purgeobjects\n\nnewFTab.GetSelection.Clearall\nthePLTab.setselection(oldSelRecs)\nthePLTab.updateselection\n\n' GET THE XTOOLS DEFAULTS\ntheDefScript = av.GetProject.FindScript( \"XTprojectDefaults\" )\nif(theDefScript <> nil) then\n DefList = theDefScript.AsString.AsLis t\nelse\n MsgBox.Error(\"Please set XTools Defaults\",\"XTOOLS DEFAULTS NOT SET\")\n return nil\nend\ntheAreaCalc = DefList.Get(6)\n\n' CALCULATE AREA, PERIMETER, ACRES, AND LENGTH FIELDS AS NECESSARY AND APPROPRIATE.\nif(theAreaCalc = \"Yes\") then\n av.Run(\"aan.Sub-CalcSize\",{newFTab})\nend\n\n' CREATE THE NEW THEME AND ADD IT TO THE VIEW\ntheOutputTheme = FTheme.Make(newFTab)\ntheView.AddTheme(theOutputTheme)\n\n' INDEX THE THEME, IF NECESSARY.\nif (newFTab.IsFieldIndexed(ShapeOut) = False) then\n newFTab.CreateIndex(Shape Out)\nend\n\n' BRING THE VIEW TO THE FRONT AND CLEAN UP.\ntheView.InvalidateTOC(nil)\ntheView.GetWin.Activate\n\ntime2 = Date.Now.AsSeconds\ntottime = time2 - time1\n\n' OUTPUT TO AN XTOOLS LOG FILE:\ntheType = theOutputTheme.GetSRCName.GetSubName\ntheStr = \"Polylines2Polygon\"+\" \"+thePLTheme.GetSRCName.GetFileName.AsString+\" \"+theOutputTheme.GetSRCName.GetFileName.AsString+\" \"+\ntheType+\" \"+\"[\"+Date.Now.AsString+\"] [\"+thePLTab.GetNumRecords.AsString+\" --> \"+newFTab.GetNumRecords.AsString++\n\"shapes] [\"+tottime. AsString++\"secs]\"\nav.Run(\"aan.Sub-LogFile\", theStr)\nav.ShowMsg(theStr)" ) (Script.376 Name: "aanView.Points2Polygon" SourceCode: "' Name: aanView.Points2Polygon\n'\n' Title: Make One Polygon From Points\n'\n' Topics: Analysis, Themes\n'\n' Description: See the \"Shift click\" instructions below for a script description.\n'\n' Requires: At least one point Ftheme in a View. \n' Two additional scripts must be available: aanView.Sub-SetUp and aan.Sub-CalcSize\n'\n' Self: Not Applicable\n'\n' Returns: Not Applicable\n'\n'===========================================================\n \n' Check for the shift key, if the shift key is down, pop up instructions for using this script\n \nif (System.IsShiftKeyDown) then\n message =\n \" \"+nl+\n \"Instructions For Make One Polygon From Points:\"+nl+nl+\n \"This script converts a point theme to one single part polygon, and stores it in a \"+nl+ \n \"new shapefile. The points in the input shapefile should be in exactly the same \"+nl+\n \"order as you want the vertices in the resulting polygon. The points should define \"+nl+\n \"the polygon boundary in a clock-wise direction. The output polygon FTab will contain \"+ nl+\n \"the following fields: ID, Area, Perimeter, and Acres. The value in the Acres field \"+nl+\n \"is meaningful only if the map units are in feet.\"+NL+NL+\n \"This script differs from the ArcInfo Build command (polygon option) in that only one \"+nl+\n \"polygon can be built in a single operation. Also, no intersecting or cleaning is done, \"+nl+\n \"so the user must do the equivalent preparatory work (if necessary) in advance of using \"+nl+\n \"the script in order to get the desired results.\"+NL+NL+\n \"Scrip t by Mike DeLaune, (Email: mike.g.delaune@state.or.us), \"+nl+\n \"Oregon Department of Forestry, 1/15/99.\"+NL+NL+\n\n \"Brief Instructions:\"+nl+nl+\n \"1. Add at least one point theme to the view.\"+nl+nl+\n \"2. If none of the points are selected, the script will use all of the points\"+nl+\n \" in the theme to build the polygon. If you wish to use only some of the \"+nl+\n \" points to build the polygon, then select the points that you wish to use.\"+nl++nl+\n \"3. Select the Make One Polygon From Points menu op tion.\"+nl+nl+\n \"4. In the first dialog box, select the theme containing the points that you\"+nl+\n \"wish to use to build a polygon. \"+nl+nl+\n \"5. In the second dialog box you will be asked for a shapefile name for\"+nl+\n \"the new polygon theme.\"+nl\n \n msgbox.report(message,\"Make One Polygon From Points Instructions\")\n \n Clipboard.The.Empty\n Clipboard.The.Add(message)\n Clipboard.The.Update\n \n MsgBox.Info(\"These instructions were copied to the system clipboard. To print them, open a text e ditor\"++\n \"(like notepad), paste in the contents of the clipboard, and print them from the text editor.\",\"PRINT INSTRUCTIONS\")\n \n return nil\nend\n \n''''''''''''''''''''''''''''''''''''''\n' Initial set up and error checks:\n''''''''''''''''''''''''''''''''''''''\n' Get the active document, which should be a view. Bail if not a view:\ntheView=av.GetActiveDoc\nif (theView.Is(View).Not) then\n MsgBox.Error(\"This script must be run from a view. Exiting\",\"Error\")\n return nil\nend\n\n' Build a list of point ftheme s from the theme list. The user will be asked to select from the list.\nPthms=List.Make\nfor each t in theView.GetThemes\n if (t.Is(Ftheme)) then\n shapetype = t.GetFtab.FindField(\"Shape\").GetType\n if (shapetype = #FIELD_SHAPEPOINT) then\n Pthms.Add(t)\n end\n end \nend\n\n' If < 1 themes are Point fthemes, bail out.\nif (Pthms.Count < 1) then\n System.Beep\n MsgBox.Error(\"There must be at least one point feature theme in the View to proceed! Exiting.\",\"Error\")\n exit\nend\n\n \n \n' END OF THE INITIAL SETUP\n \n''''''''''''''''''''''''''''''''''''''''''''''''''''''''''\n' Ask for User input:\n'''''''''''''''''''''''''''''''''''''''''''''''''''''''''' \n \n' Ask the user which theme to convert to polygon:\ntheInputTheme = MsgBox.Choice(Pthms,\"Select the Point theme that contains features that you wish to convert To Polygon:\",\n \"Make One Polygon From Points! SELECT INPUT THEME\")\nif(theInputTheme = nil) then exit end\n\n \n' Ask the user for a filename and location for the new shapefile. E xit if user cancels.\ntheWorkDir = av.GetProject.GetWorkDir\ntheWorkDir.SetCWD\ndefname = theWorkDir.MakeTMP(\"Pt2Pl\", \"shp\")\noutputfile = FileDialog.Put(defname,\"*.shp\",\"NAME NEW THEME\")\nif (outputfile = nil) then exit end\n \n' END OF USER INPUT.\n \n'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''\n' Begin the conversion process\n'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''\ntime1 = Date.Now.AsSeconds\n \n' Get the ftabs\ntheInputFTab = theInputTheme.GetFtab\ntheInputShapeField = th eInputFTab.FindField(\"shape\")\ntheInputIDField = theInputFTab.FindField(\"id\")\nif ((theInputIDField = nil).Not) then\n theInputIDField.SetVisible(true)\nend\n\n' CHECK TO SEE HOW MANY RECORDS ARE SELECTED. BAIL IF ONLY ONE.\nif(theInputFTab.GetNumSelRecords = 1) then\n MsgBox.Warning(\"Only one record is selected in the input theme. Selected additional points and try again!\",\"\")\n exit\nend\n\n\n' Create a shapefile on disk for the new Ftab.\nnewFtab = FTab.MakeNew(outputfile,Polygon)\nIdField = Field.Make(\"ID\",#FIE LD_LONG, 5, 0)\nnewFTab.AddFields({IdField})\n\n' Get info about the new FTab\ntheNewShapeField = newFtab.FindField(\"shape\")\nnewFTab.SetEditable(False)\nnewFTab.SetEditable(True)\nnewFTab.StartEditingWithRecovery \n\n' Determine which records from theInputFTab are selected, or select all if none selected.\ntheInputSelRecs = theInputFTab.GetSelection\ntheOldSelRecs = theInputFTab.GetSelection.Clone\nif (theInputSelRecs.count=0) then\n theInputSelRecs.SetAll\nend\n\nptList = List.make\n\nfor each rec in theInputFTab.GetSel ection\n theInputShape = theInputFTab.ReturnValue(theInputShapeField,rec)\n ptList.Add(theInputShape)\nend\n\npshape = Polygon.Make({ptList})\n\n' Make a new record & set the value of the shapefield\nthenewRec = newFTab.AddRecord\nnewFtab.SetValue(theNewShapeField,thenewRec,pshape)\n\n \n' END OF THE POLYGON CONSTRUCTION PROCESS\n \n'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''\n' Begin the post-editing calculations and cleanup. \n'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''\n'Set e diting OFF and clear selection.\nnewFTab.seteditable(false)\nnewFTab.GetSelection.Clearall\ntheInputFTab.SetSelection(theOldSelRecs)\ntheInputFTab.UpdateSelection\n\n' GET THE XTOOLS DEFAULTS\ntheDefScript = av.GetProject.FindScript( \"XTprojectDefaults\" )\nif(theDefScript <> nil) then\n DefList = theDefScript.AsString.AsList\nelse\n MsgBox.Error(\"Please set XTools Defaults\",\"XTOOLS DEFAULTS NOT SET\")\n return nil\nend\ntheAreaCalc = DefList.Get(6) \n\n' CALCULATE AREA, PERIMETER, ACRES, AND LENGTH FIELDS AS NECESSARY A ND APPROPRIATE.\nif(theAreaCalc = \"Yes\") then\n av.Run(\"aan.Sub-CalcSize\",{newFTab})\nend \n\n' CREATE THE NEW THEME AND ADD IT TO THE VIEW\ntheOutputTheme = FTheme.Make(newFTab)\ntheView.AddTheme(theOutputTheme)\n\n' INDEX THE THEME, IF NECESSARY.\nif (newFTab.IsFieldIndexed(theNewShapeField) = False) then\n newFTab.CreateIndex(theNewShapeField)\nend\n\n' BRING THE VIEW TO THE FRONT AND CLEAN UP.\ntheView.InvalidateTOC(nil)\ntheView.GetWin.Activate\n\ntime2 = Date.Now.AsSeconds\ntottime = time2 - time1\n\n' OUTPUT TO AN XT OOLS LOG FILE:\ntheType = theOutputTheme.GetSRCName.GetSubName\ntheStr = \"Points2Polygon\"+\" \"+theInputTheme.GetSRCName.GetFileName.AsString+\" \"+theOutputTheme.GetSRCName.GetFileName.AsString+\" \"+\ntheType+\" \"+\"[\"+Date.Now.AsString+\"] [\"+theInputFTab.GetNumRecords.AsString+\" --> \"+newFTab.GetNumRecords.AsString++\n\"shapes] [\"+tottime.AsString++\"secs]\"\nav.Run(\"aan.Sub-LogFile\", theStr)\nav.ShowMsg(theStr)" ) (Script.377 Name: "aanView.Points2PolyLine" SourceCode: "' Name: aanView.Points2PolyLine\n'\n' Title: Make One PolyLine From Points\n'\n' Topics: Themes\n'\n' Description: See the \"Shift click\" instructions below for a script description.\n'\n' Requires: At least one point Ftheme in a View. \n' Two additional scripts must be available: aanView.Sub-SetUp and aan.Sub-CalcSize\n'\n' Self: Not Applicable\n'\n' Returns: Not Applicable\n'\n'===========================================================\n \n' Check for the shift key, if the shift key is down, pop up instruct ions for using this script\n \nif (System.IsShiftKeyDown) then\n message =\n \" \"+nl+\n \"Instructions For Make One Polyline From Points:\"+nl+nl+\n \"This script converts a point theme to one polyline, and stores it in a \"+nl+ \n \"new shapefile. The points in the input shapefile should be in exactly the same \"+nl+\n \"order as you want the vertices in the resulting polyline.\"+nl+\n \"The output polyline FTab will contain \"+nl+\n \"the following fields: ID, and Length.\"+NL+NL+\n \"This script differs from the ArcIn fo Build command (arc option) in that only one \"+nl+\n \"line can be built in a single operation. Also, no intersecting or cleaning is done, \"+nl+\n \"so the user must do the equivalent preparatory work (if necessary) in advance of using \"+nl+\n \"the script in order to get the desired results.\"+NL+NL+\n \"Script by Mike Schuft, (Email: mike.schuft@state.or.us), \"+nl+\n \"Oregon Department of Forestry, 6/2/99.\"+NL+NL+\n\n \"Brief Instructions:\"+nl+nl+\n \"1. Add at least one point theme to the view.\"+nl+nl+\n \"2. If none of the points are selected, the script will use all of the points\"+nl+\n \" in the theme to build the polyline. If you wish to use only some of the \"+nl+\n \" points to build the polyline, then select the points that you wish to use.\"+nl++nl+\n \"3. Select the Make One Polyline From Points menu option.\"+nl+nl+\n \"4. In the first dialog box, select the theme containing the points that you\"+nl+\n \"wish to use to build a polyline. \"+nl+nl+\n \"5. In the second dialog box you will be asked for a shapef ile name for\"+nl+\n \"the new polyline theme.\"+nl\n \n msgbox.report(message,\"Make One Polyline From Points Instructions\")\n \n Clipboard.The.Empty\n Clipboard.The.Add(message)\n Clipboard.The.Update\n \n MsgBox.Info(\"These instructions were copied to the system clipboard. To print them, open a text editor\"++\n \"(like notepad), paste in the contents of the clipboard, and print them from the text editor.\",\"PRINT INSTRUCTIONS\")\n \n return nil\nend\n \n''''''''''''''''''''''''''''''''''''''\n' INITIAL S ET UP AND ERROR CHECKS:\n''''''''''''''''''''''''''''''''''''''\n' GET THE ACTIVE DOCUMENT, WHICH SHOULD BE A VIEW. BAIL IF NOT A VIEW:\ntheView=av.GetActiveDoc\nif (theView.Is(View).Not) then\n MsgBox.Error(\"This script must be run from a view. Exiting\",\"Error\")\n return nil\nend\n\n' BUILD A LIST OF POINT FTHEMES FROM THE THEME LIST. THE USER WILL BE ASKED TO SELECT FROM THE LIST.\nPthms=List.Make\nfor each t in theView.GetThemes\n if (t.Is(Ftheme)) then\n shapetype = t.GetFtab.FindField(\"Shape\").GetType\n if (shapetype = #FIELD_SHAPEPOINT) then\n Pthms.Add(t)\n end\n end \nend\n\n' IF < 1 THEMES ARE POINT FTHEMES, BAIL OUT.\nif (Pthms.Count < 1) then\n System.Beep\n MsgBox.Error(\"There must be at least one point feature theme in the View to proceed! Exiting.\",\"Error\")\n exit\nend\n\n \n \n' END OF THE INITIAL SETUP\n \n''''''''''''''''''''''''''''''''''''''''''''''''''''''''''\n' ASK FOR USER INPUT:\n'''''''''''''''''''''''''''''''''''''''''''''''''''''''''' \n \n' ASK THE USER WHICH THEME TO CONVERT TO POLYLINE:\ntheInputTheme = MsgBox.Choice(Pthms,\"Select the Point theme that contains features that you wish to convert To Polygon:\",\n \"Make One Polyline From Points! SELECT INPUT THEME\")\nif(theInputTheme = nil) then exit end\n\n \n' ASK THE USER FOR A FILENAME AND LOCATION FOR THE NEW SHAPEFILE. EXIT IF USER CANCELS.\ntheWorkDir = av.GetProject.GetWorkDir\ntheWorkDir.SetCWD\ndefname = theWorkDir.MakeTMP(\"Pt2Plin\", \"shp\")\noutputfile = FileDialog.Put(defname,\"*.shp\",\"NAME NEW THEME\")\nif (outputfil e = nil) then exit end\n \n' END OF USER INPUT.\n \n'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''\n' BEGIN THE CONVERSION PROCESS\n'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''\ntime1 = Date.Now.AsSeconds\n \n' GET THE FTABS\ntheInputFTab = theInputTheme.GetFtab\ntheInputShapeField = theInputFTab.FindField(\"shape\")\ntheInputIDField = theInputFTab.FindField(\"id\")\nif ((theInputIDField = nil).Not) then\n theInputIDField.SetVisible(true)\nend\n\n' CHECK TO SEE HOW MANY RECORDS ARE SELEC TED. BAIL IF ONLY ONE.\nif(theInputFTab.GetNumSelRecords = 1) then\n MsgBox.Warning(\"Only one record is selected in the input theme. Selected additional points and try again!\",\"\")\n exit\nend\n\n' CREATE A SHAPEFILE ON DISK FOR THE NEW FTAB.\nnewFtab = FTab.MakeNew(outputfile,Polyline)\nIdField = Field.Make(\"ID\",#FIELD_LONG, 5, 0)\nnewFTab.AddFields({IdField})\n\n' GET INFO ABOUT THE NEW FTAB\ntheNewShapeField = newFtab.FindField(\"shape\")\nnewFTab.SetEditable(False)\nnewFTab.SetEditable(True)\nnewFTab.StartEditingWi thRecovery \n\n' DETERMINE WHICH RECORDS FROM THEINPUTFTAB ARE SELECTED, OR SELECT ALL IF NONE SELECTED.\ntheInputSelRecs = theInputFTab.GetSelection\ntheOldSelRecs = theInputFTab.GetSelection.Clone\nif (theInputSelRecs.count=0) then\n theInputSelRecs.SetAll\nend\n\nptList = List.make\n\nfor each rec in theInputFTab.GetSelection\n theInputShape = theInputFTab.ReturnValue(theInputShapeField,rec)\n ptList.Add(theInputShape)\nend\n\npshape = Polyline.Make({ptList})\n\n' MAKE A NEW RECORD & SET THE VALUE OF THE SHAPEFIELD\nt henewRec = newFTab.AddRecord\nnewFtab.SetValue(theNewShapeField,thenewRec,pshape)\n\n \n' END OF THE POLYGON CONSTRUCTION PROCESS\n \n'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''\n' BEGIN THE POST-EDITING CALCULATIONS AND CLEANUP. \n'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''\n'SET EDITING OFF AND CLEAR SELECTION.\nnewFTab.seteditable(false)\nnewFTab.GetSelection.Clearall\ntheInputFTab.SetSelection(theOldSelRecs)\ntheInputFTab.UpdateSelection\n\n' GET THE XTOOLS DEFAULTS\ntheDefScr ipt = av.GetProject.FindScript( \"XTprojectDefaults\" )\nif(theDefScript <> nil) then\n DefList = theDefScript.AsString.AsList\nelse\n MsgBox.Error(\"Please set XTools Defaults\",\"XTOOLS DEFAULTS NOT SET\")\n return nil\nend\ntheAreaCalc = DefList.Get(6) \n\n' CALCULATE AREA, PERIMETER, ACRES, AND LENGTH FIELDS AS NECESSARY AND APPROPRIATE.\nif(theAreaCalc = \"Yes\") then\n av.Run(\"aan.Sub-CalcSize\",{newFTab})\nend \n\n' CREATE THE NEW THEME AND ADD IT TO THE VIEW\ntheOutputTheme = FTheme.Make(newFTab)\ntheView.AddTheme(the OutputTheme)\n\n' INDEX THE THEME, IF NECESSARY.\nif (newFTab.IsFieldIndexed(theNewShapeField) = False) then\n newFTab.CreateIndex(theNewShapeField)\nend\n\n' BRING THE VIEW TO THE FRONT AND CLEAN UP.\ntheView.InvalidateTOC(nil)\ntheView.GetWin.Activate\n\ntime2 = Date.Now.AsSeconds\ntottime = time2 - time1\n\n' OUTPUT TO AN XTOOLS LOG FILE:\ntheType = theOutputTheme.GetSRCName.GetSubName\ntheStr = \"Points2Polyline\"+\" \"+theInputTheme.GetSRCName.GetFileName.AsString+\" \"+theOutputTheme.GetSRCName.GetFileName.AsString+\" \"+\ntheType+\" \"+\"[\"+Date.Now.AsString+\"] [\"+theInputFTab.GetNumRecords.AsString+\" --> \"+newFTab.GetNumRecords.AsString++\n\"shapes] [\"+tottime.AsString++\"secs]\"\nav.Run(\"aan.Sub-LogFile\", theStr)\nav.ShowMsg(theStr)" ) (Script.378 Name: "aanView.ShapeToGraphic" SourceCode: "' Name: aanView.ShapeToGraphic\n'\n' Title: Shape to Graphic Convertor\n'\n' Topics: Graphics, Symbols, Views\n'\n' Description: See the \"Shift click\" instructions below for a script description. \n'\n' Requires: At least one Ftheme in a View\n'\n' Self: Not Applicable\n'\n' Returns: Not Applicable\n'\n'===========================================================\n \n' Check for the shift key, if the shift key is down, pop up instructions for using this script\n \nif (System.IsShiftKeyDown) then\n message =\n \" \"+nl+\n \"In structions For Convert Shape to Graphic:\"+nl+nl+\n \"This script creates one graphic for each selected record of the user-selected theme.\"+nl+ \n \"If no selection is made, then graphics will be made for all features in the theme. With no \"+nl+\n \"input from the user, the script will draw the graphic with the default symbol for the \"+nl+\n \"shape type, default size and a default color of green. The defaults other than color are:\"+nl++nl+\n \"Marker Defaults (point and multipoint shapes): Size 10 pts, Shape Circle.\"+nl+\n \"Fill Defaults (polygon shapes): Outline on, Outline Size .1 pts.\"+nl+\n \"Line Defaults (polyline shapes): Size .1 pts, Single Solid Line.\"+nl++nl+\n \"The user may override these defaults by opening the symbol window prior to starting the script,\"+nl+\n \"and selecting the desired symbol, size, and color. After the graphics are made it is extremely\"+nl+\n \"slow to select and change a large number of ungrouped graphics. The best way to change the\"+nl+\n \"graphic symbol properties is to group the graphics and then make the change.\"+nl++nl+\n \"Script modified from ESRI sample script by Mike DeLaune, (Email: mike.g.delaune@state.or.us),\"+nl+\n \"Oregon Department of Forestry, 10/30/97.\"+nl++nl+\n \"Requires: At least one Ftheme in a View\"+nl+nl+\n \"Instructions:\"+nl+nl+\n \"1. Add at least one feature theme to the view.\"+nl+nl+\n \"2. If you wish to change the symbols from the defaults, open\"+nl+\n \"the symbol window and select the desired symbols.\"+nl+nl+\n \"3. Select the Convert Shape to Graphic m enu option.\"+nl+nl+\n \"4. In the dialog box, select the theme containing the \"+nl+\n \"features that you want to make into graphics. \"+nl\n \n msgbox.report(message,\"Convert Shape to Graphic Instructions\")\n \n Clipboard.The.Empty\n Clipboard.The.Add(message)\n Clipboard.The.Update\n \n MsgBox.Info(\"These instructions were copied to the system clipboard. To print them, open a text editor\"++\n \"(like notepad), paste in the contents of the clipboard, and print them from the text editor.\",\"PRINT INSTR UCTIONS\")\n \n exit\nend\n \n''''''''''''''''''''''''''''''''''''''\n' INITIAL SET UP AND ERROR CHECKS:\n''''''''''''''''''''''''''''''''''''''\n\n' GET THE ACTIVE DOCUMENT, WHICH SHOULD BE A VIEW. BAIL IF NOT A VIEW:\ntheView=av.GetActiveDoc\ntheProjection = theView.GetProjection\n\nif (theView.Is(View).Not) then\n MsgBox.Error(\"This script must be run from a view. Exiting\",\"Error\")\n exit\nend\n\ntheGraphics = theView.GetGraphics\n\n \n' BUILD A LIST OF FTHEMES FROM THE THEME LIST. THE USER WILL BE ASKED TO SELECT FROM THE LIST.\nthms=List.Make\nfor each t in theView.GetThemes\n if (t.Is(Ftheme)) then\n thms.Add(t)\n end\nend\n \n' IF < 1 THEMES ARE FTHEMES, BAIL OUT.\nif (thms.Count < 1) then\n System.Beep\n MsgBox.Error(\"There must be at least one feature themes in the View to proceed! Exiting.\",\"Error\")\n exit\nend\n\n\n' END OF THE INITIAL SETUP\n \n''''''''''''''''''''''''''''''''''''''''''''''''''''''''''\n' Ask for User input:\n'''''''''''''''''''''''''''''''''''''''''''''''''''''''''' \n \n' ASK THE USER WHICH THEME TO USE AS INPUT:\ntheInputTheme = MsgBox.Choice(thms,\"Select the theme that contains features that you wish \"+\n\"to convert to graphics:\",\n \"Convert to Graphic! SELECT INPUT THEME\")\nif(theInputTheme = nil) then exit end\n\ntime1 = Date.Now.AsSeconds\n\ntheFtab = theInputTheme.GetFTab\nTheSelRecs = theFTab.GetSelection\nTheOldSelRecs = theFTab.GetSelection.Clone\n\nif (theSelRecs.Count = 0) then\n theFtab.GetSelection.SetAll\n theFtab.UpdateSelection\n TheSelRecs = theFTab.GetSelection\nend\n \ntheShapeField = theFtab .FindField(\"Shape\")\ntheShapeFieldType = theShapefield.GetType\n\nav.GetSymbolWin\n' DETERMINE THE SHAPE CLASS OF THE INPUT THEME, MAKE THE APPROPRIATE SYMBOL AND SET THE DEFAULTS:\nif (theShapeFieldType = #FIELD_SHAPELINE) then \n theSymbol = Symbol.Make(#SYMBOL_PEN)\n theSymbol.SetSize(\".1\".AsNumber)\n av.GetSymbolWin.SetPanel(#SYMBOLWIN_PANEL_PEN)\n\nelseif (theShapeFieldType = #FIELD_SHAPEMULTIPOINT) then\n theSymbol = Symbol.Make(#SYMBOL_MARKER)\n theSymbol.SetSize(10)\n av.GetSymbolWin.SetPanel(#SYMBOLWIN_P ANEL_MARKER)\nelseif (theShapeFieldType = #FIELD_SHAPEPOINT) then\n theSymbol = Symbol.Make(#SYMBOL_MARKER)\n theSymbol.SetSize(10)\n av.GetSymbolWin.SetPanel(#SYMBOLWIN_PANEL_MARKER)\nelseif (theShapeFieldType = #FIELD_SHAPEPOLY) then\n theSymbol = Symbol.Make(#SYMBOL_FILL)\n theSymbol.SetOLWidth(\".1\".AsNumber)\n av.GetSymbolWin.SetPanel(#SYMBOLWIN_PANEL_FILL)\nend\ntheSymbol.SetColor(Color.GetGreen)\n\nif (av.GetSymbolWin.IsOpen = true) then\n theSymbol = av.GetSymbolWin.ReturnCurrentSymbol(theSymbol.GetType)\ne nd\n\ncurrentrec = 0 \ntotalrec = theSelRecs.Count\nav.ShowStopButton\nav.ShowMsg(\"Converting \"+totalrec.AsString+\" shapes to graphics....\")\n \nfor each x in theSelRecs\n \n ' SHOW PROGRESS ROUTINE:\n currentrec = currentrec + 1\n progress = (currentrec / totalrec) * 100\n proceed = av.SetStatus( progress )\n if (proceed.Not) then\n av.ShowMsg( \"Stopped\" )\n exit\n end\n\n aShape = theFtab.ReturnValue(theShapeField, x)\n \n ' BAIL OUT IF THE SHAPE IS NULL (LIKE THE UNIVERSAL POLYGON IN AN ARCINFO P OLYGON COVERAGE.)\n if(aShape.IsNull = true) then\n continue\n end \n\n if (theProjection.IsNull) then\n aGraphic = GraphicShape.Make(aShape)\n else\n aGraphic = GraphicShape.Make(aShape.ReturnProjected(theProjection))\n end\n aGraphic.SetSymbol(theSymbol.Clone)\n theGraphics.AddBatch(aGraphic)\n \nend\n\ntheFTab.SetSelection(TheOldSelRecs)\ntheFTab.UpdateSelection \n \ntheGraphics.EndBatch\ntheGraphics.Invalidate\n\ntime2 = Date.Now.AsSeconds\ntottime = time2 - time1\n\n' OUTPUT TO AN XTOOLS LOG FILE:\ntheStr = \" Shape2Graphic\"+\" \"+theInputTheme.GetSRCName.GetFileName.AsString+\" \"+theFTab.GetNumRecords.AsString+\" shapes --> \"+\ntheFTab.GetNumRecords.AsString++\"graphics] [\"+tottime.AsString++\"secs]\"\nav.Run(\"aan.Sub-LogFile\", theStr)\nav.ShowMsg(theStr)" ) (Script.379 Name: "aanView.Graphic2Shape" SourceCode: "' Name: aanView.Graphic2Shape\n'\n' Title: Convert Graphics to Shapes\n'\n' Topics: Graphics, Symbols, Views\n'\n' Description: See the \"Shift click\" instructions below for a script description. \n'\n' Requires: Visible graphics in the view\n'\n' Self: Not Applicable\n'\n' Returns: Not Applicable\n'\n'===========================================================\n \n' Check for the shift key, if the shift key is down, pop up instructions for using this script\n \nif (System.IsShiftKeyDown) then\n message =\n \" \"+nl+\n \"Inst ructions For Convert Graphics To Shapes script:\"+nl+nl+\n \"This script creates one shape file for each user-selected shape type in the view.\"+nl+ \n \"Rectangle, circle and polygon graphics are converted to polygon shapes. Line and\"+nl+\n \"polyline graphics are converted to polyline shapes. Point graphics are converted\"+nl+\n \"to point shapes.\"+nl++nl+\n \"Script modified from ESRI sample script by Mike DeLaune, (Email: mike.g.delaune@state.or.us),\"+nl+\n \"Oregon Department of Forestry, 1/15/98.\"+nl++nl+\n \"Brief Instructions:\"+nl+nl+\n \"1. Add at least one graphic to the view.\"+nl+nl+\n \"2. Press the Convert Graphics to Shapes menu choice in the XTools menu.\"+nl++nl+\n \"3. A message box is provided to select the graphic shape types that the\"+nl+\n \" user wishes to convert to shapes.\"+nl++nl+\n \"4. For each graphic shape type selected, the user will be asked to specify\"+nl+\n \" the desired name and location of the output shapefile.\"\n\n \n msgbox.report(message,\"Graphics To Shapes Convertor In structions\")\n \n Clipboard.The.Empty\n Clipboard.The.Add(message)\n Clipboard.The.Update\n \n MsgBox.Info(\"These instructions were copied to the system clipboard. To print them, open a text editor\"++\n \"(like notepad), paste in the contents of the clipboard, and print them from the text editor.\",\"PRINT INSTRUCTIONS\")\n \n exit\nend\n \n''''''''''''''''''''''''''''''''''''''\n' INITIAL SET UP AND ERROR CHECKS:\n''''''''''''''''''''''''''''''''''''''\n\n' GET THE XTOOLS DEFAULTS\ntheDefScript = av.GetProject.Fi ndScript( \"XTprojectDefaults\" )\nif(theDefScript <> nil) then\n DefList = theDefScript.AsString.AsList\nelse\n MsgBox.Error(\"Please set XTools Defaults\",\"XTOOLS DEFAULTS NOT SET\")\n return nil\nend\ntheAreaCalc = DefList.Get(6)\n\ntheView = av.GetActiveDoc\ntheProjection = theView.GetProjection\ntheGPL = theView.GetGraphics.FindAllByClass(GraphicShape)\n\nif(theGPL = Nil) then\n MsgBox.Warning(\"There are no Graphics in the View, Bailing!\",\"\")\n exit\nend\n\npointList = List.Make\npolylineList = List.Make\npolygonList = Li st.Make\n\nfor each aGraphic in theGPL\n 'skip attached, non-visible graphics\n if(aGraphic.IsVisible = false) then\n continue\n end \n \n 'CONVERT ANY SIMPLE SHAPES TO THEIR FEATURE EQUIVALENTS\n theShape = aGraphic.GetShape\n if(theShape.Is(Line)) then\n theShape = theShape.AsPolyline\n end\n if(theShape.Is(Rect)) then\n theShape = theShape.AsPolygon\n end\n if(theShape.Is(Circle)) then\n theShape = theShape.AsPolygon\n end\n \n 'ADD THE SHAPES TO THEIR RESPECTIVE LISTS\n if(theShape.Is(Point)) the n\n pointList.Add(theShape)\n elseif(theShape.Is(Polygon)) then\n polygonList.Add(theShape)\n elseif(theShape.Is(Polyline)) then\n polylineList.Add(theShape) \n end\nend\n\nmsgList = List.Make\nif (pointList.Count > 0) then\n msgList.Add(pointList.Count.AsString+\" graphic points.\")\nend\nIf (polylineList.Count > 0 ) then\n msgList.Add(polylineList.Count.AsString+\" graphic polylines.\")\nend\nif (polygonList.Count > 0) then\n msgList.Add(polygonList.Count.AsString+\" graphic polygons.\")\nend \n\nif(msglist.Count = 0) then\n MsgBox.Warning(\"There are no visible graphics in the View, bailing!\",\"\")\n exit\nend \n\n\n' ASK THE USER WHICH GRAPHIC SHAPE TYPES TO CONVERT.\nsellist = Msgbox.MultiListAsString(msgList,\"Select graphics to convert to shapes.\"+nl+\n\"(single click to toggle selection,\"+nl+\n\" click and drag for multiple selection)\",\"Multiple Graphics Convert To Shape\")\n\nif(sellist = Nil) then exit end\n\nfor each aShapeSel in sellist\n\n\n theCLof = List.Make\n if (aShapeSel.Contains(\"point\")) then\n theCLof = pointList\n shptyp = \"POINT\"\n elseif (aShapeSel.Contains(\"polyline\")) then\n theCLof = polylineList\n shptyp = \"POLYLINE\"\n elseif (aShapeSel.Contains(\"polygon\")) then\n theCLof = polygonList\n shptyp = \"POLYGON\"\n end\n \n theGraphicsNum = theCLof.Count.AsString\n \n aShapeType = theCLof.Get(0)\n \n ' ASK THE USER FOR A FILENAME AND LOCATION FOR THE NEW SHAPEFILE. EXIT IF USER CANCELS.\n theWorkDir = av.GetProject.GetWorkDir\n theWorkDir.SetCWD\n defname = theWorkDir.MakeTMP(\"Graph\", \"shp\")\n outputfil e = FileDialog.Put(defname,\"*.shp\",\"NAME NEW \"+shptyp+\" THEME\")\n if (outputfile = nil) then exit end\n \n time1 = Date.Now.AsSeconds\n \n theFtab=Ftab.MakeNew(outputfile, aShapeType.GetClass)\n theIDfld=Field.Make(\"ID\", #FIELD_LONG, 6, 0)\n theShapeFld=theFtab.FindField(\"Shape\")\n theFldList={theIDfld}\n theFtab.AddFields(theFldList)\n \n for each fea in theCLoF\n theRecNo=theFtab.AddRecord\n theFtab.SetValue(theIDfld, theRecNo, theRecNo)\n if (theProjection.IsNull) then\n fea2 = fea.Clone\n el se\n fea2 = fea.ReturnUnProjected(theProjection)\n end\n eachShape=fea2\n theFtab.SetValue(theShapeFld, theRecNo, eachShape)\n end\n \n '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''\n ' BEGIN THE POST-EDITING CALCULATIONS AND CLEANUP. \n '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''\n 'Set editing OFF and clear selection.\n theFtab.seteditable(false)\n theFtab.GetSelection.Clearall\n\n \n \n\n ' CALCULATE AREA, PERIMETER, ACRES, AND LENGTH FIELDS AS NECESSARY AN D APPROPRIATE.\n if(theAreaCalc = \"Yes\") then\n av.Run(\"aan.Sub-CalcSize\",{theFTab})\n end\n \n ' CREATE THE NEW THEME AND ADD IT TO THE VIEW\n theOutputTheme = FTheme.Make(theFtab)\n theView.AddTheme(theOutputTheme)\n \n ' INDEX THE THEME, IF NECESSARY.\n if (theFtab.IsFieldIndexed(theShapeFld) = False) then\n theFtab.CreateIndex(theShapeFld)\n end\n \n ' BRING THE VIEW TO THE FRONT AND CLEAN UP.\n theView.InvalidateTOC(nil)\n theView.GetWin.Activate\n \n time2 = Date.Now.AsSeconds\n tottime = time2 - time1\n\n ' OUTPUT TO AN XTOOLS LOG FILE:\n theType = theOutputTheme.GetSRCName.GetSubName\n theStr = \"Graphic2Shape\"+\" \"+theOutputTheme.GetSRCName.GetFileName.AsString+\" \"+\n theType+\" \"+\"[\"+Date.Now.AsString+\"] [\"+theGraphicsNum+\" graphics --> \"+theFTab.GetNumRecords.AsString++\n \"shapes] [\"+tottime.AsString++\"secs]\"\n av.Run(\"aan.Sub-LogFile\", theStr)\n av.ShowMsg(theStr)\n \nend\n\ntheView.Invalidate\n\n'--- End Of Script" ) (Script.380 Name: "aauView.Shape2Centroid" SourceCode: "' Name: aauView.Shape2Centroid\n'\n' Title: Convert Shape To Centroid \n'\n' Topics: Views, Shapes\n'\n' Description: See the \"Shift click\" instructions below for a script description. \n'\n' Requires: A feature theme in the View.\n'\n' Self: Not Applicable\n'\n' Returns: Not Applicable\n'\n'===========================================================\n \n' Check for the shift key, if the shift key is down, pop up instructions for using this script\n \nif (System.IsShiftKeyDown) then\n message =\n \" \"+nl+\n \"Instructions F or ''Convert Shape To Centroid'' script:\"+nl+nl+\n \"This script creates a new point shape file from the center points (centroids) of the shapes in \"+nl+\n \"the input shapefile. A centroid of a shape is the spatial location of its ''center of mass''. \"+nl+\n \"The script will calculate the center of any shapetype (point, line, polygon etc.) in a feature \"+nl+\n \"theme and add this as a point to a new theme. It also transfers all fields of the original feature \"+nl+\n \"theme to the newly created point theme. \"+nl++nl+\n \"Here are some example uses of this script:\"+nl++nl+\n \"1) Use it to symbolize 2 properties of the same shapefile at the same time. Use the input shapefile \"+nl+\n \"legend to symbolize one property, the new centroid point themes legend to symbolize a second using the\"+nl+\n \"transferred attributes.\"+nl++nl+\n \"2) Use it in special cases of spatial joins (shapefield to shapefield joins). Suppose you have two polygon \"+nl+\n \"shapefiles A and B. You want to transfer the attributes of A to B. Of course you could do something like\"+nl+\n \"an overlay, but sometimes this is undesirable. Also there are no unique identifiers identical between \"+nl+\n \"the two themes on which you could perform a normal join. What to do??? Here it is: create a centerpoint \"+nl+\n \"theme from B, do a spatial join with A. Now the data from the polygons from A have been joined to the \"+nl+\n \"centerpoint shapefile (you can not perform a spatial join where the data from points get transfered to \"+nl+\n \"polygons , because the re might be more than one point inside one polygon). Because you have the unique \"+nl+\n \"identifiers from B in your centerpoint theme, you can now join the centerpoint theme to the theme table \"+nl+\n \"of B. Data transfered!!!\"+nl++nl+\n \"Script written by Marco Boeringa, (Email: POECT8@gw.amsterdam.nl),\"+nl+\n \"Amsterdam Water Supply, 8-5-'98.\"+nl++nl+\n \"Instructions:\"+nl+nl+\n \"1. Have at least one feature theme in the view.\"+nl+nl+\n \"2. Press the ''Convert Shape To Centroid'' menu choice in the View XTools menu.\"+nl++nl+\n \"3. In the first dialog box, select the input theme that you wish to convert to centroids.\"+nl++nl+\n \"4. In the second dialog box, specify the desired name and location of the output shapefile.\"\n\n \n msgbox.report(message,\"Convert Shape To Centroid Instructions\")\n \n Clipboard.The.Empty\n Clipboard.The.Add(message)\n Clipboard.The.Update\n \n MsgBox.Info(\"These instructions were copied to the system clipboard. To print them, open a text editor\"++\n \"(like notepad), pa ste in the contents of the clipboard, and print them from the text editor.\",\"PRINT INSTRUCTIONS\")\n \n exit\nend\n \n''''''''''''''''''''''''''''''''''''''\n' INITIAL SET UP AND ERROR CHECKS:\n''''''''''''''''''''''''''''''''''''''\n\ntheProject = av.GetProject\n\n' GET THE ACTIVE DOCUMENT, WHICH SHOULD BE A VIEW. BAIL IF NOT A VIEW:\ntheView=av.GetActiveDoc\nif (theView.Is(View).Not) then\n MsgBox.Error(\"This script must be run from a view. Exiting\",\"Error\")\n exit\nend\n \n' BUILD A LIST OF FTHEMES FROM THE THEME L IST. THE USER WILL BE ASKED TO SELECT FROM THE LIST.\nthms=List.Make\nfor each t in theView.GetThemes\n if (t.Is(Ftheme)) then\n thms.Add(t)\n end\nend\n \n' IF < 1 THEMES ARE FTHEMES, BAIL OUT.\nif (thms.Count < 1) then\n System.Beep\n MsgBox.Error(\"There must be at least one feature theme in the View to proceed! Exiting.\",\"Error\")\n exit\nend\n \n' ASK THE USER WHICH THEME TO CONVERT TO CENTROIDS:\ntheActiveTh = MsgBox.Choice(thms,\"Select the theme that contains features that you wish to convert to centroids: \",\n \"SELECT INPUT THEME\")\nif(theActiveTh = nil) then exit end \n \n' END OF THE INITIAL SETUP\ntime1 = Date.Now.AsSeconds\n\n'GET ALL THEMES\ntheViewThs = theView.GetThemes\n\n'FIND THE POSITION OF THE ACTIVE THEME IN THE VIEWS TOC\nfor each theNo in 0..(theViewThs.Count - 1)\n if (theViewThs.Get(theNo).GetName = theActiveTh.GetName)\n then\n thePos = theNo\n end\nend\n\n'CREATE A TITLE FOR ALL MESSAGE BOXES\ntheT = \"Calculate center\"\n\n'CHECK IF THEME IS OF CORRECT TYPE\nif (theActiveTh.Is(FTHEME ).Not)\n then\n MsgBox.Error(\"The active theme\" ++ theActiveTh.GetName ++ \"is not a feature theme.\" + NL + \n \"Can not convert data...\", theT)\n return Nil\nend\n\ntheInputFTab = theActiveTh.GetFTab\ntheShapeF = theInputFTab.FindField(\"Shape\")\n\ntheWorkDir = theProject.GetWorkDir\ntheWorkDir.SetCWD\n\ntheTempFN = theWorkDir.MakeTMP(\"Cntrs\", \"shp\")\ntheNewFN = FileDialog.Put (theTempFN, \"*.shp\", \"Enter a filename:\")\n\n'CHECK IF USER ENTERED ANYTHING\nif (theNewFN = Nil)\n then\n return Nil\nend\n\n'CREATE NEW THEMETABLE\nnewFTab = FTab.MakeNew(theNewFN, Point)\nif (newFTab.HasError)\n then\n MsgBox.Error(\"Could not create feature table\", theT)\n return Nil\nend\n\nnewFTab.SetEditable(TRUE)\nif (newFTab.IsEditable.Not)\n then\n MsgBox.Error(\"New table can not be edited, can not transfer data.\", theT)\n return Nil\nend\n\nif (theInputFTab.FindField(\"ID\") = Nil)\n then\n 'Add field for storing unique identifier\n theIDField = Field.Make(\"ID\",#FIELD_DECIMAL, 8, 0)\n newFTab.AddFields({theIDField})\nend\n \n'MAKE A LIST OF I NPUT THEME FIELDS, EXCLUDING THE SHAPE FIELD.\ntheInputfields = List.Make\nfor each f in theInputFTab.GetFields\n if (f.GetName = \"Shape\")then\n continue\n else \n fCopy = f.Clone\n theInputFields.Add(fCopy)\n end\nend\n\nif (((theInputFields = nil).Not) and (theInputFields.Count > 0)) then\n newFTab.AddFields(theInputFields)\nend\ntheShapeField = newFTab.FindField(\"Shape\")\n\n'SET WORKING STATUS\nav.ShowMsg(\"Adding points to new themetable...\")\n\n'FIND THE NUMBER OF RECORDS\nif (theInputFTab.GetNumSelRecords > 0) \n then\n theNoRec = theInputFTab.GetNumSelRecords\n theInput = theInputFTab.GetSelection\n else\n theNoRec = theInputFTab.GetNumRecords\n theInput = theInputFTab\nend\n\n'FILL NEW THEME WITH CENTER (POINTS) OF POLYGON THEME\n\nfor each theRec in theInput\n theDoMore = av.SetStatus ((theRec + 1)/theNoRec * 100)\n if (theDoMore.Not)\n then\n av.ClearStatus\n av.ClearMsg\n return Nil\n end \n theCenter = theInputFTab.ReturnValue(theShapeF, theRec).ReturnCenter\n theNRec = newFTab.AddRecord\n newFTab.SetVal ue(theShapefield,theNRec,theCenter)\n \n if (theInputFTab.FindField(\"ID\") = Nil)\n then \n newFTab.SetValue(theIDField, theNRec, theNRec)\n end\n \n 'ADD THE ATTRIBUTE DATA FROM THE INPUT THEME:\n if (((theInputFields = nil).Not) and (theInputFields.Count > 0)) then\n for each afield in theInputFields\n oldfield = theInputFTab.FindField(afield.GetAlias)\n oldvalue = theInputFTab.ReturnValue(oldfield,theRec)\n newFtab.SetValue(afield,theNRec,oldvalue)\n end\n end\n\nend\n\n'CLEAR MESSAGES\nav .ClearStatus\nav.ClearMsg\n\nnewFtab.SetEditable(FALSE)\ntheFTh = FTheme.Make(newFTab)\ntheView.AddTheme(theFTh)\ntheViewThs = theView.GetThemes\ntheViewThs.Shuffle(theFTh, (thePos + 1))\ntheView.InvalidateTOC(nil)\n\ntime2 = Date.Now.AsSeconds\ntottime = time2 - time1\n\n' OUTPUT TO AN XTOOLS LOG FILE:\ntheType = theFTh.GetSRCName.GetSubName\ntheStr = \"Shape2Centroid\"+\" \"+theActiveTh.GetSRCName.GetFileName.AsString+\" \"+theFTh.GetSRCName.GetFileName.AsString+\" \"+\ntheType+\" \"+\"[\"+Date.Now.AsString+\"] [\"+theInputFT ab.GetNumRecords.AsString+\" shapes --> \"+newFTab.GetNumRecords.AsString++\n\"centroids] [\"+tottime.AsString++\"secs]\"\nav.Run(\"aan.Sub-LogFile\", theStr)\nav.ShowMsg(theStr)\n\n'END SCRIPT\ntheProject.SetModified(TRUE)\nav.PurgeObjects" ) (Script.381 Name: "aanSpace.Xtools5" ) (Script.382 Name: "aanView.BatchImportToShape" SourceCode: "' Name: aanView.BatchImportToShape\n'\n' Title: Batch Import To Shapefile\n'\n' Topics: View, Shapefile, Theme\n'\n' Description: See the \"Shift click\" instructions below for a script description.\n'\n' Requires: The active document must be a View with active feature themes.\n'\n' Self: \n'\n' Returns: \n\n'===========================================================\n \n' Check for the shift key, if the shift key is down, pop up instructions for using this script\n\nif (System.IsShiftKeyDown) then\n message =\n \" \"+nl+ \n \"Instructions For Batch Import Themes to Shapefiles:\"+NL+NL+\n \"This script allows the user to import all feature themes in a View to shapefiles.\"+nl+\n \"The script is useful in converting large numbers of themes to shapefiles and storing them \"+nl+\n \"in one location simultaneously. The script must be run from a View with one or more \"+nl+\n \"feature themes. The script does not allow the user to write over an existing file of the\"+nl+ \n \"same name. The names for the new shapefiles are derived by add ing .shp to the \"+nl+\n \"theme name. For this reason, theme names must either be 8 characters or less if run \"+nl+\n \"on a operating system that does not support long file names.\"+nl+nl+\n \"Script by Mike DeLaune, (Email: mike.g.delaune@state.or.us),Oregon Department of Forestry, 10/18/97.\"+NL+NL+\n \"Instructions:\"+nl+nl+\n \"1. Add all of the themes that you wish to convert to the view.\"+nl+nl+\n \"2. Click the Batch Import Themes To Shapefiles Xtools menu option.\"+nl+nl+\n \"3. In the first dialog box, navi gate to the subdirectory where the shapefiles\"+nl+\n \"should be saved. \"+nl+nl+\n \"4. In the second dialog box, select the themes that you wish to import into new shapefiles.\"+nl+nl+\n \"5. The script will then create the new shapefiles, make themes from them, \"+nl+\n \"and add the new themes to the View. At this point the user may delete all \"+nl+\n \"of the source themes, if they desire.\"+nl\n \n msgbox.report(message,\"Batch Import Themes to Shapefiles Instructions\")\n \n Clipboard.The.Empty\n Clipb oard.The.Add(message)\n Clipboard.The.Update\n \n MsgBox.Info(\"These instructions were copied to the system clipboard. To print them, open a text editor\"++\n \"(like notepad), paste in the contents of the clipboard, and print them from the text editor.\",\"PRINT INSTRUCTIONS\")\n\n return nil\nend\n\n''''''''''''''''''''''''''''''''''''''''''''''''''''''''''\n' Begin Initial Setup:\n'''''''''''''''''''''''''''''''''''''''''''''''''''''''''' \n\n' Get the View:\ntheView = av.GetActiveDoc\n\nif (theView.Is(View).Not) t hen\n MsgBox.Error(\"This script must be run from a view. Exiting\",\"Error\")\n exit\nend\n\n\n' END OF THE INITIAL SETUP\n\n''''''''''''''''''''''''''''''''''''''''''''''''''''''''''\n' ASK FOR USER INPUT:\n'''''''''''''''''''''''''''''''''''''''''''''''''''''''''' \n\n' USER DESIGNATES WHERE THE OUTPUT SHAPEFILES WILL BE STORED.\nthePath = FileDialog.Put(\"Import.shp\".AsFileName, \"*.shp\", \"SELECT SUBDIRECTORY FOR NEW SHAPEFILES\")\nif(thePath = nil) then exit end\nthePath.StripFile\n\n \n' BUILD A LIST OF FTHEMES FROM T HE THEME LIST. THE USER WILL BE ASKED TO SELECT FROM THE LIST.\nthms=List.Make\nfor each t in theView.GetThemes\n if (t.Is(Ftheme)) then\n thms.Add(t)\n end\nend\n \n' IF < 1 THEMES ARE FTHEMES, BAIL OUT.\nif (thms.Count < 1) then\n System.Beep\n MsgBox.Error(\"There must be at least one feature themes in the View to proceed! Exiting.\",\"Error\")\n exit\nend\n\n\n' END OF THE INITIAL SETUP\n \n''''''''''''''''''''''''''''''''''''''''''''''''''''''''''\n' ASK FOR USER INPUT:\n'''''''''''''''''''''''''''''''''''''''''' '''''''''''''''' \n \n' ASK THE USER WHICH THEMEs TO USE AS INPUT:\n' Ask the user which themes to import as shapefiles.\nsellist = Msgbox.MultiList(thms,\"Select Themes To Import To Shape\"+nl+\"(single click to toggle selection,\"+nl+\n\" click and drag for multiple selection)\",\"Multiple Theme Select\")\n\n \n' END OF USER INPUT.\n\n'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''\n' BEGIN THE CONVERSION PROCESS\n'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''\ntime1 = Date. Now.AsSeconds\ntheCnt = 0\n\n' GETS THE LIST OF SELECTED THEMES, CHECKS EACH TO SEE IF IT CAN BE EXPORTED TO AN FTAB:\nfor each t in sellist\n\n if (t.CanExportToFtab.Not) then \n continue\n end\n\n tbl = t.GetFTab\n attribVis = FALSE\n \n for each f in tbl.GetFields\n if ((f.IsVisible) and not (f.IsTypeShape)) then\n attribVis = TRUE\n break\n end\n end\n \n shapeVis = tbl.FindField(\"Shape\").IsVisible\n if ((attribVis and shapeVis).Not) then\n continue\n end \n \n name = t.getname\n if(name.Contains(\".\")) then\n namelist = name.AsTokens(\".\")\n name = namelist.Get(0)\n end\n \n def = (thePath.AsString + \"/\" + name + \".shp\").AsFileName\n\n' END THE PROCESS IF NO NAME WAS CREATED:\n if (def = NIL) then return nil end\n \n' END FOR THIS THEME IF FILE WITH SAME NAME ALREADY EXISTS AT THE SAME LOCATION\n\n if ( File.Exists(def)) then\n msgbox.Warning(def.AsString++\"already exists. Skipping import of this theme.\"++\n \"Try importing theme to a different subdirectory.\" ,\"BATC H IMPORT ACTIVE THEMES\")\n continue\n end \n \n shpfld = (tbl.FindField(\"Shape\"))\n if (shpfld.IsVisible.Not) then\n shpfld.SetVisible(shpfld.IsVisible.Not)\n WasNotVisible = TRUE\n else\n WasNotVisible =FALSE\n end\n \n anFTab = tbl.Export(def, Shape, FALSE)\n \n if (anFTab.HasError) then\n if (anFTab.HasLockError) then\n MsgBox.Error(\"Unable to acquire Write Lock for file \" + def.GetBaseName,\"\")\n else\n MsgBox.Error(\"Unable to create \" + def.GetBaseName,\"\")\n end\n return nil\n end \n \n if (WasNotVisible) then\n shpfld.SetVisible(FALSE)\n end\n\n \n' CREATE A THEME AND ADD IT TO THE VIEW\n fthm = FTheme.Make(anFTab)\n theView.AddTheme(fthm)\n 'bring the View to the front\n theView.GetWin.Activate\n \n theCnt = theCnt + 1\nend\n\ntime2 = Date.Now.AsSeconds\ntottime = time2 - time1\n\n' OUTPUT TO AN XTOOLS LOG FILE:\ntheStr = \"BatchImportToShape \"+theCnt.AsString+\" theme(s) imported into shapefiles \"+\n\"[\"+Date.Now.AsString+\"] [\"+tottime.SetFormat(\"d\").AsString+ +\"secs]\"\nav.Run(\"aan.Sub-LogFile\", theStr)\nav.ShowMsg(theStr)" ) (Script.383 Name: "aanSpace.Xtools6" ) (Script.384 Name: "aanView.SourceManager" SourceCode: "SourceManager.ManageDatasets(nil,\"Manage Data Sets\")" ) (Script.385 Name: "aasTable.FieldProperties" SourceCode: "' Name: Table.FieldProperties\n' \n' Title: Displays field properties\n'\n' Topics: Tables \n' \n' Description: This example script uses some of the requests for a Field to\n' get information about the currently selected field, and displays the \n' collected information using MsgBox.Report.\n'\n' Requires: A table must be the active document, with an active field. You\n' can use the system script, Table.SortUpdate, to disable the control that\n' executes this script when no field is active.\n'\n' Self: \n'\n' Returns : \n\natbl=av.getactivedoc\ntheVTab1 = atbl.getvtab\ntheField = av.GetActiveDoc.GetActiveField\n\nif(theField = nil) then\n MsgBox.Warning(\"You first need to select a field. Please select a field by clicking on it's name in the table, then try again.\",\"\")\n exit\nend\n\nisItIndexed = theVtab1.IsFieldIndexed(theField) 'added mk\n \nfname = theField.GetName\nfalias = theField.GetAlias\nftype = theField.GetType\nfwidth = theField.GetWidth\nfprec = theField.GetPrecision\nfstat = theField.GetStatus\nfpwidth = theField.GetPix elWidth\nfeditable = theField.IsEditable\nmessage = \"Name: \"+fname+NL+\n \"Alias: \"+falias+NL+\n \"Type: \"+ftype.asstring+NL+\n \"Width: \"+fwidth.asstring+NL+\n \"Precision: \"+fprec.asstring+NL+\n \"Status: \"+fstat.asstring+NL+\n \"Pixel Width: \"+fpwidth.asstring+NL+\n \"Editable: \"+feditable.AsString+NL+\n \"Indexed? \"+isItindexed.asstring \n \nav.ShowMsg(\"This information was copied to the syst em clipboard. To print it, open a text editor\"++\n \"(like notepad), paste in the contents of the clipboard, and print it from the text editor.\")\n \nMsgBox.Report(message,\"Field Properties\")\n\n Clipboard.The.Empty\n Clipboard.The.Add(message)\n Clipboard.The.Update\n \n\n" ) (Script.386 Name: "aasTable.ReportInfo" SourceCode: "' Name: Table.ReportInfo\n'\n' Title: Reports on a table's structure\n'\n' Topics: Tables\n'\n' Description: Working off a table document this script reports \n' on the structure of the table\n'\n' Requires: The active document must be a table.\n'\n' Self: \n'\n' Returns: \n\n\n\n\natbl=av.getactivedoc\nif(atbl.is(table).not) then\n msgbox.error(\"A table document must be active.\",\"Error\")\n exit\nend\n\ntheVTab1 = atbl.getvtab\ntheBitMap1 = theVTab1.GetSelection\nfList = theVTab1.GetFields\ntotalchar = \"Alias Typ e Precision Width Indexed?\" ' mk added last atab and index?\ntotalchar=totalchar+nl+\"---------------------------------------------------------------------\"\n\nfor each subitem in flist\n aspace=\" \"\n \n item = subitem.getalias\n thecnt = item.Count\n theSpaces = 20 - thecnt\n if(theSpaces >= 1) then\n for each i in 1..theSpaces\n item = item + \" \"\n end\n end\n compilation = item\n\n item = subitem.gettype.AsString\n thecnt = item.Count\n theSpaces = 24 - thecnt\n if(theSpaces >= 1 ) then\n for each i in 1..theSpaces\n item = item + \" \"\n end\n end\n compilation = compilation + item\n \n item = subitem.getPrecision.AsString\n thecnt = item.Count\n theSpaces = 10 - thecnt\n if(theSpaces >= 1) then\n for each i in 1..theSpaces\n item = item + \" \"\n end\n end\n compilation = compilation + item \n \n item = subitem.getwidth.AsString\n thecnt = item.Count\n theSpaces = 8 - thecnt\n if(theSpaces >= 1) then\n for each i in 1..theSpaces\n item = item + \" \"\n end\n end \n compilation = compilation + item \n \n item = theVtab1.IsFieldIndexed(subitem).AsString 'added by mk\n thecnt = item.Count\n theSpaces = 10 - thecnt\n if(theSpaces >= 1) then\n for each i in 1..theSpaces\n item = item + \" \"\n end\n end\n compilation = compilation + item \n \n totalchar=totalchar +nl+ compilation\n \nend\n\nav.ShowMsg(\"This information was copied to the system clipboard. To print it, open a text editor\"++\n \"(like notepad), paste in the contents of the clipboard, and print it from the text editor.\")\n \nMsgBox.report(totalchar, \"Items from \"+atbl.getname.asstring)\n\nClipboard.The.Empty\nClipboard.The.Add(totalchar)\nClipboard.The.Update\n\n" ) (Script.387 Name: "aanTable.Statistics" SourceCode: "' Name: aanTable.Statistics\n'\n' Title: Table Statistics\n'\n' Topics: Table\n'\n' Description: See the \"Shift click\" instructions below for a script description.\n'\n' Requires: The active document must be a table.\n'\n' Self: \n'\n' Returns: \n\n'===========================================================\n\n' Check for the shift key, if the shift key is down, pop up instructions for using this script\n\nif (System.IsShiftKeyDown) then\n message =\n \" \"+nl+\n\"Table Statistics:\"+nl+nl+\n\"This script analyses a table a nd calculates statistics for each numeric field similar to those \"+nl+\n\"provided by the Field, Statistics menu item. The resulting information is written to a \"+nl+\n\"new table created by the script.\"+nl++nl+\n\"For every field, the table contains the following information: Field name, alias, type, width, \"+nl+\n\"decimals, status (new or old), pixel width, whether or not it is editable, visible, and whether \"+nl+\n\"or not it is an ArcInfo redefined field.\"+nl++nl+\n\"For numeric fields, the table contains the fol lowing statistics: sum, count, mean, min, max, \"+nl+\n\"range, variance, and standard deviation.\"+nl++nl+\n\"Script by Mike DeLaune, (Email: mike.g.delaune@state.or.us), 11/1/2000\"+nl++nl+\n\"Instructions:\"+nl+nl+\n\"1. Open a table.\"+nl++nl+\n\"2. Select the ''Table Statistics'' choice in the Table XTools menu.\"+nl+nl+\n\"3. In the dialog box, specify the name and location that you wish for the \"+nl+\n\" output table.\"\n \n msgbox.report(message,\"Table Statistics\")\n \n Clipboard.The.Empty\n Clipboard.The.Add(m essage)\n Clipboard.The.Update\n \n MsgBox.Info(\"These instructions were copied to the system clipboard. To print them, open a text editor\"++\n \"(like notepad), paste in the contents of the clipboard, and print them from the text editor.\",\"PRINT INSTRUCTIONS\")\n\n return nil\nend\n\n''''''''''''''''''''''''''''''''''''''''''''''''''''''''''\n' INITIAL SETUP:\n'''''''''''''''''''''''''''''''''''''''''''''''''''''''''' \n\nScript.The.SetNumberFormat( \"d.ddddd\" )\n\ntime1 = Date.Now.AsSeconds\n\ntheTable = av.GetActiv eDoc\ninVtab = theTable.GetVtab\ninFields = inVTab.GetFields\n\n' MAKE THE FIELDS FOR THE OUTPUT TABLE\noutFields = List.Make\noutFields.Add(Field.Make(\"Field_Name\",#FIELD_CHAR,16,0))\noutFields.Add(Field.Make(\"Alias\",#FIELD_CHAR,16,0))\noutFields.Add(Field.Make(\"Type\",#FIELD_CHAR,15,0))\noutFields.Add(Field.Make(\"Width\",#FIELD_CHAR,5,0))\noutFields.Add(Field.Make(\"Decimals\",#FIELD_CHAR,8,0))\noutFields.Add(Field.Make(\"Status\",#FIELD_CHAR,7,0))\noutFields.Add(Field.Make(\"Pix_Width\",#FIELD_CHAR,9,0))\noutFields.Add(Fiel d.Make(\"Editable\",#FIELD_CHAR,8,0))\noutFields.Add(Field.Make(\"Visible\",#FIELD_CHAR,7,0))\noutFields.Add(Field.Make(\"Redefined\",#FIELD_CHAR,9,0))\noutFields.Add(Field.Make(\"Blanks\",#FIELD_CHAR,30,0))\noutFields.Add(Field.Make(\"Sum\",#FIELD_CHAR,30,0))\noutFields.Add(Field.Make(\"Count\",#FIELD_CHAR,30,0))\noutFields.Add(Field.Make(\"Mean\",#FIELD_CHAR,30,0))\noutFields.Add(Field.Make(\"Min\",#FIELD_CHAR,30,0))\noutFields.Add(Field.Make(\"Max\",#FIELD_CHAR,30,0))\noutFields.Add(Field.Make(\"Range\",#FIELD_CHAR,30,0))\noutFields. Add(Field.Make(\"Variance\",#FIELD_CHAR,30,0))\noutFields.Add(Field.Make(\"SDev\",#FIELD_CHAR,30,0))\n \n'**** GET OUTPUT FILENAME, MAKE OUTPUT FILE, AND ADD THE FIELDS.\noutfile = FileName.GetCWD.MakeTmp(\"Tinfo\",\"dbf\")\noutfile = FileDialog.Put(outfile,\"*.dbf\",\"Output File\")\n\nif (outfile = nil) then\n return nil\nend\n\noutVtab = VTab.MakeNew(outfile,dBASE)\ntempfld = Field.Make(\"temp\",#FIELD_CHAR,1,0)\noutVTab.AddFields({tempfld})\n\nfor each i in 1..infields.Count\n outVTab.AddRecord\nend \n\nav.ShowMsg(\"Making Calculatio ns....\")\n \n' MAKE THE CALCULATIONS AND WRITE THEM TO THE OUTPUT TABLE.\nfieldnum = \"-1\".AsNumber\nfor each outfld in outFields\n\n fieldnum = fieldnum + 1\n\n theList = List.Make \n theWidth = outfld.Getname.AsString.Count\n \n '***** Get and write the field Value\n for each infld in inFields\n \n var = \" \"\n theBlanks = 0\n \n '***** DO CALCULATIONS FOR NUMERIC FIELDS\n if(infld.IsTypeNumber) then\n theSum = 0\n theCount = 0\n theMinimum = nil\n theMaximum = nil\n \n for each record in inV Tab\n theValue = inVTab.ReturnValueNumber( infld, record )\n if ( not ( theValue.IsNull ) ) then\n if ( theMinimum = nil ) then\n theMinimum = theValue\n theMaximum = theValue\n else\n theMinimum = theMinimum min theValue\n theMaximum = theMaximum max theValue\n end\n theSum = theValue + theSum\n theCount = theCount + 1\n end\n end\n theMean = theSum / theCount\n \n theSumSqDev = 0\n \n for each record in inVTab\n theV alue = inVTab.ReturnValueNumber( infld, record )\n if ( not ( theValue.IsNull ) ) then\n theSqDev = ( theValue - theMean ) * ( theValue - theMean )\n theSumSqDev = theSqDev + theSumSqDev\n end\n end\n \n if (theCount > 1) then\n theVariance = theSumsqdev / (theCount - 1)\n theStdDev = theVariance.Sqrt\n else\n theVariance = 0\n theStdDev = 0\n end\n \n theRange = ( theMaximum-theMinimum ).Abs\n \n else ' FOR NON-NUMERIC FIELDS.\n theBlanks = 0\n for e ach record in inVTab\n theValue = inVTab.ReturnValue( infld, record )\n if(theValue = \"\") then\n theBlanks = theBlanks + 1\n end\n end \n \n\n \n end ' IF(INFLD.ISTYPENUMBER) THEN\n\n if(fieldnum = 0) then \n var = infld.GetName\n elseif(fieldnum = 1) then\n var = infld.GetAlias\n elseif(fieldnum = 2) then\n var = infld.GetType.AsString.Middle(6,10)\n elseif(fieldnum = 3) then\n var = infld.GetWidth.SetFormat(\"d\").AsString\n elseif(fieldnum = 4) then\n var = infld.GetPrecision.SetFormat(\"d\").AsString\n elseif(fieldnum = 5) then\n var = infld.GetStatus.AsString.Middle(13,10)\n elseif(fieldnum = 6) then\n var = infld.GetPixelWidth.SetFormat(\"d\").AsString\n elseif(fieldnum = 7) then\n var = infld.IsEditable.AsString\n elseif(fieldnum = 8) then\n var = infld.IsVisible.AsString\n elseif(fieldnum = 9) then\n var = infld.IsRedefined.AsString\n elseif(fieldnum = 10) then\n var = theBlanks.SetFormat(\"d\").AsString\n elseif((fie ldnum = 11) and (infld.IsTypeNumber)) then\n var = theSum\n elseif((fieldnum = 12) and (infld.IsTypeNumber)) then\n var = theCount\n elseif((fieldnum = 13) and (infld.IsTypeNumber)) then\n var = theMean\n elseif((fieldnum = 14) and (infld.IsTypeNumber)) then\n var = theMinimum\n elseif((fieldnum = 15) and (infld.IsTypeNumber)) then\n var = theMaximum\n elseif((fieldnum = 16) and (infld.IsTypeNumber)) then\n var = theRange\n elseif((fieldnum = 17) and (infld.IsTypeNumber)) then\n var = theVariance\n elseif((fieldnum = 18) and (infld.IsTypeNumber)) then\n var = theStdDev\n end\n \n if(var.Is(Number)) then\n thefmt = \"d\"\n x = 0\n if(infld.GetPrecision <> 0) then\n thefmt = \"d.\"\n x = 0\n for each i in 1..infld.GetPrecision\n thefmt = thefmt + \"d\"\n end\n end\n var.SetFormat(thefmt)\n var = var.AsString\n end\n \n \n awidth = var.Count\n if(awidth > theWidth) then\n theWidth = aWidth\n end \n \n theList.Add(var)\n\n end \n \n outfld. SetWidth(theWidth + 1)\n outVTab.AddFields({outfld})\n \n rec = 0\n for each anitem in theList\n outVtab.SetValue(outfld,rec,anItem)\n rec = rec + 1\n end \n \n \nend\n \n'**** CLEANUP AND OUTPUT THE TABLE\noutVtab.RemoveFields({tempfld})\noutVtab.SetEditable(false)\n\nif (outVTab = nil) then\n return nil\nend\n\noutTableName = outVTab.GetName\n\nif (av.GetProject.FindDoc(outTableName) <> Nil) then\n av.GetProject.RemoveDoc(av.GetProject.FindDoc(outTableName))\nend\n \noutTable = Table.Make(outVTab)\noutTable.SetName(outTableName)\noutTable.GetWin.Open\n\ntime2 = Date.Now.AsSeconds\ntottime = time2 - time1\n\n' OUTPUT TO AN XTOOLS LOG FILE:\ntheStr = \"TableStatistics \"+inVtab.GetBaseTableFilename.AsString+\" Summarized Into \"+outVtab.GetBaseTableFilename.AsString+\" \"+\n\"[\"+Date.Now.AsString+\"] [\"+tottime.SetFormat(\"d\").AsString++\"secs]\"\nav.Run(\"aan.Sub-LogFile\", theStr)\nav.ShowMsg(theStr)" ) (Script.388 Name: "aanTable.MultiFieldSummarize" SourceCode: "' Name: aanTable.MultiFieldSummarize\n'\n' Title: Summarize Multiple Fields In A Table\n'\n' Topics: Editing a table\n'\n' Description: See the \"Shift click\" instructions below for a script description.\n'\n' Requires: The active document must be a table.\n'\n' Self: \n'\n' Returns: \n\n'===========================================================\n\n' Check for the shift key, if the shift key is down, pop up instructions for using this script\n\nif (System.IsShiftKeyDown) then\n message =\n \" \"+nl+\n\"Summarize Multiple Fields:\"+nl+nl+\n\"This script emulates ARC/INFO's FREQUENCY command. It generates a new table containing \"+nl+\n\"unique values of a field (or unique value combinations of multiple fields), along with \"+nl+\n\"optional summary fields. Also, a case item may be added to the original table, allowing the \"+nl+\n\"frequency table to be joined to it. The case item also allows the user to symbolize a theme \"+nl+\n\"based on a combination of attributes, rather than on just one attribute.\"+nl++nl+\n\"A frequency (or count) i s the number of times that an attribute, or combination of attributes, occurs.\"+nl+nl+\n\"A case item is a number that can be used to reference a particular attribute, or combination \"+nl+\n\"of attributes.\"+nl+nl+\n\"If there are selected records in the table, Summarize Multiple Fields will summarize only \"+nl+\n\"the selected records. If no records are selected, then all records are summarized.\"+nl++nl+\n\"Script by Mike DeLaune, (Email: mike.g.delaune@state.or.us), 11/11/2000\"+nl+\n\"This script replaces the Table Frequency script.\"+nl++nl+\n\"Instructions:\"+nl+nl+\n\"1. Open a table.\"+nl++nl+\n\"2. Select the ''Summarize Multiple Fields'' choice in the Table XTools menu.\"+nl+nl+\n\"3. In the first dialog box, select the field or fields that you wish to summarize on.\"+nl+nl+\n\"4. In the second dialog box, select the field or fields that you wish to summarize (Optional).\"+nl+\n\" Press ''Cancel'' if summary fields are not needed\"+nl+nl+\n\"5. The third dialog box will ask if you wish to add the case item to the current table (O ptional). \"+nl+\n\" If you answer ''Yes'', you will be asked for the field name that you wish to give the case item.\"+nl++nl+\n\"6. The last dialog box will ask you for the name and location that you wish to specify for the \"+nl+\n\" frequency table.\"\n \n msgbox.report(message,\"Summarize Multiple Fields\")\n \n Clipboard.The.Empty\n Clipboard.The.Add(message)\n Clipboard.The.Update\n \n MsgBox.Info(\"These instructions were copied to the system clipboard. To print them, open a text editor\"++\n \"(lik e notepad), paste in the contents of the clipboard, and print them from the text editor.\",\"PRINT INSTRUCTIONS\")\n\n return nil\nend\n\n''''''''''''''''''''''''''''''''''''''''''''''''''''''''''\n' ASK FOR USER INPUT:\n'''''''''''''''''''''''''''''''''''''''''''''''''''''''''' \nx = 0\n'av.ClearGlobals\n\n' GET THE TABLE\ntheFtab = av.GetActiveDoc \n\n' STOPS SCRIPT IF THE ACTIVE DOCUMENT IS NOT A TABLE.\nif(theFtab.is(table).not) then\n msgbox.error(\"A table document must be active, bailing.\",\"Error\")\n exit\nend\n\n' GET THE VTAB\ninVTab = theFtab.GetVtab\n\n' GET THE LIST OF FIELDS.\nvfList = inVTab.GetFields\nflist = List.Make\n\n' MAKE A NEW LIST WITHOUT THE SHAPE FIELD.\nfor each fld in vfList\n if (fld.GetName <> \"Shape\") then\n flist.Add(fld)\n end\nend \n\n \n' END OF THE INITIAL SETUP\n\n''''''''''''''''''''''''''''''''''''''''''''''''''''''''''\n' ASK FOR USER INPUT:\n'''''''''''''''''''''''''''''''''''''''''''''''''''''''''' \n\n' ASK THE USER WHICH FIELDS TO SUMMARIZE ON.\nsumlist = Msgbox.MultiList(fList,\"S elect one or more fields to summarize on\"+nl+\"(single click to toggle selection,\"+nl+\n\" click and drag for multiple selection)\",\"SELECT FIELDS TO SUMMARIZE ON\")\n\n' CHECK TO SEE IF SOME FIELDS WERE SELECTED, BAIL IF NOT:\nif ((nil = sumlist) or (sumlist.count = 0)) then\n msgbox.info(\"No fields were selected for summarization, bailing.\",\"Process Status\")\n exit\nend\n\n' MAKE A LIST OF NUMERIC FIELDS THAT COULD BE SUMMARIZED.\nsumonlistx = List.Make\nfor each fld in fList\n if((fld.IsTypeNumber) and (fld.GetType <> #FIELD_DATE))then\n sumonlistx.Add(fld)\n end\nend\n\n' REMOVE THE \"SUMMARIZE ON\" FIELDS FROM THE LIST OF FIELDS:\nfor each fld in sumlist\n theSumFldIndex = sumonlistx.Find(fld)\n if(theSumFldIndex > -1) then\n sumonlistx.Remove(theSumFldIndex)\n end\nend\n\n' ASK THE USER WHICH FIELDS TO SUMMARIZE (OPTIONAL).\nsumonlist = Msgbox.MultiList(sumonlistx,\"Select zero or more numeric fields to summarize (single click to toggle selection,\"+\n\" click and drag for multiple selection)\",\"SELECT SUMMARIZE FIELDS (OPT IONAL)\")\nif(sumonlist = nil) then\n sumonlist = {}\nend\n\n\n' ASK IF THE USER WANTS TO ADD A CASE ITEM TO THE INPUT AND OUTPUT TABLES.\naddcase = MsgBox.YesNo(\"Do you want to add a case field to the input and output tables?\",\"ADD CASE FIELD? (OPTIONAL)\",false)\nif (addcase) then\n casename = MsgBox.Input(\"Enter case field name\",\"Case Field Name\",\"\")\n inVTab.SetEditable(TRUE)\n inEdit = inVTab.IsEditable\n if(inEdit = FALSE) THEN\n MsgBox.Warning(\"The input table is not editable, so the case field will o nly be added to the output table\",\"\")\n end \n if (casename = nil) then\n return nil\n end\nelse\n casename = nil\nend\n\n\n'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''\n' END OF USER INPUT.\n\n' BEGIN THE SUMMARIZATION PROCESS\n'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''\n\ntime1 = Date.Now.AsSeconds\n\n'**** GET OUTPUT FILENAME, MAKE OUTPUT FILE AND ADD THE FIELDS.\noutfile = FileName.GetCWD.MakeTmp(\"Sum\",\"dbf\")\noutfile = FileDialog.Put(outfile,\"*.dbf\",\"Output File\")\n\ni f (outfile = nil) then\n return nil\nend\n\noutVtab = VTab.MakeNew(outfile,dBASE)\nfor each fld in sumlist\n outVTab.AddFields({fld.Clone})\nend\n\ntheCountField = Field.Make(\"Count\",#FIELD_DECIMAL,10,0)\n\noutVTab.AddFields({theCountField}) \nfor each fld in sumonlist\n fld2 = fld.Clone\n fld2.SetAlias(\"Sum_\"+fld2.GetName)\n outVTab.AddFields({fld2})\nend\n\nif(casename <> nil) then\n theOutputCaseField = Field.Make(casename,#FIELD_DECIMAL,10,0)\n theInputCaseField = theOutputCaseField.Clone\n outVTab.AddFields({theOu tputCaseField})\n if(inEdit) then\n inVTab.AddFields({theInputCaseField})\n end \nend\n\n' This script does the summarization needed in one pass through the table by using mutiple lists.\n' Strlist contains a single string for each unique combination of attributes in the fields being summarized on. For instance,\n' if two fields are being summarized on and the first record contains \"Paved\" in the first field and the number 1000 in the second\n' field, the string \"Paved1000\" will be added to strlist. Stri ngs are only added to strlist when they are not already represented in \n' strlist.\n\n' Clist contains the count of the number of times each unique combination occurs. It will have the same number of list elements as \n' strlist. In the example above, if there are two records in the table that contain the combination \"Paved\" and 1000, the first \n' element of clist will be the number 2.\n\n' Ulist contains lists that contain the attributes from the \"summarize on\" fields. In the example above, the first ele ment of ulist \n' would be {\"Paved\", 1000}.\n\n' Nlist contains lists that contain the summary data for the \"summarize\" fields. In the example for instance, if the user selected \n' Length and Cost fields to summarize, the first element of nlist would be a list containing two elements (one for each field). If \n' the totals for the two records containing the \"Paved1000\" combination were 3000 feet and $50000, then the first element of nlist \n' would be {3000,50000}.\n\n' This approach is particularly effici ent for large tables because there is no need to sort the large table before compiling the summary \n' data. Instead, sorting is done on a clone of strlist (which is much shorter than the original table) and then the data is written to \n' the output table in sort order.\n\nstrlist = List.Make\nclist = List.Make\nulist = List.Make\nnlist = List.Make\n\n'time1 = date.now\n\n' SET THE SELECTION\ntheOldSelRecs = inVtab.GetSelection.Clone\nif(theOldSelRecs.Count = 0) then\n inVtab.GetSelection.SetAll\n inVtab.UpdateSele ction\nend\n\n' SET UP THE DATA NEEDED FOR THE PROGRESS BAR.\ncurrentrec = 0 \nav.ShowStopButton\ntotalrec = inVtab.GetNumSelRecords\nav.ShowMsg(\"Making a list of unique combinations of attributes....\")\n\n\nfor each rec in inVtab.GetSelection \n\n ' SHOW PROGRESS ROUTINE:\n currentrec = currentrec + 1\n progress = (currentrec / totalrec) * 100\n proceed = av.SetStatus( progress )\n if (proceed.Not) then\n av.ShowMsg( \"Stopped\" )\n exit\n end\n\n tstr = \"\"\n\n ' MAKE A STRING CONTAINING THE COMBINED ATTRIBU TES OF THE FIELDS BEING SUMMARIZED ON.\n for each fld in sumlist\n theValue = inVtab.ReturnValue(fld, rec)\n if(theValue.Is(Number)) then\n theValue = theValue.SetFormat(\"dd\").AsString\n end\n tstr = tstr + theValue\n end\n \n ' CHECK TO SEE IF THE STRING IS ALREADY ON THE LIST. \n theCheck = strlist.FindByValue(tstr)\n \n ' IF NOT, DO THIS. \n if(theCheck = -1) then \n strlist.Add(tstr) \n tlist = List.Make\n for each fld in sumlist\n theValue = inVtab.ReturnValue(fld, rec) \n tlist.Add(theValue)\n end\n ulist.Add(tlist.DeepClone)\n tlist2 = List.Make\n for each fld in sumonlist\n theValue = inVtab.ReturnValue(fld, rec)\n tlist2.Add(theValue)\n end\n nlist.Add(tlist2.DeepClone)\n clist.Add(1)\n if((casename <> nil) and inEdit) then\n invtab.SetValue(theInputCaseField,rec,strlist.Count)\n end\n \n ' IF SO, DO THIS. \n else\n x = -1\n for each fld in sumonlist\n x = x + 1\n nlist.Get(theCheck).Set(x,(inVtab.ReturnValue(fld, rec) + nlist.Get(theCheck).Get(x)))\n end\n clist.Set(theCheck,(clist.Get(theCheck) + 1))\n if((casename <> nil) and inEdit) then\n invtab.SetValue(theInputCaseField,rec,theCheck + 1)\n end\n end \n \nend 'FOR EACH REC IN inVtab\n\n' END OF THE FIELD SUMMARIZE PROCESS\n\n'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''\n' BEGIN THE POST-EDITING CLEANUP AND CALCULATIONS. \n'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''\n\n' RESET THE INPUT TABLE SELECTION\ninVtab.SetSelection(t heOldSelRecs)\ninVtab.UpdateSelection\n\n' CLOSE THE OUTPUT VTAB AND MAKE IT VISIBLE.\noutTableName = outVTab.GetName\nif (av.GetProject.FindDoc(outTableName) <> Nil) then\n av.GetProject.RemoveDoc(av.GetProject.FindDoc(outTableName))\nend\noutTable = Table.Make(outVTab)\noutTable.SetName(outTableName)\noutTable.GetWin.Open\ninVtab.SetEditable(FALSE)\n\n' SORT THE STRING LIST, AND WRITE THE SUMMARY DATA FROM THE LISTS TO THE VTAB IN SORT ORDER.\nstrlistsort = strlist.DeepClone\nstrlistsort.Sort(TRUE)\nfor each i in 0.. (ulist.Count - 1)\n rec = outvtab.AddRecord\n theCheck = strlist.FindByValue(strlistsort.Get(rec))\n x = -1\n for each fld in sumlist\n x = x + 1\n theValue = ulist.Get(theCheck).Get(x)\n if(theValue.Is(Boolean)) then\n theValue = theValue.AsString\n end \n outvtab.SetValue(outvtab.FindField(fld.GetAlias),rec,theValue)\n end\n x = -1\n for each fld in sumonlist\n x = x + 1\n outvtab.SetValue(outvtab.FindField(\"Sum_\"+fld.GetName),rec,nlist.Get(theCheck).Get(x))\n end\n outvtab.SetValue( theCountField,rec,clist.Get(theCheck))\n if(casename <> nil) then\n outvtab.SetValue(theOutputCaseField,rec,theCheck+1)\n end \nend\n\n\n' CLOSE THE OUTPUT VTAB AND MAKE IT VISIBLE.\noutvtab.SetEditable(FALSE)\n\ntime2 = Date.Now.AsSeconds\ntottime = time2 - time1\n\n' OUTPUT TO AN XTOOLS LOG FILE:\ntheStr = \"MultiFieldSummarize\"+\" \"+inVtab.GetBaseTableFilename.AsString+\" \"+outvtab.GetBaseTableFilename.AsString+\" \"+\n\"[\"+Date.Now.AsString+\"] [\"+inVtab.GetNumRecords.AsString+\" records in \"+(sumlist.Count + su monlist.Count).AsString++\n\" summarize fields] [\"+tottime.AsString++\"secs]\"\nav.Run(\"aan.Sub-LogFile\", theStr)\nav.ShowMsg(theStr)" ) (Script.389 Name: "aanTable.MultiFieldDelete" SourceCode: "' Name: aanTable.MultiFieldDelete\n'\n' Title: Deletes Multiple Fields In A Table\n'\n' Topics: Editing a table\n'\n' Description: See the \"Shift click\" instructions below for a script description.\n'\n' Requires: The active document must be an editable table and the VTab must be editable.\n'\n' Self: \n'\n' Returns: \n\n'===========================================================\n\n' Check for the shift key, if the shift key is down, pop up instructions for using this script\n\nif (System.IsShiftKeyDown) then\n mess age =\n \" \"+nl+\n\"Delete Multiple Fields Instructions:\"+nl+nl+\n\"This script gives the user a list of fields to select from\"+nl+ \n\"and then deletes the selected fields. The script protects the shape field\"+nl+\n\"from deletion and requires that at least one other field be left in the\"+nl+\n\"table so that the FTab will not become undefined.\"+nl+nl+\n\"WARNING: this script acts directly on the active table, not on a copy. A\"+nl+\n\"delete confirmation routine is included, but once confirmed all deletion\"+nl+\n\"reques ts are final.\"+nl+nl+\n\"Requires: The active document must be an editable table and the VTab must\"+nl+\n\"be editable.\"+NL+NL+\n\"Script by Mike DeLaune, (Email: mike.g.delaune@state.or.us),\"+nl+\n\"Oregon Department of Forestry, 9/23/97.\"+nl+nl+\n\"Instructions:\"+nl+nl+\n\"1. Select the ''Delete Multiple Fields'' choice in the Table XTools menu.\"+nl+nl+\n\"2. In the first dialog box, select the fields you wish to delete using a \"+nl+\n\"single click to toggle selection, or click and drag for multiple selection.\"+nl+nl+\n \"3. In the second dialog box, confirm the deletion for each field, or press Yes To All.\"\n \n msgbox.report(message,\"Delete Multiple Fields\")\n \n Clipboard.The.Empty\n Clipboard.The.Add(message)\n Clipboard.The.Update\n \n MsgBox.Info(\"These instructions were copied to the system clipboard. To print them, open a text editor\"++\n \"(like notepad), paste in the contents of the clipboard, and print them from the text editor.\",\"PRINT INSTRUCTIONS\")\n\n return nil\nend\n\n'''''''''''''''''''''''''''''''''' ''''''''''''''''''''''''\n' Ask for User input:\n'''''''''''''''''''''''''''''''''''''''''''''''''''''''''' \n\n' Get the table\ntheFtab = av.GetActiveDoc\n\n' Stops script if the active document is not a table.\nif(theFtab.is(table).not) then\n msgbox.error(\"A table document must be active, bailing.\",\"Error\")\n exit\nend\n\n' Get the Vtab\ntheVTab = theFtab.GetVtab\n\n' Check to see if the VTab is editable:\nif (theVtab.CanEdit.Not) then\n msgbox.error(\"The table is not editable, bailing.\",\"Error\")\n exit\nend\n\n' Stop s editing if currently editing, then restarts.\nif (theVTab.IsBeingEditedWithRecovery) then\n theVtab.StopEditingWithRecovery(true)\nend\n theVTab.StartEditingWithRecovery\n\n' Get the list of fields.\nvfList = theVTab.GetFields\nflist = List.Make\n\n' Make a new list without the shape field.\nfor each fld in vfList\n if ((fld.GetName = \"Shape\").Not) then\n flist.Add(fld)\n end\nend \n\n \n' END OF THE INITIAL SETUP\n\n''''''''''''''''''''''''''''''''''''''''''''''''''''''''''\n' Ask for User input:\n' ''''''''''''''''''''''''''''''''''''''''''''''''''''''''' \n\n' Ask the user which fields to delete.\nsellist = Msgbox.MultiList(fList,\"Select Fields To Delete\"+nl+\"(single click to toggle selection,\"+nl+\n\" click and drag for multiple selection)\",\"Multiple Field Delete\")\n\n' Check to see if some fields were selected, bail if not:\nif ((nil = sellist) or (sellist.count = 0)) then\n msgbox.info(\"No fields were selected for deletion, bailing.\",\"Process Status\")\n theVTab.StopEditingWithRecovery(true)\n exit\nend\n\n\n ' Confirm deletion request\ndellist = list.make\nyn = true\nfor each f in sellist\n if(yn <> nil) then\n yn = Msgbox.AllYesNo(\"Do you want to delete this field: \"\n ++f.AsString,\"Delete Confirmation\",true)\n end \n \n' Shape field deletion not allowed, otherwise add the field to the deletion list if confirmed:\n if(f.AsString = \"shape\") then\n Msgbox.Error(\"Shape field deletion not allowed.\",\"User attempted to delete shape field\")\n elseif((yn = true) or (yn = nil)) then\n dellist.add(f)\n end\nend 'e nd the for each\n\n' END OF USER INPUT.\n\n'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''\n' Begin the deletion process\n'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''\ntime1 = Date.Now.AsSeconds \ninitialFields = theVtab.GetFields.Count\n\n' Must retain at least one field in addition to shape:\nif((fList.count) = dellist.count) then\n msgbox.error(\"Removing all fields except 'Shape' will make the FTab undefined, bailing.\",\n \"RETAIN SHAPE FIELD + ONE OTHER FIELD\")\n theVTab.St opEditingWithRecovery(true)\n exit\nend \n \n' Remove the fields\nif (dellist.count > 0) then\n theVtab.RemoveFields(dellist)\nend\n\nendFields = theVtab.GetFields.Count\nremovedFields = initialFields - endFields\n\n\n\n' END OF THE FIELD DELETION PROCESS\n\n'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''\n' Begin the post-editing cleanup and calculations. \n'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''\n\n' Commit the changes and stop editing\"\ntheVtab.Flush\ntheVTab.StopEditingWithRecover y(true)\n\ntime2 = Date.Now.AsSeconds\ntottime = time2 - time1\n\n' OUTPUT TO AN XTOOLS LOG FILE:\ntheStr = \"MultiFieldDelete\"+\" \"+theVtab.GetBaseTableFilename.AsString+\" \"+\"[\"+Date.Now.AsString+\"] [\"+\nremovedFields.AsString+\" fields removed.] [\"+tottime.AsString++\"secs]\"\nav.Run(\"aan.Sub-LogFile\", theStr)\nav.ShowMsg(theStr)" ) (Script.390 Name: "aanTable.CalcSize" SourceCode: "' Name: aanTable.CalcSize\n' \n' Title: Calculate Area, Perimeter , Length & Acres / Hectares\n' \n' Topics: GeoData\n'\n' Description: See the \"Shift click\" instructions below for a script description.\n'\n' Requires: The User must have write access to the table.\n'\n' Self:\n'\n' Returns:\n'===========================================================\n\n' Check for the shift key, if the shift key is down, pop up instructions for using this script\n\nif (System.IsShiftKeyDown) then\n message =\n \" \"+nl+\n \"Inst ructions for Calculate Area, Perimeter , Length & Acres / Hectares:\"+nl+nl+\n \"This script calculates the area, perimeter, acres and/or hectares for polygon feature tables, and length\"+nl+\n \"for line feature tables. Calculations are based on the user specifications set in the XTools Defaults dialog.\"+nl++nl+\n \"The script makes the appropriate calculations based on the feature type.\"+nl+nl+\n \"The script will add the fields: Area, Perimeter, and Acres and/or Hectares to polygon feature tables; and Length \"+nl+\n \"to polyline feature tables if the fields do not exist. If the fields exist, their values will be recalculated.\"+nl+nl+\n \"If a table was open for editing when the script began running, the table will be left open for editing\"+nl+\n \"when the script completes.\"+nl++nl+\n \"The script was written by Mike DeLaune, (Email: mike.g.delaune@state.or.us),\"+nl+\n \"Oregon Department of Forestry on April 13, 2000.\"+nl+nl+\n \"Requires: The User must have write access to the table. Calls the aan.Sub-CalcSize s cript. \"+nl+nl+\n \"Instructions:\"+nl+nl+\n \"1. Set the XTools Defaults. The Defaults dialog can be called from XTools menus in the Project, View, \"+nl+\n \"and Table windows.\"+nl++nl+\n \"2. Select the Calculate Area, Perimeter , Length & Acres / Hectares XTools menu option.\"\n \n msgbox.report(message,\"Recalculate Area, Perimeter , Length & Acres / Hectares Instructions\")\n \n Clipboard.The.Empty\n Clipboard.The.Add(message)\n Clipboard.The.Update\n \n MsgBox.Info(\"These instructions were copie d to the system clipboard. To print them, open a text editor\"++\n \"(like notepad), paste in the contents of the clipboard, and print them from the text editor.\",\"PRINT INSTRUCTIONS\")\n \n exit\nend\n\n''''''''''''''''''''''''''''''''''''''''''''''''''''''''''\n' BEGIN INITIAL SETUP:\n'''''''''''''''''''''''''''''''''''''''''''''''''''''''''' \n\ntime1 = Date.Now.AsSeconds\n\ntheTable = av.GetActiveDoc\ntheSrc = theTable.GetVTab\ntheSelRecNum = theSrc.GetSelection.Count.AsString\nif(theSelRecNum = \"0\") then\n theSelRe cNum = \"all\"\nend\nav.Run(\"aan.Sub-CalcSize\", {theSrc} )\n\ntime2 = Date.Now.AsSeconds\ntottime = time2 - time1\n\n' OUTPUT TO AN XTOOLS LOG FILE:\ntheStr = \"TableCalcSize\"+\" \"+theSrc.GetBaseTableFilename.AsString+\" \"+\"[\"+Date.Now.AsString+\"] [\"+\ntheSelRecNum+\" records calculated.] [\"+tottime.AsString++\"secs]\"\nav.Run(\"aan.Sub-LogFile\", theStr)\nav.ShowMsg(theStr)" ) (Script.391 Name: "aanTable.Av2Excel" SourceCode: "' Name: aanTable.Av2Excel\n'\n' Title: Export Table to Excel Spreadsheet\n'\n' Topics: Misc, Tables\n'\n' Description: See the \"Shift click\" instructions below for a script description.\n'\n' Requires: Microsoft Excel installed or accessible. The active document must be a Table.\n'\n' Self: Not Applicable\n'\n' Returns: Not Applicable.\n'===========================================================\n\n' Check for the shift key, if the shift key is down, pop up instructions for using this script\n\nif (System.IsShiftKe yDown) then\n message =\n \" \"+nl+\n \"Instructions For the Export Table to Excel Spreadsheet script:\"+nl+nl+\n \"This script starts Excel, creates a DDE link between ArcView and Excel, and\"+nl+\n \"copies specified fields and selected rows from an ArcView Table to an Excel spreadsheet.\"+nl+ \n \"WARNING, DDE is a slow way to move data since each cell is sent individually. If you have a \"+nl+\n \"large amount of data to move to Excel, it is quicker to open Excel and access the shapefile.dbf\"+nl+\n \"file direc tly. A more detailed description of DDE follows the instructions.\"+nl+nl+\n \"This an ESRI sample script modified by Mike DeLaune to improve the user interface.\"+nl+\n \"(Email: mike.g.delaune@state.or.us), Oregon Department of Forestry 10/23/97.\"+nl+nl+\n \"Instructions:\"+nl+nl+\n \"1. If you wish to export only some of the records in the Table, select the records you wish \"+nl+\n \"to export BEFORE starting this script. If no records are selected, ALL records in the table \"+nl+\n \"will be exported.\"+nl+nl+\n \"2. The first time you run the script, a dialog will appear asking you for the location of your \"+nl+\n \"excel.exe program file. Navigate to the directory location that Excel resides, and double click \"+nl+\n \"on the name excel.exe. The script will store the path to Excel in a file named exelpath.txt \"+nl+\n \"located in your $HOME subdirectory. As long as the location of Excel does not change, you will \"+nl+\n \"not be asked this question again.\"+nl+nl+ \n \"3. You will be asked to select the fields th at you wish to export to Excel.\"+nl+nl+\n \"4. The program will then begin sending data to Excel. Use the STOP button, if necessary.\"+nl+nl+\n \"DDE Description: DDE (Microsoft's Dynamic Data Exchange) provides a mechanism for transferring\"+nl+\n \"data between applications. A DDE exchange is called a conversation. In a conversation the \"+nl+\n \"client application initiates requests and the server application responds. The conversation \"+nl+\n \"is identified by the server name and a topic name. The serve r name is usually the name of the\"+nl+\n \"application itself. Most applications support the SYSTEM topic name. The ArcView DDEClient\"+nl+\n \"can initiate one of several standard transactions; EXECUTE, REQUEST, and POKE.\"+nl+nl+\n \"In this script the ArcView DDEClient establishes a conversation with an Excel server using the\"+nl+\n \"SYSTEM topic. The ArcView client uses EXECUTE to create a new spreadsheet, REQUEST to get \"+nl+\n \"information about the spreadsheet, and POKE to populate the spreadsheet with information from \"+nl+\n \"the selected rows using the contents of the specified fields. Though this example uses Excel, \"+nl+\n \"other applications may have similar DDE functionality.\"+nl\n\n msgbox.report(message,\"Export Table to Excel Spreadsheet Instructions\")\n\n Clipboard.The.Empty\n Clipboard.The.Add(message)\n Clipboard.The.Update\n \n MsgBox.Info(\"These instructions were copied to the system clipboard. To print them, open a text editor\"++\n \"(like notepad), paste in the contents of the clipboard, a nd print them from the text editor.\",\"PRINT INSTRUCTIONS\")\n\n return nil\nend\n\n\n''''''''''''''''''''''''''''''''''''''''''''''''''''''''''\n' BEGIN INITIAL SETUP:\n'''''''''''''''''''''''''''''''''''''''''''''''''''''''''' \n'''''''''''''''''''''''''''''''''''''''''''''''''''''''''' \n\n' CHECK TO SEE IF THE OS IS WINDOWS.\ntheOS = System.GetOS\nif(theOS <> #SYSTEM_OS_MSW) then\n MsgBox.Warning(\"Sorry, this tool uses Microsoft's Dynamic Data Exchange (DDE) to communicate with Excel. DDE is not available to\"+\n \" non-Windows users.\",\"\")\n exit\nend\n\n' GET THE ACTIVE DOCUMENT, WHICH SHOULD BE A TABLE. BAIL IF NOT A TABLE:\ntheTable = av.GetActiveDoc\nif (theTable.Is(Table).Not) then\n MsgBox.Error(\"This script must be run from a table. Exiting\",\"Error\")\n return nil\nend\n\n' MAKE A SCRIPT THAT MAKES A DDECLIENT. THE DDECLIENT MUST BE MADE ON THE FLY FROM A SCRIPT FOR COMPATIBILITY WITH NON-WINDOWS \n' OPERATION SYSTEMS. IF WE DON'T DO THIS, THEN AN ERROR MESSAGE OCCURS WHEN XTOOLS IS LOADED.\ntheScript = Script.Make( \"theClient = DDEClient.Make( SELF.Get(0), SELF.Get(1))\")\n\n\n'===========================================================\n\n' CHECK $HOME FOR A TEXT FILE NAMED EXELPATH.TXT CONTAINING THE PATH TO EXCEL. IF NOT THERE, \n' ASK THE USER WHERE EXCEL IS LOCATED, THEN MAKE AND STORE A FILE NAMED EXELPATH.TXT\n\n' CHECK FOR THE EXISTENCE OF THE FILE NAMED EXELPATH.TXT:\nthePathFileName = Filename.Make(\"$HOME/exelpath.txt\").GetFullName.AsFilename\nthePathFileExists = File.Exists(thePathFileName)\n\n' IF EXELPATH.TXT EXISTS , OPEN IT, AND READ THE PATH TO EXCEL:\nif (thePathFileExists = true) then\n thePathFile = LineFile.Make(thePathFileName, #FILE_PERM_MODIFY)\n theRecord = thePathFile.ReadElt\n if(theRecord.Contains(\"excel.exe\")) then\n theExcelFile = Filename.Make(theRecord)\n theExcelFileExists = File.Exists(theExcelFile)\n else \n theExcelFileExists = false\n end\n thePathFile.Close \nend\n\n' IF EITHER FILE IS MISSING OR IN THE WRONG LOCATION, GET THE CORRECT LOCATION AND MAKE A NEW PATH FILE:\nif ((thePathFileExists = false) or (theExcelFileExists = false)) then\n theExcelFile = FileDialog.Show(\"excel.exe\",\"Excel Program\", \"Navigate to the location where Excel resides.\")\n if(theExcelFile = nil) then exit end\n theExcelFileExists = File.Exists(theExcelFile)\n thePathFile2 = LineFile.Make(thePathFileName, #FILE_PERM_CLEARMODIFY)\n thePathFile2.WriteElt(theExcelFile.GetName)\n thePathFile2.Close\nend \n\nav.PurgeObjects\n\n' START THE MICROSOFT EXCEL PROGRAM\nif (theExcelFileExists = true) then\n system.Execute(theExcelFile.A sString)\nelse\n exit\nend\n\n' CREATE THE ARCVIEW DDECLIENT. THIS INITIATES THE EXCEL CONVERSATION. VERIFY THAT THERE ARE NO ERRORS.\nsystemClient = theScript.DoIt({\"Excel\", \"System\"})\nif (systemClient.HasError) then\n MsgBox.error( systemClient.GetErrorMsg, \"\")\n return nil\nend\n\n' GET THE NAME OF THE NEW WORKSHEET. SELECTION IS AN EXCEL ITEM SUPPORTED FOR THE SYSTEM TOPIC.\nselection = systemClient.Request( \"Selection\" )\nspreadsheet = selection.Left( selection.IndexOf(\"!\"))\n\n' GET THE APPROPRIATE ROW AND COL UMN LETTERS FOR THE USER'S LANGUAGE VERSION OF EXCEL.\nrowLet = selection.Right(4).Middle(0,1)\ncolLet = selection.Right(4).Middle(2,1)\n\n' ENSURE R1C1 FORMAT\nsystemClient.Execute( \"[Workspace(,,TRUE)]\" )\n\n' OPEN A NEW CONVERSATION WITH THE EXCEL SPREADSHEET AS THE TOPIC\nssClient = theScript.DoIt({\"Excel\", spreadsheet})\n\n' GET TABLE INFORMATION FOR LATER USE \ntableName = theTable.GetName\ntheVTab = theTable.GetVTab\ntheFields = theVTab.GetFields\n\n' WRITE THE TABLE NAME TO THE SPREADSHEET\nrow = 1\ncolumn = 1\n ssClient.Poke( rowLet+row.AsString+colLet+column.AsString, tableName )\n\n' CHECK TO SEE IF THE PREVIOUS POKE WORKED PROPERLY. BAIL IF IT DOESN'T.\ntheReturn = ssClient.Request(rowLet+row.AsString+colLet+column.AsString)\ntheReturn = theReturn.Left(tableName.Count)\n\nif(theReturn <> tablename) then\n MsgBox.Error(\"Xtools could not write to the Excel spreadsheet. The spreadsheet may not accept \"+\n rowLet+row.AsString+colLet+column.AsString+\" format. Bailing!\",\"DDE POKE request failed!\")\n systemClient.Execut e( \"[Workspace(,,FALSE)]\" )\n systemClient.Close\n ssClient.Close\n av.PurgeObjects\n exit\nend\n\n' END OF THE INITIAL SETUP\n\n''''''''''''''''''''''''''''''''''''''''''''''''''''''''''\n' ASK FOR USER INPUT:\n''''''''''''''''''''''''''''''''''''''''''''''''''''''''''\n\n' SAVE THE CURRENT SELECTION\noldSelRecs = theVtab.GetSelection.Clone \n\n' SET THE SELECTION. USE SELECTED RECORDS IF THERE ARE ANY, OTHERWISE ITERATE THROUGH THE ENTIRE FTAB...\nif (theVtab.GetSelection.Count > 0) then\n SelRecs = theVtab.GetSel ection\nelse\n SelRecs = theVtab.GetSelection\n SelRecs.SetAll\nend\nSelRecNum = SelRecs.Count\n\n' ASK THE USER WHICH FIELDS TO INCLUDE:\nfieldlist = Msgbox.MultiList(theFields,\"Select Fields To Export\"+nl+\"(single click to toggle selection,\"+nl+\n\" click and drag for multiple selection)\",\"EXPORT \"+SelRecNum.AsString+\" RECORDS TO EXCEL\")\nif (fieldlist= nil) then exit end\n\n' END OF USER INPUT.\n\n'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''\n' BEGIN THE EXPORT PROCESS\n''''''''''''''''''''''''''' ''''''''''''''''''''''''''''''''''''\ntime1 = Date.Now.AsSeconds\nav.ShowMsg(\"Exporting to Excel ...\")\n\n' WRITE CHOSEN FIELD NAMES TO THE SPREADSHEET\nrow = 2\ncolumn = 0\nfor each f in fieldList\n column = column + 1\n ssClient.Poke( rowLet+row.AsString+colLet+column.AsString, f.GetName )\nend \n\n\n' WRITE THE VALUES FOR SELECTED FEATURES TO SPREADSHEET\ncurrentrec = 0 \nav.ShowStopButton\ntotalrec = SelRecs.Count\n\nfor each rec in SelRecs\n\n ' SHOW PROGRESS ROUTINE:\n currentrec = currentrec + 1\n progre ss = (currentrec / totalrec) * 100\n proceed = av.SetStatus( progress )\n if (proceed.Not) then\n av.ShowMsg( \"Stopped\" )\n av.ClearStatus\n theVtab.setselection(oldSelRecs)\n theVtab.updateselection\n av.PurgeObjects\n exit\n end\n\n row = row + 1\n column = 0\n for each f in fieldList\n column = column + 1\n\n if (f.IsTypeShape) then\n dataString = \"Shape\" \n else \n dataString = theVTab.ReturnValueString( f, rec)\n if(datastring.Count = 0) then\n datastring = \" \"\n end \n x = 0\n end \n\n ssClient.Poke( rowLet+row.AsString+colLet+column.AsString, dataString )\n end\nend\n\n\n' END OF THE EXPORT TO EXCEL PROCESS\n\n'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''\n' BEGIN THE POST-EXPORT CLEANUP. \n'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''\n\ntheVtab.setselection(oldSelRecs)\ntheVtab.updateselection\nav.PurgeObjects\nav.ClearStatus \n\nssClient.Close\n\n' RESET THE WORKSPACE TO ALPHABETIC COLUMNS:\nsystemClient.Execute( \"[W orkspace(,,FALSE)]\" )\nsystemClient.Close\n\ntime2 = Date.Now.AsSeconds\ntottime = time2 - time1\n\n' OUTPUT TO AN XTOOLS LOG FILE:\ntheStr = \"Av2Excel\"+\" \"+theVtab.GetBaseTableFilename.AsString+\" \"+\"[\"+Date.Now.AsString+\"] [\"+\nselRecNum.AsString+\" records transfered.] [\"+tottime.AsString++\"secs]\"\nav.Run(\"aan.Sub-LogFile\", theStr)\nav.ShowMsg(theStr)" ) (AVDLog.392 Name: "XTMessages" X: 236 Y: 69 W: 442 H: 275 Server: 393 ControlPanel: 394 Title: "XTools Overay Operation In Progress..." EscapeEnabled: 1 Resizable: 1 AlwaysOnTop: 1 HasTitleBar: 1 Closeable: 1 DefaultButton: 405 ) (Nil.393 ) (CPanel.394 Child: 395 Child: 396 Child: 397 Child: 398 Child: 399 ResBox: 400 ResBox: 401 ResBox: 402 ResBox: 403 ResBox: 404 Listening: 1 ) (TextBox.395 InternalName: "xtstopop" Listening: 1 ReadOnly: 1 Text: "To Stop a running XTools Overlay Operation, delete the following file:" Label: "How to stop the batch operation:" Constraints: 0x55 NextControl: 393 ) (TextLabel.396 InternalName: "xtproc" Tag: " " Constraints: 0x55 Label: "xtproc" Listening: 1 ) (TextLabel.397 InternalName: "xtop" Constraints: 0x55 Label: "xtop" Listening: 1 ) (TextLabel.398 InternalName: "xtinput" Constraints: 0x55 Label: "xtinput" Listening: 1 ) (TextLabel.399 InternalName: "xtover" Constraints: 0x55 Label: "xtover" Listening: 1 ) (RectD.400 Left: 55.00000000000000 Top: 248.00000000000000 Right: 375.00000000000000 Bottom: 115.00000000000000 ) (RectD.401 Left: 48.00000000000000 Top: 49.00000000000000 Right: 376.00000000000000 Bottom: 26.00000000000000 ) (RectD.402 Left: 48.00000000000000 Top: 75.00000000000000 Right: 376.00000000000000 Bottom: 53.00000000000000 ) (RectD.403 Left: 48.00000000000000 Top: 92.00000000000000 Right: 376.00000000000000 Bottom: 69.00000000000000 ) (RectD.404 Left: 48.00000000000000 Top: 109.00000000000000 Right: 376.00000000000000 Bottom: 86.00000000000000 ) (Nil.405 ) (AVDLog.406 Name: "XTDefaults" X: 104 Y: 157 W: 595 H: 497 ConstrainedControlNames: 407 ConstrainedControlNames: 408 ConstrainedControlNames: 409 ConstrainedControlNames: 410 Constraints: 411 Constraints: 412 Constraints: 413 Constraints: 414 Server: 415 ControlPanel: 416 Title: "XTools Defaults (Version 6/1/2001)" Resizable: 1 AlwaysOnTop: 1 HasTitleBar: 1 DefaultButton: 441 ) (AVStr.407 S: "theSetProjectionButton" ) (AVStr.408 S: "XTdefaultsButton" ) (AVStr.409 S: "theCloseButton" ) (AVStr.410 S: "HelpButton" ) (Numb.411 N: 85.00000000000000 ) (Numb.412 N: 85.00000000000000 ) (Numb.413 N: 85.00000000000000 ) (Numb.414 N: 85.00000000000000 ) (Nil.415 ) (CPanel.416 Child: 417 Child: 418 Child: 419 Child: 420 Child: 421 Child: 422 Child: 424 Child: 425 Child: 426 Child: 427 Child: 428 Child: 429 Child: 430 Child: 431 Child: 433 Child: 434 Child: 435 Child: 436 Child: 437 Child: 438 Child: 439 Child: 440 Child: 441 Child: 442 Child: 443 ResBox: 444 ResBox: 445 ResBox: 446 ResBox: 447 ResBox: 448 ResBox: 449 ResBox: 450 ResBox: 451 ResBox: 452 ResBox: 453 ResBox: 454 ResBox: 455 ResBox: 456 ResBox: 457 ResBox: 458 ResBox: 459 ResBox: 460 ResBox: 461 ResBox: 462 ResBox: 463 ResBox: 464 ResBox: 465 ResBox: 466 ResBox: 467 ResBox: 468 Listening: 1 ) (TextLabel.417 InternalName: "MapUnitsTextLabel" Constraints: 0x55 Label: "1. Specify the map units of your data:" Listening: 1 ) (TextLabel.418 InternalName: "ViewDistanceUnitsLabel" Constraints: 0x55 Label: "3. Specify the desired default View distance units:" Listening: 1 ) (TextLabel.419 InternalName: "ProjectionLabel" Constraints: 0x55 Label: "VIEW DEFAULT PROJECTION NOT SET." Listening: 1 ) (TextLabel.420 InternalName: "AreaOutputsLabel" Constraints: 0x55 Label: "4. Specify the desired units for area outputs:" Listening: 1 ) (TextLabel.421 InternalName: "ViewMapUnitsLabel" Constraints: 0x55 Label: "2. Specify the desired output map units:" Listening: 1 ) (AVIBox.422 InternalName: "aIconBox1" Constraints: 0x55 Icon: 423 Listening: 1 ) (AVIcon.423 Name: "xtoolsdefaults.bmp" Data: 4e442049 6d616765 00010170 001b0000 Data: 1368eeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeee0 Data: 0000eee0 0000eeee eeeeee00 00eeeeee Data: eeeeeee0 0000000e eeeeeeee eee00000 Data: 000eeeee eeeee000 0000000e eeeeeee0 Data: 0000000e eeeeeeee eeeeee00 0000000e Data: eeeeeeee e0000000 000eeeee eee00000 Data: eeeeeeee eee00000 eee00000 eeeeeeee Data: e0000000 0eeeeeee eee00000 00000eee Data: eeeeeee0 000eeeee eeeeeee0 0000000e Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeee0 0000eee0 0000eeee Data: eeeeee00 00eeeeee eeeeeee0 0000000e Data: eeeeeeee eee00000 000eeeee eeeee000 Data: 0000000e eeeeeee0 0000000e eeeeeeee Data: eeeeee00 0000000e eeeeeeee e0000000 Data: 000eeeee eee00000 eeeeeeee eee00000 Data: eee00000 eeeeeeee e0000000 0eeeeeee Data: eee00000 00000eee eeeeeee0 000eeeee Data: eeeeeee0 0000000e eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: e0000ee0 000eeeee eeeeee00 000eeeee Data: eeeeee00 00000000 eeeeeeee ee000000 Data: 0000eeee eeeeee00 0000000e eeeeeee0 Data: 00000000 eeeeeeee eeeeeee0 00000000 Data: eeeeeeee ee000000 0000eeee eeee0000 Data: eeeeeeee eeee0000 eee00000 eeeeeeee Data: 00000000 00eeeeee eeee0000 00000eee Data: eeeeeee0 0000eeee eeeeeee0 00000000 Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee ee000000 000eeeee Data: eeeeeee0 000eeeee eeeeee00 000e0000 Data: 0eeeeeee ee00000e 00000eee eeeeee00 Data: 0000000e eeeeeee0 000ee000 0eeeeeee Data: eeeeeee0 000e0000 0eeeeeee ee0000ee Data: eeeeeeee eeee0000 eeeeeeee eeeee000 Data: 00000000 eeeeeeee 00000e00 000eeeee Data: eeee0000 00000eee eeeeeeee 0000eeee Data: eeeeeee0 000ee000 0eeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: ee000000 000eeeee eeeeeee0 000eeeee Data: eeeeee00 000e0000 0eeeeeee ee00000e Data: 00000eee eeeeee00 0000000e eeeeeee0 Data: 000ee000 0eeeeeee eeeeeee0 000e0000 Data: 0eeeeeee ee0000ee eeeeeeee eeee0000 Data: eeeeeeee eeeee000 00000000 eeeeeeee Data: 00000e00 000eeeee eeee0000 00000eee Data: eeeeeeee 0000eeee eeeeeee0 000ee000 Data: 0eeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eee00000 000eeeee Data: eeeeeee0 000eeeee eeeeee00 00eee000 Data: 00eeeeee ee0000ee e00000ee eeeeee00 Data: 000eeeee eeeeeee0 000ee000 0eeeeeee Data: eeeeeee0 0000ee00 00eeeeee ee00000e Data: eeeeeeee eeee0000 0eeeeeee eeeee000 Data: 00000000 eeeeeeee 00000ee0 000eeeee Data: eeee0000 0eeeeeee eeeeeeee 0000eeee Data: eeeeeee0 000ee000 0eeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeee000 00eeeeee eeeeeeee 0000eeee Data: eeeeeee0 000eee00 000eeeee eee0000e Data: ee00000e eeeeeee0 000eeeee eeeeeeee Data: e0000000 0eeeeeee eeeeeeee 0000eee0 Data: 000eeeee eee00000 0000eeee eeeee000 Data: 00000eee eeeeeee0 0000000e eeeeeeee Data: e0000eee 0000eeee eeeee000 0eeeeeee Data: eeeeeeee e0000eee eeeeeeee e0000000 Data: 0eeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeee000 00eeeeee Data: eeeeeeee 0000eeee eeeeeee0 000eee00 Data: 000eeeee eee0000e ee00000e eeeeeee0 Data: 000eeeee eeeeeeee e0000000 0eeeeeee Data: eeeeeeee 0000eee0 000eeeee eee00000 Data: 0000eeee eeeee000 00000eee eeeeeee0 Data: 0000000e eeeeeeee e0000eee 0000eeee Data: eeeee000 0eeeeeee eeeeeeee e0000eee Data: eeeeeeee e0000000 0eeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeee0000 000eeeee eeeeeeee 0000eeee Data: eeeeeee0 000eeee0 000eeeee eee0000e Data: eee0000e eeeeeee0 0000eeee eeeeeeee Data: 00000000 eeeeeeee eeeeeeee 00000ee0 Data: 000eeeee eee00000 00000eee eeeee000 Data: 000000ee eeeeeeee 0000000e eeeeeeee Data: e00000ee 00000eee eeeee000 00eeeeee Data: eeeeeeee e0000eee eeeeeeee 00000000 Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeee0000 0000eeee Data: eeeeeeee 00000eee eeeeeee0 0000eee0 Data: 000eeeee eee00000 eee0000e eeeeeeee Data: 0000eeee eeeeeeee 00000eee eeeeeeee Data: eeeeeeee e0000ee0 000eeeee eeee0000 Data: eeeeeeee eeeeee00 00eeeeee eeeeeeee Data: 0000000e eeeeeeee ee0000ee e0000eee Data: eeeeee00 00eeeeee eeeeeeee e00000ee Data: eeeeeeee 00000eee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeee0000 0000eeee eeeeeeee 00000eee Data: eeeeeee0 0000eee0 000eeeee eee00000 Data: eee0000e eeeeeeee 0000eeee eeeeeeee Data: 00000eee eeeeeeee eeeeeeee e0000ee0 Data: 000eeeee eeee0000 eeeeeeee eeeeee00 Data: 00eeeeee eeeeeeee 0000000e eeeeeeee Data: ee0000ee e0000eee eeeeee00 00eeeeee Data: eeeeeeee e00000ee eeeeeeee 00000eee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeee0000 00000eee Data: eeeee000 00000000 eeeeeeee 00000000 Data: 000eeeee eeee0000 0000000e eeeeeeee Data: 0000eeee eeeeeeee e0000e00 000eeeee Data: eeeeeeee e0000000 000eeeee eeee0000 Data: 000000ee eeeeee00 0000000e eeeeeeee Data: e000000e eeeeeeee ee0000ee e0000eee Data: eeeeee00 00eeeeee eeeeee00 00000000 Data: 0eeeeeee e0000e00 000eeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eee00000 e00000ee eeeeee00 00000000 Data: 0eeeeeee e0000000 000eeeee eeeee000 Data: 0000000e eeeeeeee 00000eee eeeeeeee Data: ee000000 00eeeeee eeeeeeee e0000000 Data: 000eeeee eeee0000 000000ee eeeeee00 Data: 0000000e eeeeeeee ee00000e eeeeeeee Data: ee00000e e00000ee eeeeee00 000eeeee Data: eeeeeee0 00000000 00eeeeee ee000000 Data: 00eeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eee00000 e00000ee Data: eeeeee00 00000000 0eeeeeee e0000000 Data: 000eeeee eeeee000 0000000e eeeeeeee Data: 00000eee eeeeeeee ee000000 00eeeeee Data: eeeeeeee e0000000 000eeeee eeee0000 Data: 000000ee eeeeee00 0000000e eeeeeeee Data: ee00000e eeeeeeee ee00000e e00000ee Data: eeeeee00 000eeeee eeeeeee0 00000000 Data: 00eeeeee ee000000 00eeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eee00000 ee00000e eeeeee00 00000000 Data: 0eeeeeee eee00000 0eeeeeee eeeeeee0 Data: 00000eee eeeeeeee e0000eee eeeeeeee Data: eee00000 00eeeeee eeeeeeee ee000000 Data: 0eeeeeee eeeee000 0000000e eeeeeee0 Data: 00000000 eeeeeeee ee00000e eeeeeeee Data: eee0000e ee0000ee eeeeeee0 000eeeee Data: eeeeeee0 00000000 00eeeeee eee00000 Data: 00eeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeeeeeee eeeeeeee Data: eeeeeeee eeeeeeee eeee0000 00400000 Data: 00000000 80000080 00000080 80008000 Data: 00008000 80008080 0000c0c0 c0008080 Data: 80000000 ff0000ff 000000ff ff00ff00 Data: 0000ff00 ff00ffff 0000ffff ff000002 Data: 00040007 00200001 00020000 00000000 Data: 0000 ) (TextLabel.424 InternalName: "SpheroidLabel" Constraints: 0x55 Label: " " Listening: 1 ) (TextLabel.425 InternalName: "OverlayConvertTextLabel" Constraints: 0x55 Label: "5. Always convert overlay (CLIP, INTERSECT, etc.) " Listening: 1 ) (TextLabel.426 InternalName: "OverlayConvertTextLabel2" Constraints: 0x55 Label: "output shapes to single part.?" Listening: 1 ) (TextLabel.427 InternalName: "AreaCalcTextLabel" Constraints: 0x55 Label: "6. Always calculate Area, Perimeter, Acres " Listening: 1 ) (TextLabel.428 InternalName: "AreaCalcTextLabel2" Constraints: 0x55 Label: "(Hectares), Length?" Listening: 1 ) (TextLabel.429 InternalName: "lblNoViewWarning" Constraints: 0x55 Label: "7. Do NOT show View Properties and XTools Defaults when \n creating a new View." Listening: 1 ) (TextLabel.430 InternalName: "lblNoDefaults Warning" Constraints: 0x55 Label: "8. Do NOT show the XTools Defaults Dialog when the XTools \n Extension loads.\n" Listening: 1 ) (AVCBBox.431 InternalName: "MapUnitsComboBox" Update: "XTdefaults.Projection" NextControl: 415 ContentKind: 4 Value: 432 Constraints: 0x55 Listening: 1 ) (AVStr.432 S: "Nothing" ) (AVCBBox.433 InternalName: "ViewMapUnitsComboBox" NextControl: 415 ContentKind: 4 Value: 432 Constraints: 0x55 Listening: 1 ) (AVCBBox.434 InternalName: "DistanceUnitsComboBox" NextControl: 415 ContentKind: 4 Constraints: 0x55 Listening: 1 ) (AVCBBox.435 InternalName: "AreaComboBox" NextControl: 415 ContentKind: 4 Constraints: 0x55 Listening: 1 ) (AVCBBox.436 InternalName: "OverlayConvertComboBox" NextControl: 415 ContentKind: 4 Constraints: 0x55 Listening: 1 ) (AVCBBox.437 InternalName: "AreaCalcComboBox" NextControl: 415 ContentKind: 4 Constraints: 0x55 Listening: 1 ) (AVCBox.438 InternalName: "cbNewViewWarn" Listening: 1 Constraints: 0x55 ) (AVCBox.439 InternalName: "cbXTdefaultsWarn" Listening: 1 Constraints: 0x55 ) (LButn.440 InternalName: "theSetProjectionButton" Label: "9. Set Projection" Click: "XTdefaults.Projection" ) (LButn.441 InternalName: "XTdefaultsButton" Label: "Save Defaults" Click: "XTdefaults.Update" ) (LButn.442 InternalName: "theCloseButton" Label: "Close" Click: "XTdefaults.Close" ) (LButn.443 InternalName: "HelpButton" Label: "Help" Click: "XTdefaults.Help" ) (RectD.444 Left: 8.00000000000000 Top: 79.00000000000000 Right: 374.00000000000000 Bottom: 60.00000000000000 ) (RectD.445 Left: 8.00000000000000 Top: 158.00000000000000 Right: 375.00000000000000 Bottom: 137.00000000000000 ) (RectD.446 Left: 16.00000000000000 Top: 462.00000000000000 Right: 481.00000000000000 Bottom: 442.00000000000000 ) (RectD.447 Left: 8.00000000000000 Top: 201.00000000000000 Right: 374.00000000000000 Bottom: 179.00000000000000 ) (RectD.448 Left: 8.00000000000000 Top: 117.00000000000000 Right: 376.00000000000000 Bottom: 98.00000000000000 ) (RectD.449 Left: 53.00000000000000 Top: 44.00000000000000 Right: 485.00000000000000 Bottom: 13.00000000000000 ) (RectD.450 Left: 16.00000000000000 Top: 484.00000000000000 Right: 481.00000000000000 Bottom: 464.00000000000000 ) (RectD.451 Left: 8.00000000000000 Top: 240.00000000000000 Right: 378.00000000000000 Bottom: 222.00000000000000 ) (RectD.452 Left: 23.00000000000000 Top: 254.00000000000000 Right: 304.00000000000000 Bottom: 236.00000000000000 ) (RectD.453 Left: 8.00000000000000 Top: 281.00000000000000 Right: 378.00000000000000 Bottom: 262.00000000000000 ) (RectD.454 Left: 23.00000000000000 Top: 297.00000000000000 Right: 304.00000000000000 Bottom: 277.00000000000000 ) (RectD.455 Left: 9.00000000000000 Top: 341.00000000000000 Right: 554.00000000000000 Bottom: 307.00000000000000 ) (RectD.456 Left: 9.00000000000000 Top: 377.00000000000000 Right: 553.00000000000000 Bottom: 342.00000000000000 ) (RectD.457 Left: 382.00000000000000 Top: 317.00000000000000 Right: 573.00000000000000 Bottom: 59.00000000000000 ) (RectD.458 Left: 382.00000000000000 Top: 359.00000000000000 Right: 573.00000000000000 Bottom: 97.00000000000000 ) (RectD.459 Left: 382.00000000000000 Top: 397.00000000000000 Right: 573.00000000000000 Bottom: 137.00000000000000 ) (RectD.460 Left: 379.00000000000000 Top: 274.00000000000000 Right: 571.00000000000000 Bottom: 179.00000000000000 ) (RectD.461 Left: 382.00000000000000 Top: 302.00000000000000 Right: 573.00000000000000 Bottom: 221.00000000000000 ) (RectD.462 Left: 382.00000000000000 Top: 342.00000000000000 Right: 573.00000000000000 Bottom: 261.00000000000000 ) (RectD.463 Left: 553.00000000000000 Top: 327.00000000000000 Right: 578.00000000000000 Bottom: 306.00000000000000 ) (RectD.464 Left: 553.00000000000000 Top: 362.00000000000000 Right: 578.00000000000000 Bottom: 341.00000000000000 ) (RectD.465 Left: 8.00000000000000 Top: 426.00000000000000 Right: 128.00000000000000 Bottom: 386.00000000000000 ) (RectD.466 Left: 304.00000000000000 Top: 424.00000000000000 Right: 424.00000000000000 Bottom: 386.00000000000000 ) (RectD.467 Left: 448.00000000000000 Top: 426.00000000000000 Right: 568.00000000000000 Bottom: 386.00000000000000 ) (RectD.468 Left: 158.00000000000000 Top: 426.00000000000000 Right: 278.00000000000000 Bottom: 386.00000000000000 ) (AVDLog.469 Name: "XTDisplaySelected" X: 21 Y: 151 W: 607 H: 240 ConstrainedControlNames: 470 ConstrainedControlNames: 471 Constraints: 472 Constraints: 473 Server: 474 ControlPanel: 475 Title: "XTools Display Selected Shapes" EscapeEnabled: 1 Resizable: 1 AlwaysOnTop: 1 HasTitleBar: 1 Closeable: 1 DefaultButton: 484 ) (AVStr.470 S: "XTDisplaySelectedClose" ) (AVStr.471 S: "XTDisplaySelectedClearall" ) (Numb.472 N: 85.00000000000000 ) (Numb.473 N: 85.00000000000000 ) (Nil.474 ) (CPanel.475 Child: 476 Child: 477 Child: 478 Child: 479 ResBox: 480 ResBox: 481 ResBox: 482 ResBox: 483 Listening: 1 ) (TextBox.476 InternalName: "txtbxSelected" Listening: 1 Constraints: 0x55 VerticalScroll: 1 NextControl: 474 ) (TextLabel.477 InternalName: "lblXTDisplaySelectedMessage" Constraints: 0x55 Label: "There are no selected features in this View!" Listening: 1 ) (LButn.478 InternalName: "XTDisplaySelectedClose" Label: "Close" Click: "XTDisplaySelected.Close" ) (LButn.479 InternalName: "XTDisplaySelectedClearall" Label: "Clear All\nSelections" Click: "XTDisplaySelected.Clearall" ) (RectD.480 Left: 13.00000000000000 Top: 234.00000000000000 Right: 517.00000000000000 Bottom: 33.00000000000000 ) (RectD.481 Left: 16.00000000000000 Top: 34.00000000000000 Right: 515.00000000000000 Bottom: 11.00000000000000 ) (RectD.482 Left: 527.00000000000000 Top: 207.00000000000000 Right: 595.00000000000000 Bottom: 168.00000000000000 ) (RectD.483 Left: 527.00000000000000 Top: 138.00000000000000 Right: 595.00000000000000 Bottom: 93.00000000000000 ) (Nil.484 ) (AVDLog.485 Name: "XTBatchWiz" X: 23 Y: 121 W: 503 H: 409 ConstrainedControlNames: 486 ConstrainedControlNames: 487 ConstrainedControlNames: 488 ConstrainedControlNames: 489 ConstrainedControlNames: 490 ConstrainedControlNames: 491 ConstrainedControlNames: 492 ConstrainedControlNames: 493 ConstrainedControlNames: 494 ConstrainedControlNames: 495 Constraints: 496 Constraints: 497 Constraints: 498 Constraints: 499 Constraints: 500 Constraints: 501 Constraints: 502 Constraints: 503 Constraints: 504 Constraints: 505 Server: 506 ControlPanel: 507 Title: "XTools Batch File Dialog" EscapeEnabled: 1 Resizable: 1 AlwaysOnTop: 1 HasTitleBar: 1 Closeable: 1 DefaultButton: 564 ) (AVStr.486 S: "btnAdd" ) (AVStr.487 S: "btnView" ) (AVStr.488 S: "btnRun" ) (AVStr.489 S: "btnHelp" ) (AVStr.490 S: "btnEdit" ) (AVStr.491 S: "btnDelete" ) (AVStr.492 S: "btnInput" ) (AVStr.493 S: "btnOverlay" ) (AVStr.494 S: "btnOutput" ) (AVStr.495 S: "btnBatch" ) (Numb.496 N: 85.00000000000000 ) (Numb.497 N: 85.00000000000000 ) (Numb.498 N: 85.00000000000000 ) (Numb.499 N: 85.00000000000000 ) (Numb.500 N: 85.00000000000000 ) (Numb.501 N: 85.00000000000000 ) (Numb.502 N: 85.00000000000000 ) (Numb.503 N: 85.00000000000000 ) (Numb.504 N: 85.00000000000000 ) (Numb.505 N: 85.00000000000000 ) (Nil.506 ) (CPanel.507 Child: 508 Child: 510 Child: 512 Child: 514 Child: 515 Child: 516 Child: 517 Child: 518 Child: 519 Child: 521 Child: 523 Child: 525 Child: 527 Child: 528 Child: 530 Child: 531 Child: 532 Child: 533 Child: 534 Child: 535 Child: 536 Child: 537 Child: 538 Child: 539 ResBox: 540 ResBox: 541 ResBox: 542 ResBox: 543 ResBox: 544 ResBox: 545 ResBox: 546 ResBox: 547 ResBox: 548 ResBox: 549 ResBox: 550 ResBox: 551 ResBox: 552 ResBox: 553 ResBox: 554 ResBox: 555 ResBox: 556 ResBox: 557 ResBox: 558 ResBox: 559 ResBox: 560 ResBox: 561 ResBox: 562 ResBox: 563 Listening: 1 ) (TextLine.508 InternalName: "txtInput" Label: " " Constraints: 0x55 Listening: 1 TextType: 509 NextControl: 506 ) (AVEnum.509 Name: "TEXTLINE_TYPE_ALL" ) (TextLine.510 InternalName: "txtOverlay" Label: " " Constraints: 0x55 Listening: 1 TextType: 511 NextControl: 506 ) (AVEnum.511 Name: "TEXTLINE_TYPE_ALL" ) (TextLine.512 InternalName: "txtOutput" Label: " " Constraints: 0x55 Listening: 1 TextType: 513 NextControl: 506 ) (AVEnum.513 Name: "TEXTLINE_TYPE_ALL" ) (TextLabel.514 InternalName: "lblInput" Constraints: 0x55 Label: "3. Select an Input theme:" Listening: 1 ) (TextLabel.515 InternalName: "lblOverlay" Constraints: 0x55 Label: "4. Select an Overlay theme:" Listening: 1 ) (TextLabel.516 InternalName: "lblOutput" Constraints: 0x55 Label: "5. Name the Output theme:" Listening: 1 ) (AVCBBox.517 InternalName: "cmbOperation" NextControl: 506 ContentKind: 4 Constraints: 0x55 Listening: 1 ) (TextLabel.518 InternalName: "lblOperation" Constraints: 0x55 Label: "2. Select an Overlay Operation:" Listening: 1 ) (Butn.519 InternalName: "btnInput" Icon: 520 Click: "XTBatchWiz.Buttons" ) (AVIcon.520 Name: "Open" Res: "Icons.Open" ) (Butn.521 InternalName: "btnOverlay" Icon: 522 Click: "XTBatchWiz.Buttons" ) (AVIcon.522 Name: "Open" Res: "Icons.Open" ) (Butn.523 InternalName: "btnOutput" Icon: 524 Click: "XTBatchWiz.Buttons" ) (AVIcon.524 Name: "Open" Res: "Icons.Open" ) (TextLine.525 InternalName: "txtBatch" Label: " " Constraints: 0x55 Listening: 1 TextType: 526 NextControl: 506 ) (AVEnum.526 Name: "TEXTLINE_TYPE_ALL" ) (TextLabel.527 InternalName: "lblBatch" Constraints: 0x55 Label: "1. Select or Create a Batch File:" Listening: 1 ) (Butn.528 InternalName: "btnBatch" Icon: 529 Click: "XTBatchWiz.Buttons" ) (AVIcon.529 Name: "Open" Res: "Icons.Open" ) (LButn.530 InternalName: "btnAdd" Label: "Add Batch\nOperation" Click: "XTBatchWiz.Buttons" ) (LButn.531 InternalName: "btnView" Label: "View Batch\nFile" Click: "XTBatchWiz.Buttons" ) (LButn.532 InternalName: "btnRun" Label: "Run Batch\nFile" Click: "XTBatchWiz.Buttons" ) (LButn.533 InternalName: "btnHelp" Label: "Help" Click: "XTBatchWiz.Buttons" ) (TextLabel.534 InternalName: "lblBatchFileSize" Constraints: 0x55 Listening: 1 ) (CPanel.535 InternalName: "cpBatch" Constraints: 0x55 Listening: 1 ) (RButn.536 InternalName: "rbutSelect" Constraints: 0x55 Listening: 1 Label: "Select Existing Batch File" ) (RButn.537 InternalName: "rbutCreate" Constraints: 0x55 Listening: 1 Label: "Create New Batch File" ) (LButn.538 InternalName: "btnEdit" Label: "Edit Batch\nFile" Click: "XTBatchWiz.Buttons" ) (LButn.539 InternalName: "btnDelete" Label: "Delete Batch\nFile" Click: "XTBatchWiz.Buttons" ) (RectD.540 Left: 24.00000000000000 Top: 190.00000000000000 Right: 448.00000000000000 Bottom: 170.00000000000000 ) (RectD.541 Left: 24.00000000000000 Top: 242.00000000000000 Right: 448.00000000000000 Bottom: 222.00000000000000 ) (RectD.542 Left: 25.00000000000000 Top: 296.00000000000000 Right: 449.00000000000000 Bottom: 276.00000000000000 ) (RectD.543 Left: 15.00000000000000 Top: 167.00000000000000 Right: 229.00000000000000 Bottom: 154.00000000000000 ) (RectD.544 Left: 15.00000000000000 Top: 217.00000000000000 Right: 229.00000000000000 Bottom: 204.00000000000000 ) (RectD.545 Left: 16.00000000000000 Top: 271.00000000000000 Right: 230.00000000000000 Bottom: 258.00000000000000 ) (RectD.546 Left: 28.00000000000000 Top: 269.00000000000000 Right: 193.00000000000000 Bottom: 121.00000000000000 ) (RectD.547 Left: 16.00000000000000 Top: 118.00000000000000 Right: 226.00000000000000 Bottom: 105.00000000000000 ) (RectD.548 Left: 452.00000000000000 Top: 189.00000000000000 Right: 477.00000000000000 Bottom: 170.00000000000000 ) (RectD.549 Left: 452.00000000000000 Top: 242.00000000000000 Right: 477.00000000000000 Bottom: 223.00000000000000 ) (RectD.550 Left: 452.00000000000000 Top: 296.00000000000000 Right: 477.00000000000000 Bottom: 277.00000000000000 ) (RectD.551 Left: 24.00000000000000 Top: 88.00000000000000 Right: 448.00000000000000 Bottom: 68.00000000000000 ) (RectD.552 Left: 15.00000000000000 Top: 48.00000000000000 Right: 229.00000000000000 Bottom: 35.00000000000000 ) (RectD.553 Left: 452.00000000000000 Top: 89.00000000000000 Right: 477.00000000000000 Bottom: 70.00000000000000 ) (RectD.554 Left: 32.00000000000000 Top: 356.00000000000000 Right: 100.00000000000000 Bottom: 322.00000000000000 ) (RectD.555 Left: 107.00000000000000 Top: 356.00000000000000 Right: 175.00000000000000 Bottom: 322.00000000000000 ) (RectD.556 Left: 182.00000000000000 Top: 356.00000000000000 Right: 250.00000000000000 Bottom: 322.00000000000000 ) (RectD.557 Left: 408.00000000000000 Top: 357.00000000000000 Right: 476.00000000000000 Bottom: 323.00000000000000 ) (RectD.558 Left: 33.00000000000000 Top: 382.00000000000000 Right: 438.00000000000000 Bottom: 369.00000000000000 ) (RectD.559 Left: 21.00000000000000 Top: 68.00000000000000 Right: 356.00000000000000 Bottom: 50.00000000000000 ) (RectD.560 Left: 28.00000000000000 Top: 73.00000000000000 Right: 176.00000000000000 Bottom: 45.00000000000000 ) (RectD.561 Left: 208.00000000000000 Top: 74.00000000000000 Right: 356.00000000000000 Bottom: 46.00000000000000 ) (RectD.562 Left: 258.00000000000000 Top: 357.00000000000000 Right: 326.00000000000000 Bottom: 323.00000000000000 ) (RectD.563 Left: 333.00000000000000 Top: 357.00000000000000 Right: 401.00000000000000 Bottom: 323.00000000000000 ) (Nil.564 ) (Script.565 Name: "XToolsUnload" SourceCode: "Dialog.DetachFromExtension(self)" ) (Script.566 Name: "XToolsInstall" SourceCode: "' Name: XtoolsInstall\n'\n' Author: Original Script ESRI Redlands\n' Modified Harley Prowse, Auckland UniServices - Geographic Technologies (harleyp@gtech.co.nz)\n'\n' Title: Extension Builder - Install\n'\n' Topics: \n'\n' Description: \n'\n' Requires: \n'\n' Self: \n'\n' Returns:\n' Install script modified by Mike DeLaune. Lat revision 5/28/01.\n\n\n' ABORT IF THERE IS NO PROJECT.\nif (av.getproject=nil) then \nMsgBox.Warning(\"XTools can only be installed into a loaded Project! Skipping XTools installation. \"+\n \"Load a Project or add a new Project and try again.\",\"\")\nreturn nil \nend\n\n\n' ABORT IF THE PROJECT IS THE XTOOLS PROJECT FILE. \nif (av.GetProject.GetName.Contains(\"xtools\")) then\n go = Msgbox.YesNo(\"You are attempting to load XTools Extension into a project \" +\n \"with XTools in its name. Do you want to do this?\",\"Warning\",false)\n if(go = FALSE) then\n SELF.Unload\n exit\n end\nend \n\n' FIGURE OUT IF THERE IS ALREADY AN XTOOLS VERSION LOADED.\ntheList = Extension.GetExtensions.AsList\ntheCoun t = 0\nfor each theExt in theList\n if(theExt.GetName.Contains(\"xtools\")) then\n theCount = theCount + 1\n end\nend\n\n' ABORT IF THE XTOOLS EXTENSION IS ALREADY LOADED. \nif (theCount > 1) then\n Msgbox.Info(\"You are attempting to load the XTools Extension into a project \" +\n \"where XTools is already loaded. Process terminated!\",\"Warning\")\n SELF.Unload\n exit\nend \n\nav.Maximize\n\n' SET THE TAG STRING THAT WILL BE USED TO UNINSTALL THE EXTENSION.\nExtId = \"Xtools1234\"\n\ntheDocs = SELF.get(0)\ntheControlLis t = SELF.get(1)\ntheMenuList = SELF.get(2)\nthePopupList= SELF.get(3)\ntheToolMenuList=SELF.Get(4)\ntheProject=Av.getproject\n\ntheOldCindex=0\nButtonStartIndex=23\nTootlStartIndex=14\nNumControlSpaces=0\nNumToolSpaces=0\n\n'ADD THE DOCS\n'\nfor each adoc in theDocs\n theProject.addDoc(adoc)\nend\n\n'ADD THE CONTROLS (BUTTONS AND NORMAL TOOLS)\n'\nfor each totalControl in theControlList\n 'The Control list\n acontrol=totalControl.get(0)\n aspacer=totalControl.get(2)\n \n if (aspacer=\"xSpace\") then\n if (NumControlSpace s=0) then\n theCindex=ButtonStartIndex\n theOldCindex=theCindex\n NumControlSpaces=NumControlSpaces+1\n else\n theCindex=theOldCindex+1\n end\n \n thecommand=\"av.getproject.findGUI(\"\"\"+totalControl.get(0)+\"\"\").Get\"+totalcontrol.get(1)\n thescript1=Script.Make(thecommand)\n thecontrolset=thescript1.doit(\"\") \n theControl=space.make\n theControl.setName(\"xSpacer\")\n theControl.setTag(ExtId)\n \n else\n 'THE PHYSICAL CONTROL\n theControl = totalControl.get(1)\n \n 'THE CONTROL INDEX\n theCindex=totalControl.get(2) - 1\n \n 'FIND THE DOCGUI\n theControlDoc=av.getproject.findGUI(aControl.get(0))\n if (theControlDoc=NIL) then \n MsgBox.Warning(\"The GUI \"+aControl.get(0)+\" cannot be found in the current project.\",\"Script Error\")\n return(nil)\n end\n \n 'THIS FINDS THE CONTROL SET \n thecommand=\"av.getproject.findGUI(\"\"\"+aControl.get(0)+\"\"\").Get\"+acontrol.get(1)\n thescript1=Script.Make(thecommand)\n thecontrolset =thescript1.doit(\"\")\n theOldCindex=theCindex\n end\n \n 'ADD THE CONTROL TO THE CONTROL SET\n theControl.setTag(ExtId)\n theControlSet.Add(theControl,theCindex)\nend\n\n\n'ADD THE MENUS\nfor each totalcontrol in theMenuList\n \n 'The Control list\n acontrol=totalControl.get(0)\n \n if (totalControl.get(2)=\"xSpace\") then\n theCindex=theOldCindex+1\n theControl=space.make\n theControl.SetName(\"xSpacer\")\n theControl.setTag(ExtId)\n\n else\n mDoc=acontrol.get(0)\n mMenu=acontrol.get(1 )\n mMenuItem=acontrol.get(2)\n \n 'THE PHYSICAL CONTROL\n theControl = totalControl.get(1)\n theControl.setTag(ExtId)\n\n \n 'THE CONTROL INDEX\n theCindex=totalControl.get(2) - 1\n theOldCindex=theCindex\n \n 'FIND THE DOCGUI\n theControlDoc=av.getproject.findGUI(aControl.get(0))\n if (theControlDoc=NIL) then \n MsgBox.Warning(\"The GUI \"+aControl.get(0)+\" cannot be found in the current project.\",\"Script Error\")\n return(nil)\n end\n \n theMbar =av.getproject.findGUI(mDoc).GetMenuBar\n themenu=theMbar.findbylabel(mMenu)\n if (themenu=NiL) then\n themenu=menu.make\n themenu.setlabel(mMenu) \n themenu.setTag(ExtId)\n\n'================================================================================== \n theList = theMbar.GetControls\n theIndex = theList.Find(Window)\n for each c in theList\n if (c.GetName = \"Window\") then\n theIndex = (theList.Find(c)) - 1\n end \n end\n if ((theIndex = nil).Not) the n\n theMbar.Add(themenu,theIndex)\n else\n theMbar.add(themenu,999)\n end \n'================================================================================== \n' theMbar.add(themenu,999)\n end\n end\n themenu.add(thecontrol, theCindex)\nend\n\n'________________________________________________________________\n'CUSTOM CODE FOR ADDING POPUPS\n'________________________________________________________________\n\n'ADD THE POPUPS\n\nfor each totalcontrol in thePopupList\n \n 'THE CONTROL LIST\n acon trol=totalControl.get(0)\n \n if (totalControl.get(2)=\"xSpace\") then\n theCindex=theOldCindex+1\n theControl=space.make\n theControl.SetName(\"xSpacer\")\n theControl.setTag(ExtId)\n\n else\n pDoc=acontrol.get(0)\n popMenu=acontrol.get(1)\n pMenuItem=acontrol.get(2)\n \n 'THE PHYSICAL CONTROL\n theControl = totalControl.get(1)\n \n 'THE CONTROL INDEX\n theCindex=totalControl.get(2) - 1\n theOldCindex=theCindex\n \n 'FIND THE DOCGUI\n theControlDoc=av.get project.findGUI(aControl.get(0))\n if (theControlDoc=NIL) then \n MsgBox.Warning(\"The GUI \"+aControl.get(0)+\" cannot be found in the current project.\",\"Script Error\")\n return(nil)\n end\n \n thepopups=av.getproject.findGUI(pDoc).Getpopups\n thepopup=thepopups.findbylabel(popMenu)\n if (thepopup=NiL) then\n thepopup=popup.make\n thepopup.setlabel(popMenu)\n thepopups.add(thepopup,999)\n end\n end\n theControl.setTag(ExtId)\n thepopup.add(thecontrol, the Cindex)\nend\n\n'______________________________________________________________________\n \n'ADD THE TOOL MENUS\n\nfor each totalControl in theToolMenuList\n 'THE CONTROL LIST\n acontrol=totalControl.get(0)\n \n if (aControl=\"xSpace\") then\n theCindex=theOldCindex+1\n theControl=space.make\n theControl.setTag(ExtId)\n\n else\n 'THE PHYSICAL CONTROL\n theControl = totalControl.get(1)\n \n 'THE CONTROL INDEX\n theCindex=totalControl.get(2) - 1\n \n 'FIND THE DOCGUI\n theControlDoc =av.getproject.findGUI(aControl.get(0))\n if (theControlDoc=NIL) then \n MsgBox.Warning(\"The GUI \"+aControl.get(0)+\" cannot be found in the current project.\",\"Script Error\")\n return(nil)\n end\n \n 'THIS FINDS THE CONTROL SET \n thecommand=\"av.getproject.findGUI(\"\"\"+aControl.get(0)+\"\"\").Get\"+acontrol.get(1)\n thescript1=Script.Make(thecommand)\n thecontrolset=av.getproject.findGUI(aControl.get(0)).GetToolBar\n theOldCindex=theCindex\n end\n \n 'ADD THE CONTROL TO TH E CONTROL SET\n theControl.setTag(ExtId)\n theControlSet.Add(theControl,theCindex)\nend\n\n' REMOVE ITEMS HERE THAT DO NOT WORK UNDER SPECIFIC OPERATING SYSTEMS.\ntheOS = System.GetOS\nif(theOS <> #SYSTEM_OS_MSW) then\n theTableGUI = av.getproject.findGUI(\"Table\")\n theXToolsMenu = theTableGUI.GetMenuBar.FindByLabel(\"&XTools\")\n if(theXToolsMenu <> nil) then\n theExportToExcelChoice = theTableGUI.GetMenuBar.FindByScript(\"aanTable.Av2Excel\")\n theXToolsMenu.Remove(theExportToExcelChoice)\n av.GetProject.R emoveScript(\"aanTable.Av2Excel\")\n end \nend \n\n' THE REMAINDER OF THE INSTALL SCRIPT TAKES CARE OF SETTING THE XTOOLS DEFAULTS.\n\n' LOAD THE XTOOLS DEFAULTS.\nav.run(\"XTdefaults.Load\",nil )\nav.getproject.setmodified(true)" ) (Script.567 Name: "XtoolsUninstall" SourceCode: "' Name: Uninstall\n'\n' Author: Original Script ESRI Redlands\n' Modified Harley Prowse, Auckland UniServices - Geographic Technologies (harleyp@gtech.co.nz)\n'\n' Title: Extension Builder - Uninstall\n'\n' Topics: \n'\n' Description: \n'\n' Requires: \n'\n' Self: \n'\n' Returns:\n' Uninstall script modified by Mike DeLaune. Last Revision 5/28/01.\n\n\n\n'DO NOT EDIT!!!\n\n'The SELF is the Extension\n\nif (av.getproject=nil) then return nil end\n\ntheDocs = SELF.get(0)\ntheControlList = SELF.get(1)\ntheMenuList = SELF.g et(2)\nthePopupList = SELF.get(3)\ntheToolMenuList=SELF.get(4)\ntheProject=Av.getproject\n\nxtdial = av.FindDialog(\"XTDefaults\")\nxtdial.Close \nxtdial = av.FindDialog(\"XTMessages\")\nxtdial.Close \nxtdial = av.FindDialog(\"XTDisplaySelected\")\nxtdial.Close \nxtdial = av.FindDialog(\"XTBatchWiz\")\nxtdial.Close \n\n'remove the Docs\n'\nfor each adoc in theDocs\n If (theProject.finddoc(adoc.getname)<>NIL) then \n 'theAnswer=msgbox.yesno(\"Remove the Document \"+adoc.getname+\"?\",\"Remove Document?\",TRUE)\n 'if (theAnswer=TRUE) then theProject.RemoveDoc(adoc) end\n theProject.RemoveDoc(adoc)\n end\nend\n\n\n\n'Removethe Controls\n'\nfor each totalControl in theControlList\n \n if (totalcontrol.get(2) <> \"xSpace\") then\n \n 'Get the control list from the Ext\n acontrol=totalControl.get(0)\n \n 'Get the physical Control\n theControl = totalControl.get(1)\n \n 'Get the Controls Index\n theCindex=totalControl.get(2)\n \n 'Find the DocGUI for the Control\n theControlDoc=av.getproject.findGUI(aControl.get(0))\n if (theControlDoc=NIL) then \n MsgBox.Warning(\"The GUI \"+aControl.get(0)+\" cannot be found in the current project.\",\"Script Error\")\n return(nil)\n end\n\n 'This sequence finds the appropiate control set\n thecommand=\"av.getproject.findGUI(\"\"\"+aControl.get(0)+\"\"\").Get\"+acontrol.get(1)\n thescript1=Script.Make(thecommand)\n thecontrolset=thescript1.doit(\"\")\n \n 'See if the control is in the set , if so remove it\n if (theControlSet.GetControls.find(theControl) >= 0 ) then\n theControlSet.remove(theControl)\n if (thecontrol = \"ToolBar\") then\n theControlSet.selectdefault\n end\n end\n else\n thecommand=\"av.getproject.findGUI(\"\"\"+totalControl.get(0)+\"\"\").Get\"+totalcontrol.get(1)\n thescript1=Script.Make(thecommand)\n thecontrolset=thescript1.doit(\"\")\n \n for each i in 1..100\n spacerControl=theControlSet.FindByName(\"xSpacer\")\n if (spacerControl <> nil) then\n theControlSet.remove(spacerControl)\n else \n break\n end\n end\n \n end\nend\n\n' msgbox.info(\"Controls Removed OK\",\"\")\n\n'Remove the Menus\n'\nfor each totalcontrol in theMenuList\n \n 'The Control list\n acontrol=totalControl.get(0)\n if (totalControl.get(2) <> \"xSpace\") then\n \n mDoc=acontrol.get(0)\n mMenu=acontrol.get(1)\n mMenuItem=acontrol.get(2)\n \n 'The physical control\n theControl = totalControl.get(1)\n \n 'The control Index\n theCindex=totalControl.get(2)\n \n 'Find the DocGUI\n theControlDoc=av.getproject.findGUI(aControl.get(0))\n if (theControlDoc=nil) then \n' MsgBox.Warning(\"The GUI \"+aControl.get(0)+\" cannot be found in the current project.\",\"Script Error\")\n' return(nil)\n end\n \n theMbar=av.getproject.findGUI(mDoc).GetMenuBar\n themenu=theMbar.findbylabel(mMenu)\n if (themenu=NiL) then\n' MsgBox.Warning(\"The menu named \"+mMenu+\" is not here.\",\"Script Error\")\n 'return(nil)\n else\n \n thething=themenu.getcontrols.find(thecontrol)\n if (thething >= 0) then \n themenu.remove(thecontrol) \n end\n 'msgbox.info(themenu.GetControls.count.asstring,\"\")\n if (themenu.GetControls.count<1) then\n theMbar.remove(themenu)\n end\n end\n else\n 'Find the DocGUI\n theControlDoc=av.getproject.findGUI(totalControl.get(0))\n if (theControlDoc=NIL) then \n' MsgBox.Warning(\"The GUI \"+totalControl.get(0)+\" canno t be found in the current project.\",\"Script Error\")\n' return(nil)\n end\n theMbar=av.getproject.findGUI(mDoc).GetMenuBar\n themenu=theMbar.findbylabel(mMenu)\n if (themenu=NiL) then\n' MsgBox.Warning(\"The menu named \"+mMenu+\" is not here.\",\"Script Error\")\n 'return(nil)\n else\n \n for each i in 1..100\n theSpacer=themenu.findbyname(\"xSpacer\")\n if (thespacer <> nil) then\n themenu.remove(theSpacer)\n else\n break\n end \n end\n end\n \n end\nend\n\n'msgbox.info(\"Menus Removed OK\",\"\")\n\n'__________________________________________________________________________\n'Remove the Popups\n'__________________________________________________________________________\n\nfor each totalcontrol in thePopupList\n \n 'The Control list\n acontrol=totalControl.get(0)\n if (totalControl.get(2) <> \"xSpace\") then\n \n pDoc=acontrol.get(0)\n popMenu=acontrol.get(1)\n pMenuItem=acontro l.get(2)\n \n 'The physical control\n theControl = totalControl.get(1)\n \n 'The control Index\n theCindex=totalControl.get(2)\n \n 'Find the DocGUI\n theControlDoc=av.getproject.findGUI(aControl.get(0))\n if (theControlDoc=NIL) then \n' MsgBox.Warning(\"The GUI \"+aControl.get(0)+\" cannot be found in the current project.\",\"Script Eror\")\n' return(nil)\n end\n \n thepopups=av.getproject.findGUI(pDoc).Getpopups\n thepopup=the popups.findbylabel(popMenu)\n if (thepopup=NiL) then\n' MsgBox.Warning(\"The popup named \"+popMenu+\" is not here.\",\"Script Eror\")\n 'return(nil)\n else \n thething=thepopup.getcontrols.find(thecontrol)\n if (thething<>NIL) then \n thepopup.remove(thecontrol) \n end\n 'msgbox.info(themenu.GetControls.count.asstring,\"\")\n if (thepopup.GetControls.count<1) then\n thepopups.remove(thepopup)\n end\n end\n else\n 'Find the DocGUI\n theControlDoc=av.getproject.findGUI(totalControl.get(0))\n if (theControlDoc=NIL) then \n' MsgBox.Warning(\"The GUI \"+totalControl.get(0)+\" cannot be found in the current project.\",\"Script Eror\")\n' return(nil)\n end\n thepopups=av.getproject.findGUI(mDoc).Getpopups\n thepopup=thepopups.findbylabel(popMenu)\n if (thepopup=NiL) then\n' MsgBox.Warning(\"The popup named \"+thepopup+\" is not here.\",\"Script Eror\")\n 'return(nil)\n else\n theSpacer=thepopup.findbyname(\"xSpacer\")\n if (thespacer <> nil) then\n thepopup.remove(theSpacer)\n end\n end\n end\nend\n\n\nfor each totalControl in theToolMenuList\n 'Get the control list from the Ext\n acontrol=totalControl.get(0)\n \n 'Get the physical Control\n theControl = totalControl.get(1)\n \n 'Get the Controls Index\n theCindex=totalControl.get(2)\n\n 'Find the DocGUI for the Control\n theControlDoc=av.getproject.findGUI(aControl.get(0))\n if (theControlDoc=NIL) then \n ' MsgBox.Warning(\"The GUI \"+aControl.get(0)+\" cannot be found in the current project.\",\"Script Eror\")\n' return(nil)\n end\n \n 'This sequence finds the appropiate control set\n thecontrolset=av.getproject.findGUI(aControl.get(0)).GetToolBar\n\n \n 'See if the control is in the set , if so remove it\n if (theControlSet.GetControls.find(theControl)<>NIL) then\n \n theControlSet.remove(theControl)\n theControlSet.selectdefault\n end\n\nend\n \n'msgbox.info(\"ToolMenus Removed OK\",\"\")\n\n'And the scripts delete themselves\n\n'**** Uncomment this line if your extension contains dialogs *****\n\nDialog.DetachFromExtension(self)\nav.purgeObjects\nav.getproject.setmodified(true)\n\n\n\n" )