/3.1 (Extension.1 Name: "Projector!mod Extension" FirstRootClassName: "List" Roots: 2 Roots: 3 Roots: 12 Roots: 13 Roots: 14 Version: 31 About: "This is a modified version of the Projector! extension for ArcView that includes a dialog to retain original theme names and legends.\nBrian J. Torreano - US EPA - R5- FIELDS div.\nVersion 1.0 05/18/1999" InstallScript: 15 UninstallScript: 16 ExtVersion: 1 ) (List.2 ) (List.3 Child: 4 ) (List.4 Child: 5 Child: 9 Child: 11 ) (List.5 Child: 6 Child: 7 Child: 8 ) (AVStr.6 S: "View" ) (AVStr.7 S: "ButtonBar" ) (AVStr.8 S: "Projector!mod" ) (Butn.9 Help: "Projector!mod//Reprojects the active themes based on user input (shift+Click for instructions/Help)" Icon: 10 Click: "Projector!mod" ) (AVIcon.10 Name: "arrow.bmp" Data: 4e442049 6d616765 00010019 00160000 Data: 0688bbcc d5000000 00000000 00000000 Data: 00000000 00000000 00000000 00000000 Data: 00000000 00000000 00000000 00000000 Data: 00000000 00000000 00000000 00000000 Data: 00000000 00000000 0000bbcc d5000000 Data: 00999999 99999999 99999999 99999999 Data: 99999999 99999999 99999999 99999999 Data: 99999999 99999999 99999999 99999999 Data: 99999999 99999999 99999999 99999999 Data: 99999999 99990000 00000000 00ffffff Data: 99999999 99999999 99999999 99999999 Data: 99999999 99999999 99999999 99999999 Data: 99999999 99999999 99999999 99999999 Data: 99999999 99999999 99999999 99999999 Data: 99990000 00000000 00ffffff bbccd5bb Data: ccd5bbcc d5bbccd5 bbccd5bb ccd5bbcc Data: d5bbccd5 bbccd5bb ccd5bbcc d5bbccd5 Data: bbccd5bb ccd5bbcc d5bbccd5 bbccd5bb Data: ccd5bbcc d5bbccd5 99999999 99990000 Data: 00000000 00ffffff bbccd5bb ccd5bbcc Data: d5bbccd5 bbccd5bb ccd5bbcc d5bbccd5 Data: bbccd5bb ccd5bbcc d5bbccd5 bbccd5bb Data: ccd5bbcc d5bbccd5 bbccd5bb ccd5bbcc Data: d5bbccd5 99999999 99990000 00000000 Data: 00ffffff bbccd5bb ccd50000 00000000 Data: bbccd5bb ccd5bbcc d5bbccd5 bbccd5bb Data: ccd5bbcc d5bbccd5 bbccd5bb ccd5bbcc Data: d5000000 000000bb ccd5bbcc d5bbccd5 Data: 99999999 99990000 00000000 00ffffff Data: bbccd5bb ccd50000 00000000 bbccd5bb Data: ccd5bbcc d5000000 00000000 00000000 Data: 00bbccd5 bbccd5bb ccd5bbcc d5000000 Data: 000000bb ccd5bbcc d5bbccd5 99999999 Data: 99990000 00000000 00ffffff bbccd5bb Data: ccd5bbcc d5bbccd5 bbccd500 00000000 Data: 00000000 ffffffff ffff0000 00000000 Data: 000000bb ccd5bbcc d5bbccd5 bbccd5bb Data: ccd5bbcc d5bbccd5 99999999 99990000 Data: 00000000 00ffffff bbccd5bb ccd5bbcc Data: d5bbccd5 00000000 00000000 00000000 Data: ffffffff ffff0000 00000000 00000000 Data: 0000bbcc d5bbccd5 bbccd5bb ccd5bbcc Data: d5bbccd5 99999999 99990000 00000000 Data: 00ffffff bbccd5bb ccd5bbcc d5bbccd5 Data: 00000000 00000000 00000000 ffffffff Data: ffff0000 00000000 00000000 0000bbcc Data: d5bbccd5 bbccd5bb ccd5bbcc d5bbccd5 Data: 99999999 99990000 00000000 00ffffff Data: bbccd5bb ccd5bbcc d5777777 00ffff00 Data: 00000000 00000000 ffffffff ffff0000 Data: 00000000 00000000 00000000 00bbccd5 Data: bbccd5bb ccd5bbcc d5bbccd5 99999999 Data: 99990000 00000000 00ffffff 00ffffbb Data: ccd5bbcc d5777777 00ffffff ffff0000 Data: 00777777 00ffffff ffff0000 00000000 Data: ffffffff ffff0000 00bbccd5 bbccd5bb Data: ccd5bbcc d5bbccd5 99999999 99990000 Data: 00000000 00ffffff 77777700 ffff7777 Data: 77777777 00ffffff ffff7777 7700ffff Data: ffffffff ffff0000 00ffffff ffffff00 Data: 00000000 00bbccd5 bbccd5bb ccd5bbcc Data: d5bbccd5 99999999 99990000 00000000 Data: 00ffffff bbccd577 777700ff ff777777 Data: 00ffff77 777700ff ff888888 888888ff Data: ffffffff ffffffff 00000000 00000000 Data: 00bbccd5 bbccd5bb ccd5bbcc d5bbccd5 Data: 99999999 99990000 00000000 00ffffff Data: 00ffff00 ffff7777 7700ffff 00ffff00 Data: ffff00ff ff00ffff 00ffffff ffffffff Data: ff000000 00000000 0000bbcc d5bbccd5 Data: bbccd5bb ccd5bbcc d5bbccd5 99999999 Data: 99990000 00000000 00ffffff bbccd5bb Data: ccd57777 7700ffff 00ffff00 ffff0000 Data: 00000000 ffffffff ffff0000 00000000 Data: 00000000 0000bbcc d5bbccd5 bbccd5bb Data: ccd5bbcc d5bbccd5 99999999 99990000 Data: 00000000 00ffffff bbccd577 777700ff Data: ff777777 00ffff77 777700ff ff000000 Data: 00000000 00000000 00000000 000000bb Data: ccd5bbcc d5bbccd5 bbccd5bb ccd5bbcc Data: d5bbccd5 99999999 99990000 00000000 Data: 00ffffff 77777700 ffffbbcc d5777777 Data: 00ffffbb ccd57777 7700ffff 00000000 Data: 00000000 00bbccd5 bbccd5bb ccd5bbcc Data: d5bbccd5 bbccd5bb ccd5bbcc d5bbccd5 Data: 99999999 99990000 00000000 00ffffff Data: 00ffffbb ccd50000 00777777 00ffffbb Data: ccd5bbcc d5777777 00ffffbb ccd5bbcc Data: d5bbccd5 bbccd5bb ccd5bbcc d5000000 Data: 000000bb ccd5bbcc d5bbccd5 99999999 Data: 99990000 00000000 00ffffff bbccd5bb Data: ccd50000 00777777 00ffffbb ccd5bbcc Data: d5bbccd5 bbccd5bb ccd5bbcc d5bbccd5 Data: bbccd5bb ccd5bbcc d5000000 000000bb Data: ccd5bbcc d5bbccd5 99999999 99990000 Data: 00000000 00ffffff ffffffff ffffffff Data: ffffffff ffffffff ffffffff ffffffff Data: ffffffff ffffffff ffffffff ffffffff Data: ffffffff ffffffff ffffffff ffffffff Data: ffffffff ffffff99 99990000 0000bbcc Data: d5000000 00000000 00000000 00000000 Data: 00000000 00000000 00000000 00000000 Data: 00000000 00000000 00000000 00000000 Data: 00000000 00000000 00000000 00000000 Data: 00000000 0000bbcc d5000000 00000001 Data: 00180007 00200001 00020000 00000000 Data: 0000 ) (Numb.11 N: 30.00000000000000 ) (List.12 ) (List.13 ) (Script.14 Name: "Projector!mod" SourceCode: "' Name: Projector!mod \n' History: Modified from the Projector! extension to include \n' transferring theme names and legend labels to the reprojected themes.\n' 05/18/1999 - Brian Torreano - USEPA - FIELDS div. \n'\n' Headline: Allows user to project themes from one projection \n' to another, using any projections ArcView supports. User must \n' know the input and output projection and units. \n'\n' Self: \n'\n' Returns:\n'\n' Description: Projects active fthemes in current view to \n' new shape files in any project ion that ArcView supports, \n' projecting into units of feet, meters or decimal degrees. \n' The user must know the units (and projection) of the input \n' theme(s), and will be asked for the output units and projection.\n'\n' If neither input or output projection is geographic, \n' then the user must have 2x the amount of space of the original \n' shape file, as this script writes a temporary shapefile in geographic\n' coordinates, projects that to the output projection and \n' deletes the temporary files (much fas ter than stepping through records).\n'\n' Attach this as the click script to a control in a View GUI.\n'\n' Topics: Conversion, Themes\n'\n' Search Keys: Project, projections, theme, units, convert\n'\n' Requires: Fthemes in a view with the map units set, and a \n' knowledge of the projection of the themes.\n'===========================================================\n\n'check for shift key, if shift key is down pop up instructions\n\n'explain script, pops up a message with\n'info about how to use\n\nif (System.IsShiftKey Down) then\n message =\n \"To use the projection tool you must know the map units and projection\"++\n \"of the datasets being projected. You will be prompted for the output units and projection.\"+nl+nl+\n \"Brief Instructions:\"+nl+nl+\n \"1. Add some themes to the view.\"+nl+nl+\n \"2. Set the map units appropriately in the View Properties window.\"+nl+nl+\n \"3. Make the theme(s) you wish to project active.\"+nl+nl+\n \"4. Press this button. You will be prompted for certain information\"++\n \"whic h may include the input projection, the output units and the\"++\n \"output projection.\"+nl+nl+\n \"5. You will be asked if you want to recalculate area, perimeter and length fields.\"+nl+nl+\n \"WARNING - If the field to be recalculated is not large enough to hold the new \"+\n \"(calculated) number, the value put in that field will be incorrect.\"+nl+nl+\n \n \"6. You will be asked if you want to add the projected theme(s) to a view.\"+nl+nl+\n \"7. You will be asked for output shapefile names for each theme to be projected.\"+nl\n \n msgbox.report(message,\"Projector!mod Instructions\")\n return nil\nend\n\n\n'get the active document, which should be a view\n\ntheView=av.GetActiveDoc\n\nif (theView.Is(View).Not) then\n MsgBox.Error(\"This script must be run from a view. Exiting\",\"Error\")\n return nil\nend\n\n'Get the name of the original view **\n\norigView=theView.GetName\n\n'Get the current source units and make sure they are not unknown\n\nsourceunits = av.getactivedoc.getdisplay.getunits\n\nif (sourceunits = #U NITS_LINEAR_UNKNOWN) then\n MsgBox.Error(\"View units must be set before projecting. Stopping.\",\n \"Error!\")\n return nil\nend\n\n\n'build a list of fthemes from the active theme list, we will project these\nthms=List.Make\nfor each t in theView.GetActiveThemes\n if (t.Is(Ftheme)) then\n thms.Add(t)\n end\nend\n\n'if no themes active let the user know and quit\n\nif (thms.Count = 0) then\n System.Beep\n MsgBox.Error(\"Please make at least one feature theme active!\",\"Error\")\n return nil\nend\n\n \n'Get the projection of the view\n\nmyprj=av.getactivedoc.getprojection\n\n'Try to figure out if the source data is geographic \n' If our Prj.AsString <> \"\" then we have a projection and we are\n' geographic, or if our sourceunits are set to decimal degrees without\n' a projection we are too\n\ninputgeographic =((myprj.AsString <> \"\") or\n ((sourceunits = #UNITS_LINEAR_DEGREES) and (myprj.AsString = \"\")))\n\n'If not, then let user pick input and output\n\nif (inputgeographic.Not) then\n\n Msgbox.Info(\"Please select the input projection\"++\n \"in the next dialog box\",\"Projector!mod\")\n \n 'Pop up dialog box, to get input projection\n 'and check for cancel button (nil)\n \n inputPrj = ProjectionDialog.Show(theView,sourceunits)\n if (inputPrj.IsNull) then\n return nil\n end\n \n 'Pop up dialog box, to get output projection\n 'and check for cancel button (nil)\n \nelse 'your input projection is geographic\n sourceunits = #UNITS_LINEAR_DEGREES\nend\n\nunitslist1 = {\"meters\",\"feet\",\"decimal degrees\",\"miles\",\"kil ometers\",\"yards\",\n \"centimeters\",\"inches\",\"millimeters\"}\n\nunitslist2 = {#UNITS_LINEAR_METERS, #UNITS_LINEAR_FEET,\n #UNITS_LINEAR_DEGREES, #UNITS_LINEAR_MILES,\n #UNITS_LINEAR_KILOMETERS, #UNITS_LINEAR_YARDS,\n #UNITS_LINEAR_CENTIMETERS, #UNITS_LINEAR_INCHES,\n #UNITS_LINEAR_MILLIMETERS}\n \noutputunits = MsgBox.ChoiceAsString(unitslist1,\n \"Please pick output units\",\"Projector!mod\")\n\n\nif (outputunits = nil) the n\n return nil\nelse \n outunits = unitslist2.Get(unitslist1.FindByValue(outputunits))\nend\n\n'get the output projection, using the dialog box and check for cancel (nil)\nif (outputunits = \"decimal degrees\") then\n outputPrj = prj.MakeNull\n outputPrj.SetDescription(\"Geographic\")\n outputgeographic = true\nelse\n outputPrj = ProjectionDialog.Show(theView,outunits)\nend\n\nif (outputPrj = nil) then\n return nil\nend\n\n'check to see if they are the same. If so, exit\n \nif ((inputgeographic.Not) and ((outputPrj = inputP rj) and (sourceunits = outunits))) then\n MsgBox.Error(\"Input projection same as output projection.\",\"Error\")\n return nil\nend\n\n\n'check to see if output projection is geographic. If it is, we won't need\n'to do as much work below\n\noutputgeographic = outputPrj.ReturnDescription.Contains(\"Geographic\")\n\n'if both input and output are geographic, quit here\n\nif (inputgeographic and outputgeographic) then\n MsgBox.Error(\"Both input and output are geographic. Stopping.\",\"Error\")\n return nil\nend\n\n'check to see if w e want to recalculate area, perimeter, length fields\n\nrecalc = Msgbox.YesNo(\"Recalculate area, perimeter and length fields\"++\n \"(if present) using\"++outputunits+\"?\",\"Projector!mod\",true)\n \n'check to see if we want to put results into a view\n \nif (MsgBox.YesNo(\"Add projected shapefile(s) as theme(s) to a view?\",\n \"Projector!mod\",true)) then\n\n 'provide a choice to retain theme names and legend files **\n\n keepThemes = MsgBox.YesNo(\"Retain theme names and legend files for th e\"+nl+\n \"new view?\",\"Theme names\",TRUE)\n\n if (keepThemes = nil or keepThemes = FALSE) then\n retainNames = FALSE\n else\n retainNames = TRUE\n end '**\n \n\n 'make a list of views\n viewlist = List.Make\n for each d in av.GetProject.GetDocs\n if (d.Is(View)) then\n viewlist.Add(d)\n end\n end 'for each d\n \n 'provide a choice for a new view\n viewlist.Add(\"\")\n \n AddToView = MsgBox.ListAsString(viewlist,\"Add Theme to:\", \n \"Projector!mod\")\n \n if (AddToV iew <> nil) then\n if (AddToView = \"\") then\n AddToView = View.Make\n AddToView.GetWin.Open\n end\n end\nelse 'don't add to view\n AddtoView = nil\nend\n\n\n\n'step through each active theme\n\nFor each thm in thms\n\n 'get the original theme name and legend **\n \n\n theName = thm.GetName\n aLegend = thm.GetLegend\n theLegend = aLegend.Clone '**\n \n\n 'get a filename for the new shapefile and \n 'set CWD if batch reprojecting\n \n defname = Filename.GetCWD.MakeTmp(\"theme\",\"shp\") \n outputfile = FileDialog.Put(defname,\"*.shp\",\"Project \"+thm.GetName)\n \n 'if Canceled, then skip this theme\n \n if (outputfile = nil) then\n continue\n end\n \n 'now export the ftab (selected records only), \n \n thmftab = thm.GetFtab\n shapetype = thmftab.FindField(\"Shape\").GetType\n \n if (outputgeographic) then\n newFtab = thmFtab.ExportUnprojected(outputfile,inputPrj,\n thmFtab.GetSelection.Count >0)\n elseif (inputgeographic) then\n newFtab = thmFtab.ExportProjected(outputfil e,outputPrj,\n thmFtab.GetSelection.Count > 0)\n else 'need to go to geographic, then to something else\n 'make a temporary shape file\n tempshape = Filename.GetCWD.MakeTmp(\"xxprj\",\"shp\")\n tempftab = thmFtab.ExportUnprojected(tempshape,\n inputPrj,thmFtab.GetSelection.Count >0)\n newFtab = tempFtab.ExportProjected(outputfile,outputPrj,false)\n \n 'now clean up\n tempftab.DeActivate\n tempftab = nil\n av.PurgeObjects\n tempshpname = tempshape.GetBa seName.AsTokens(\".\").Get(0)\n tempshpdir = tempshape.GetFullName.Clone.AsFilename\n tempshpdir.Stripfile\n filesToDelete = tempshpdir.Readfiles(tempshpname+\".*\")\n \n for each f in filesToDelete\n File.Delete(f)\n end\n end\n \n 'recalculate area, perim, length fields if asked to\n \n if (recalc) then\n \n 'find the fields we need to recalculate\n newareafield = newftab.Findfield(\"Area\")\n newperimfield = newftab.Findfield(\"Perimeter\")\n newlengthfield = newftab.Findfield(\"Length\")\n \n newftab.SetEditable(True)\n if (shapetype = #FIELD_SHAPEPOLY) then\n if (newareafield <> nil) then\n newftab.Calculate(\"[Shape].ReturnArea\",newareafield)\n end\n if (newperimfield <> nil) then\n newftab.Calculate(\"[Shape].ReturnLength\",newperimfield)\n end\n elseif (shapetype = #FIELD_SHAPELINE) then\n if (newlengthfield <> nil) then\n newftab.Calculate(\"[Shape].ReturnLength\",newlengthfield)\n end\n end\n newftab.SetEditable(false)\n end 'if recalc\n \n if (addtoView <> nil) then\n 'create a theme and add it to the specifiedView\n fthm = FTheme.Make(newFTab)\n AddToView.AddTheme(fthm)\n 'set the name and legend **\n if (retainNames = TRUE) then\n fthm.SetName(theName)\n fthm.SetLegend (theLegend)\n fthm.UpdateLegend \n end '**\n 'put this theme in the same order as it was in the original view\n 'newplace = AddtoView.GetThemes.Count\n AddToView.GetThemes.Shuffle(fthm,0)\n end\n \nend 'for each thm\n\nif (addtoVi ew <> nil) then\n\n 'if view units aren't set, then set them\n if (AddtoView.GetDisplay.GetUnits = #UNITS_LINEAR_UNKNOWN) then\n AddtoView.GetDisplay.SetUnits(outunits)\n end\n \n 'bring the View to the front\n\n AddToView.InvalidateTOC(nil)\n AddToView.GetWin.Activate\nend" ) (Script.15 Name: "My Extension Install" SourceCode: "'DO NOT EDIT!!!\n\nif (av.getproject=nil) then return(nil) end\n\n\ntheDocs = SELF.get(0)\ntheControlList = SELF.get(1)\ntheMenuList = SELF.get(2)\ntheToolMenuList=SELF.Get(3)\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'\nfor each totalControl in theControlList\n 'The Control list\n acontrol=totalControl.get(0)\n \n 'The physical control\n theControl = totalControl.get(1)\n \n 'The control Index\n theCindex=totalControl.get(2)\n\n 'Find the DocGUI\n theControlDoc=av.getproject.findGUI(aControl.get(0))\n if (theControlDoc=NIL) then \n MsgBox.Warning(\"The GUI \"+aControl.get(0)+\" cannot be found in the current project.\",\"Script Eror\")\n return(nil)\n end\n \n 'This finds the control set \n thecommand=\"av.getproject.findGUI(\"\"\"+aControl.get(0)+\"\"\").Get\"+acontrol.get(1)\n thescript1=Script.Make(thecommand)\n thecontrolset=thescript1.doit(\"\")\n \n 'Add the control to the control set\n theControlSet.Add(theControl,theCindex )\nend\n\n\n'Add the menus\nfor each totalcontrol in theMenuList\n \n 'The Control list\n acontrol=totalControl.get(0)\n mDoc=acontrol.get(0)\n mMenu=acontrol.get(1)\n mMenuItem=acontrol.get(2)\n\n 'The physical control\n theControl = totalControl.get(1)\n \n 'The control Index\n theCindex=totalControl.get(2)\n\n 'Find the DocGUI\n theControlDoc=av.getproject.findGUI(aControl.get(0))\n if (theControlDoc=NIL) then \n MsgBox.Warning(\"The GUI \"+aControl.get(0)+\" cannot be found in the c urrent project.\",\"Script Eror\")\n return(nil)\n end\n \n theMbar=av.getproject.findGUI(mDoc).GetMenuBar\n themenu=theMbar.findbylabel(mMenu)\n if (themenu=NiL) then\n themenu=menu.make\n themenu.setlabel(mMenu)\n theMbar.add(themenu,999)\n end\n \n themenu.add(thecontrol, theCindex)\nend\n \n \n'Add the Tool Menus\n\nfor each totalControl in theToolMenuList\n 'The Control list\n acontrol=totalControl.get(0)\n \n 'The physical control\n theControl = totalControl.get(1)\n \n 'The con trol Index\n theCindex=totalControl.get(2)\n\n 'Find the DocGUI\n theControlDoc=av.getproject.findGUI(aControl.get(0))\n if (theControlDoc=NIL) then \n MsgBox.Warning(\"The GUI \"+aControl.get(0)+\" cannot be found in the current project.\",\"Script Eror\")\n return(nil)\n end\n \n 'This finds the control set \n thecommand=\"av.getproject.findGUI(\"\"\"+aControl.get(0)+\"\"\").Get\"+acontrol.get(1)\n thescript1=Script.Make(thecommand)\n thecontrolset=av.getproject.findGUI(aControl.get(0)).GetToolBa r\n \n 'Add the control to the control set\n theControlSet.Add(theControl,theCindex)\nend\n\n\nav.getproject.setmodified(true)\n\n\n'And the scripts add themselves\n" ) (Script.16 Name: "My Extension Uninstall" SourceCode: "'DO NOT EDIT!!!\n\n'The SELF is the Extension\n\ntheDocs = SELF.get(0)\ntheControlList = SELF.get(1)\ntheMenuList = SELF.get(2)\ntheToolMenuList=SELF.get(3)\ntheProject=Av.getproject\n\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 totalControl 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 sequence finds the appropiate control set\n thecommand= \"av.getproject.findGUI(\"\"\"+aControl.get(0)+\"\"\").Get\"+acontrol.get(1)\n thescript1=Script.Make(thecommand)\n thecontrolset=thescript1.doit(\"\")\n\n 'See if the control is in the set , if so remove it\n if (theControlSet.GetControls.find(theControl)<>NIL) then\n theControlSet.remove(theControl)\n if (thecontrol = \"ToolBar\") then\n theControlSet.selectdefault\n end\n end\nend\n\n\n'Remove the Menus\n'\nfor each totalcontrol in theMenuList\n \n 'The Control list\n acontrol=totalControl.get(0 )\n mDoc=acontrol.get(0)\n mMenu=acontrol.get(1)\n mMenuItem=acontrol.get(2)\n\n 'The physical control\n theControl = totalControl.get(1)\n \n 'The control Index\n theCindex=totalControl.get(2)\n\n 'Find the DocGUI\n theControlDoc=av.getproject.findGUI(aControl.get(0))\n if (theControlDoc=NIL) then \n MsgBox.Warning(\"The GUI \"+aControl.get(0)+\" cannot be found in the current project.\",\"Script Eror\")\n return(nil)\n end\n \n theMbar=av.getproject.findGUI(mDoc).GetMenuBar\n themenu=theMbar.findbylabel(mMenu)\n if (themenu=NiL) then\n MsgBox.Warning(\"The menu named \"+mMenu+\" is not here.\",\"Script Eror\")\n 'return(nil)\n else\n \n thething=themenu.getcontrols.find(thecontrol)\n if (thething<>NIL) then \n themenu.remove(thecontrol) \n end\n 'msgbox.info(themenu.GetControls.count.asstring,\"\")\n if (themenu.GetControls.count<1) then\n theMbar.remove(themenu)\n end\n end\nend\n \nfor each totalControl in theToolMenuList\n 'Get the control list from the Ext\n acontrol=totalControl.get(0)\n \n 'Get the physical Control\n theControl = totalControl.get(1)\n \n 'Get the Controls Index\n theCindex=totalControl.get(2)\n\n 'Find the DocGUI for the Control\n theControlDoc=av.getproject.findGUI(aControl.get(0))\n if (theControlDoc=NIL) then \n MsgBox.Warning(\"The GUI \"+aControl.get(0)+\" cannot be found in the current project.\",\"Script Eror\")\n return(nil)\n end\n \n 'This sequence finds the appropiate control set\n thecontrolset=av.getp roject.findGUI(aControl.get(0)).GetToolBar\n\n \n 'See if the control is in the set , if so remove it\n if (theControlSet.GetControls.find(theControl)<>NIL) then\n \n theControlSet.remove(theControl)\n theControlSet.selectdefault\n end\n\nend\n \n\n'And the scripts delete themselves\n\n\nav.getproject.setmodified(true)\n" )