/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.GetCurren