/3.1 (Extension.1 Name: "General Utilities" FirstRootClassName: "List" Roots: 2 Roots: 3 Roots: 12 Roots: 13 Roots: 14 Roots: 15 Version: 31 About: "This extension contains general utilities." InstallScript: 16 UninstallScript: 17 ExtVersion: 3 ) (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: "View.ShowDD2" ) (Butn.9 Help: "Shows decimal degrees in a projected view//" Icon: 10 Click: "View.ShowDD2" ) (AVIcon.10 Name: "Star" Res: "Icons.Star" ) (Numb.11 N: 21.00000000000000 ) (List.12 ) (List.13 ) (Script.14 Name: "View.ShowDD1" SourceCode: "'Script 1 - copy this into a script called View.ShowDD1\n'and uncomment the next 3 lines:\nif (av.GetActiveDoc.GetClass.GetClassName = \"View\") then\n av.DelayedRun(\"View.ShowDD2\", nil, 0.5)\nend\n" ) (Script.15 Name: "View.ShowDD2" SourceCode: "' Name: View.ShowDD2\n'\n' Title: Displays decimal degree values in the status\n' bar of a projected view.\n'\n' Topics: View\n'\n' Description: Displays decimal degree coordinates in a view's status\n' bar as you move the cursor around.\n'\n' Requires: A projected view.\n' Must be an Apply event on a view's tool bar.\n'\n' This file contains TWO scripts - one is called recursively\n' by the other, so you must be careful that you give the\n' scripts the proper names.\n'\n' DIRECTIONS:\n' 1. Copy this file into a script editor, and\n' call the script View.ShowDD2.\n' 2. Copy the Script 1 section below into a new script\n' editor, and call the script View.ShowDD1.\n' 3. Uncomment the 3 lines of code in View.ShowDD1.\n' 4. Create a new tool on a View's tool bar, and\n' make View.ShowDD2 its Click event script ..\n' 5. Make the new tool active, then click once\n' inside the view to activate. To deactivate,\n' make any non-view the active document.\n'\n' How it works: When you use the new tool on a view,\n' View.ShowDD2 verifies that the window is a View,\n' then runs View.ShowDD1, which reports the unprojected\n' coordinates in the View's status bar. View.ShowDD2\n' recursively calls View.ShowDD1. These scr ipts loop twice\n' per second which returns the cursor position as the\n' mouse scrolls across the View.\n'\n' Self: \n'\n' Returns:\n'\n' Version: 3.1\n\n'\n'Script 1 - copy this into a script called View.ShowDD1\n'and uncomment the next 3 lines:\n'if (av.GetActiveDoc.GetClass.GetClassName = \"View\") then\n' av.DelayedRun(\"View.ShowDD2\", nil, 0.5)\n'end\n'\n'\n'Script 2 - call this script View.ShowDD2:\n'\ntheDoc = av.GetActiveDoc\nthePoint = theDoc.GetDisplay.ReturnUserPoint\ntheDDPoint = theP oint.ReturnUnprojected(theDoc.GetProjection)\ntheLon = theDDPoint.GetX.SetFormat(\"dd.dddd\")\ntheLat = theDDPoint.GetY.SetFormat(\"dd.dddd\")\ntheMsg = \" Position = \"+theLon.AsString+\", \"+theLat.AsString\nav.ShowMsg(theMsg)\nSystem.RefreshWindows\nav.Run(\"View.ShowDD1\", nil)\n" ) (Script.16 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.17 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" )