/3.2 (Extension.1 Name: "Remove Z/M Attributes from Shapes" FirstRootClassName: "List" Roots: 2 Roots: 3 Roots: 12 Roots: 13 Version: 32 About: "Takes shapes with Z and M values (i.e. PointZ, PolylineM, PolygonZ, etc.shapes) and converts them to basic Point, Polyline or Polygon shapes. Last modified November 19, 2002 by Jenness Enterprises (www.jennessent.com)" InstallScript: 14 UninstallScript: 15 ExtVersion: 1 ) (List.2 ) (List.3 Child: 4 ) (List.4 Child: 5 Child: 10 Child: 9 ) (List.5 Child: 6 Child: 7 Child: 8 Child: 9 ) (AVStr.6 S: "View" ) (AVStr.7 S: "ButtonBar" ) (AVStr.8 S: "Jennessent.ConvertZtoShape" ) (Numb.9 N: 22.00000000000000 ) (Butn.10 Help: "Remove Z and M attributes//Convert ShapeZ and ShapeM objects to Shape objects..." Update: "Jennessent.ConvertZtoShapeIconUpdate" Icon: 11 Click: "Jennessent.ConvertZtoShape" ) (AVIcon.11 Name: "icon.gif" Data: 4e442049 6d616765 00010014 00110000 Data: 0154d8d8 d8d8d8d8 d8d8d8d8 d8d8d8d8 Data: d8d8d8d8 d8d8d8d8 d8d8d8d8 d8d8d8d8 Data: d8d8d8d8 d8d8d8d8 d8d8d8d8 d8d8d8d8 Data: d8d8d8d8 d8d8d8d8 d8d8d8d8 d8d8d8d8 Data: d8d8d8d8 d8d8d8d8 d8d8d8d8 d8d8d8d8 Data: d8d8d8d8 d8d8d8d8 d7d7d7d7 d7d7d7d8 Data: d8d8d8d8 d8d8d8d8 d8d8d8d8 d8d8d8d8 Data: d8d7d7d8 d8d8d8d8 d8d8d8d8 d8d8d8d8 Data: d8d8d8d8 d7d7d8d8 d8d8d8d8 d8d8d8d8 Data: d8d8d8d8 d8d8d8d8 d7d7d8d8 d8d8d8d8 Data: d8d8d8d8 d8d8d8d8 d8d8d8d7 d7d8d8d8 Data: d8d8d8d8 d8d8d7d7 d7d7d7d8 d8d8d7d7 Data: d8d8d8d8 d7d7d7d7 d7d8d8d8 d8d8d8d8 Data: d8d7d7d8 d8d8d8d8 d8d8d8d8 d8d8d8d8 Data: d8d8d8d8 d8d7d7d8 d8d8d8d8 d8d8d8d8 Data: d8d8d8d8 d8d8d8d8 d7d7d8d8 d8d8d8d8 Data: d8d8d8d8 d8d8d8d8 d8d8d8d8 d7d7d7d7 Data: d7d7d7d8 d8d8d8d8 d8d8d8d8 d8d8d8d8 Data: d8d8d8d8 d8d8d8d8 d8d8d8d8 d8d8d8d8 Data: d8d8d8d8 d8d8d8d8 d8d8d8d8 d8d8d8d8 Data: d8d8d8d8 d8d8d8d8 d8d8d8d8 d8d8d8d8 Data: d8d8d8d8 d8d80000 040000ff ffff00ff Data: ffcc00ff ff9900ff ff6600ff ff3300ff Data: ff0000ff ccff00ff cccc00ff cc9900ff Data: cc6600ff cc3300ff cc0000ff 99ff00ff Data: 99cc00ff 999900ff 996600ff 993300ff Data: 990000ff 66ff00ff 66cc00ff 669900ff Data: 666600ff 663300ff 660000ff 33ff00ff Data: 33cc00ff 339900ff 336600ff 333300ff Data: 330000ff 00ff00ff 00cc00ff 009900ff Data: 006600ff 003300ff 000000cc ffff00cc Data: ffcc00cc ff9900cc ff6600cc ff3300cc Data: ff0000cc ccff00cc cccc00cc cc9900cc Data: cc6600cc cc3300cc cc0000cc 99ff00cc Data: 99cc00cc 999900cc 996600cc 993300cc Data: 990000cc 66ff00cc 66cc00cc 669900cc Data: 666600cc 663300cc 660000cc 33ff00cc Data: 33cc00cc 339900cc 336600cc 333300cc Data: 330000cc 00ff00cc 00cc00cc 009900cc Data: 006600cc 003300cc 00000099 ffff0099 Data: ffcc0099 ff990099 ff660099 ff330099 Data: ff000099 ccff0099 cccc0099 cc990099 Data: cc660099 cc330099 cc000099 99ff0099 Data: 99cc0099 99990099 99660099 99330099 Data: 99000099 66ff0099 66cc0099 66990099 Data: 66660099 66330099 66000099 33ff0099 Data: 33cc0099 33990099 33660099 33330099 Data: 33000099 00ff0099 00cc0099 00990099 Data: 00660099 00330099 00000066 ffff0066 Data: ffcc0066 ff990066 ff660066 ff330066 Data: ff000066 ccff0066 cccc0066 cc990066 Data: cc660066 cc330066 cc000066 99ff0066 Data: 99cc0066 99990066 99660066 99330066 Data: 99000066 66ff0066 66cc0066 66990066 Data: 66660066 66330066 66000066 33ff0066 Data: 33cc0066 33990066 33660066 33330066 Data: 33000066 00ff0066 00cc0066 00990066 Data: 00660066 00330066 00000033 ffff0033 Data: ffcc0033 ff990033 ff660033 ff330033 Data: ff000033 ccff0033 cccc0033 cc990033 Data: cc660033 cc330033 cc000033 99ff0033 Data: 99cc0033 99990033 99660033 99330033 Data: 99000033 66ff0033 66cc0033 66990033 Data: 66660033 66330033 66000033 33ff0033 Data: 33cc0033 33990033 33660033 33330033 Data: 33000033 00ff0033 00cc0033 00990033 Data: 00660033 00330033 00000000 ffff0000 Data: ffcc0000 ff990000 ff660000 ff330000 Data: ff000000 ccff0000 cccc0000 cc990000 Data: cc660000 cc330000 cc000000 99ff0000 Data: 99cc0000 99990000 99660000 99330000 Data: 99000000 66ff0000 66cc0000 66990000 Data: 66660000 66330000 66000000 33ff0000 Data: 33cc0000 33990000 33660000 33330000 Data: 33000000 00ff0000 00cc0000 00990000 Data: 00660000 00330000 000002ff ffff0000 Data: 00000000 00000000 00000000 00000000 Data: 00000000 00000000 00000000 00000000 Data: 00000000 00000000 00000000 00000000 Data: 00000000 00000000 00000000 00000000 Data: 00000000 00000000 00000000 00000000 Data: 00000000 00000000 00000000 00000000 Data: 00000000 00000000 00000000 00000000 Data: 00000000 00000000 00000000 00000000 Data: 00000000 00000000 00000000 00000000 Data: 00000000 00000000 00000002 0008000a Data: 00200000 00000000 00000000 0000 ) (Script.12 Name: "Jennessent.ConvertZtoShape" SourceCode: "' Jennessent.ConvertZtoShape\n\n' IDENTIFY INITIAL COMPONENTS\n\ntheView = av.GetActiveDoc\ntheActiveThemes = theView.GetActiveThemes\ntheTheme = theActiveThemes.Get(0)\ntheFTab = theTheme.GetFTab\ntheShapeField = theFTab.FindField(\"Shape\")\ntheOS = System.GetOS\ntheWorkDir = av.GetProject.GetWorkDir\ntheWorkDirStr = theWorkDir.AsString\ntheProject = av.GetProject\n\n' IDENTIFY SHAPE TYPE\ntheClassName = theFTab.GetShapeClass.GetClassName\nif ((theClassName = \"PointZ\") or (theClassName = \"PointM\") or (theClassName = \"Point \")) then\n theChoice = \"Point\"\n theClass = Point\nelseif ((theClassName = \"PolylineZ\") or (theClassName = \"PolylineM\") or (theClassName = \"Polyline\")) then \n theChoice = \"Polyline\"\n theClass = Polyline\nelse\n theChoice = \"Polygon\"\n theClass = Polygon\nend\n\n' IDENTIFY NEW FTAB\n\nif (theOS = #SYSTEM_OS_MSW) then\n tempShapeFileString = \"\\new_shapefile.shp\"\nelse\n tempShapeFileString = \"/new_shapefile.shp\"\nend\ntempShapeFileName = FileName.Make(theWorkDirStr+tempShapeFileString)\ntempShapeCounter = 1\n\n' SUGGES T FILE NAME AND DIRECTORY, BUT NOT ONE THAT ALREADY EXISTS\n\nWhile (File.Exists(tempShapeFileName))\n tempShapeCounter = tempShapeCounter + 1\n if (theOS = #SYSTEM_OS_MSW) then\n tempShapeFileString = \"\\new_shapefile\"+tempShapeCounter.AsString+\".shp\"\n else\n tempShapeFileString = \"/new_shapefile\"+tempShapeCounter.AsString+\".shp\"\n end\n tempShapeFileName = FileName.Make(theWorkDirStr+tempShapeFileString)\n if (File.Exists(tempShapeFileName).Not) then\n break\n end\nend\n\ntheFilename = FileDialog.Put(tem pShapeFileName, \"*.shp\", \"Where do you want to save the new \"+theChoice+\" shapefile?\")\n\nif (theFilename = nil) then \n msgBox.info (\"No \"+theChoice+\" shapefile created:\", \"Change of Plans:\")\n return nil\nend\n\n\ntheNewFTab = Ftab.MakeNew(theFilename, theClass)\ntheNewShapeField = theNewFTab.FindField(\"Shape\")\ntheFields = theFTab.GetFields\ntheListOfFields = {}\nfor each aField in theFields\n if (aField.IsTypeShape.Not) then theListOfFields.Add(aField.Clone) end\nend\n\ntheNewFTab.SetEditable (True)\ntheNewFTab.AddFi elds(theListOfFields)\n\n' CHANGE WORK DIRECTORY TO SELECTED PATHNAME\n\ntheProject.SetWorkDir(theFileName.GetClass.GetCWD)\ntheWorkDir = av.GetProject.GetWorkDir\ntheWorkDirStr = theWorkDir.AsString\n\ntheCount = theFTab.GetNumRecords\ntheCounter = 0\nav.ShowStopButton\n\n' CONVERT SHAPES AND WRITE DATA TO NEW FTAB\nfor each aRec in theFTab\n theCounter = theCounter+1\n ShouldContinue = av.SetStatus((theCounter/theCount)*100)\n if (ShouldContinue.Not) then\n theNewFTab.SetEditable(False)\n theNewTheme = FTheme.Make (theNewFTab)\n theView.AddTheme(theNewTheme)\n msgBox.Info((theCounter-1).AsString+\" of \"+theCount.AsString+\" records processed....\", \"Operation Cancelled:\")\n return nil\n end\n \n theShape = theFTab.ReturnValue(theShapeField, aRec)\n if (theChoice = \"Point\") then\n theNewShape = theShape.AsPoint\n elseif (theChoice = \"Polyline\") then\n theNewShape = theShape.AsPolyline\n else\n theNewShape = theShape.AsPolygon\n end\n \n theNewRec = theNewFTab.AddRecord\n theNewFTab.SetValue(theNewShapeField, theNewRec, theNewShape)\n for each aField in theListOfFields\n theOldField = theFTab.FindField(aField.GetName)\n theNewFTab.SetValue(aField, theNewRec, theFTab.ReturnValue(theOldField, aRec))\n end\nend\ntheNewFTab.SetEditable(False)\ntheNewTheme = FTheme.Make(theNewFTab)\ntheView.AddTheme(theNewTheme)\n \n \n \n \n \n \n \n \n \n \n \n \n " ) (Script.13 Name: "Jennessent.ConvertZtoShapeIconUpdate" SourceCode: "' Jennessent.ConvertZtoShapeIconUpdate\n\nThemeCountCorrect = (av.GetActiveDoc.GetActiveThemes.Count = 1)\nThemeIsFTheme = False\n\nif (ThemeCountCorrect) then\n theTheme = av.GetActiveDoc.GetActiveThemes.Get(0)\n if (theTheme.Is(FTheme)) then \n theThemeType = theTheme.GetFTab.GetShapeClass.GetClassName\n ThemeIsFTheme = ((theThemeType = \"PointZ\") or (theThemeType = \"PolylineZ\") or (theThemeType = \"PolygonZ\") or\n (theThemeType = \"PointM\") or (theThemeType = \"PolylineM\") or (theThemeType = \"PolygonM\"))\n end\nend\n\nself.SetEnabled(ThemeCountCorrect and ThemeIsFTheme)" ) (Script.14 Name: "Ext.UserExtInstall" SourceCode: "' Ext.UserExtInstall Thad Tilton\n' A generic install script for new extensions made with the ExtBuilder dialog\n' \n\nif (av.getproject=nil) then return(nil) end\n\n\ntheDocs = SELF.get(0)\ntheControlList = SELF.get(1)\ntheProject=Av.getproject\n\n\n'Add the Docs\n'\nfor each adoc in theDocs\n theProject.addDoc(adoc)\nend\n\n'Add the Controls\n' ' totalControl =\nfor each totalControl in theControlList '{ {\"GUI\",\"BBar\",Scpt\"}, control, idx#}\n 'The Control list\n acontrol=tot alControl.get(0) '{\"GUI\",\"BBar\",\"Script\"}\n \n 'The physical control\n theControl = totalControl.get(1) ' UserControl\n \n 'The control Index\n theCindex=totalControl.get(2) ' Index#\n\n 'Find the DocGUI\n theControlDoc=av.getproject.findGUI(aControl.get(0))\n if (theControlDoc=NIL) then \n MsgBox.Warning(\"The GUI \"+aControl.get(0)+\" cannot be found in the current project.\",\"Script Eror\")\n return(nil)\n end\n \n 'This finds the control set \n thecommand=\"av.getproject.findGUI(\" \"\"+aControl.get(0)+\"\"\").Get\"+acontrol.get(1)\n thescript1=Script.Make(thecommand)\n thecontrolset=thescript1.doit(\"\") '** = av.GetProject.FindGUI(\"View\").GetButtonBar **\n \n 'Add the control to the control set\n theControlSet.Add(theControl,theCindex)\nend\n\nav.getproject.setmodified(true)" ) (Script.15 Name: "Ext.UserExtUnInstall" SourceCode: "'Ext.UserExt.UnInstall Thad Tilton\n'A generic uninstall script for an extension made with the ExtBuilder dialog\n\n'SELF is the Extension\n\ntheDocs = SELF.get(0)\ntheControlList = SELF.get(1)\ntheProject=Av.getproject\n\n'Add the Docs\n'\nfor each adoc in theDocs\n If (theProject.finddoc(adoc.getname)<>NIL) then \n theAnswer=msgbox.yesno(\"Remove the Document \"+adoc.getname+\"?\",\"Remove Document?\",TRUE)\n if (theAnswer=TRUE) then theProject.RemoveDoc(adoc) end\n end\nend\n\n'Removethe Controls\n'\nfor each to talControl in theControlList\n 'Get the control list from the Ext\n acontrol=totalControl.get(0)\n \n 'Get the physical Control\n theControl = totalControl.get(1)\n \n 'Get the Controls Index\n theCindex=totalControl.get(2)\n\n 'Find the DocGUI for the Control\n theControlDoc=av.getproject.findGUI(aControl.get(0))\n if (theControlDoc=NIL) then \n MsgBox.Warning(\"The GUI \"+aControl.get(0)+\" cannot be found in the current project.\",\"Script Eror\")\n return(nil)\n end\n \n 'This seq uence finds the appropiate control set\n thecommand=\"av.getproject.findGUI(\"\"\"+aControl.get(0)+\"\"\").Get\"+acontrol.get(1)\n thescript1=Script.Make(thecommand)\n thecontrolset=thescript1.doit(\"\") '**>> av.GetProject.FindGUI(\"View\").GetButtonBar, e.g.\n\n 'See if the control is in the set , if so remove it\n if (theControlSet.GetControls.find(theControl)<>NIL) then\n theControlSet.remove(theControl)\n if (acontrol.get(1) = \"ToolBar\") then\n theControlSet.selectdefault\n end\n end\nend \n\nav.getproject.setmodified(true)\n" )