/3.1 (Extension.1 Name: "Point Finder" FirstRootClassName: "List" Roots: 2 Roots: 3 Roots: 20 Roots: 21 Roots: 22 Roots: 23 Roots: 24 Version: 31 About: "This extension finds a point with the LAT/LONG or gives the LAT/LONG of a known point" InstallScript: 25 UninstallScript: 26 ExtVersion: 1 ) (List.2 ) (List.3 Child: 4 Child: 12 ) (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: "FindPoint" ) (Butn.9 Help: "Finds a Point //Finds a Point using the Latitude and Longtitude in Degrees, Minutes, and Seconds" HelpTopic: " " Icon: 10 Click: "FindPoint" ) (AVIcon.10 Name: "AddMatch" Res: "Icons.AddMatch" ) (Numb.11 N: 23.00000000000000 ) (List.12 Child: 13 Child: 17 Child: 19 ) (List.13 Child: 14 Child: 15 Child: 16 ) (AVStr.14 S: "View" ) (AVStr.15 S: "ToolBar" ) (AVStr.16 S: "FindDMS" ) (Tool.17 Help: "Finds the Lat/Long//Finds the Latitude and Longtitude, in Degrees, Minutes, and Seconds, of a Point " Icon: 18 Cursor: "Cursors.Bullseye" Apply: "FindDMS" ) (AVIcon.18 Name: "XY" Res: "Icons.XY" ) (Numb.19 N: 14.00000000000000 ) (List.20 ) (List.21 ) (Script.22 Name: "View.New" SourceCode: "' Veiw.New (Modified by Carl Kinkade 3/5/1999)\n\nnewView = View.MakeWithGUI(av.GetProject.GetSelectedGUI.GetName)\nnewView.GetWin.Open\n\n\n'\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\n'Added by Carl Kinkade\n'Set the project projection to the Lancaster County Projection\nmyPrj = TrnMerc.Make(Rect.MakeXY(-180,-90,180,90)) \nmyPrj.SetDescription(\"TRANSVERSE\") \nmyPrj.SetCentralMeridian(-96.68805556) \nmyPrj.SetReferenceLatitude(40.25) \nmyPrj.SetScale(1.000054615) \nmyPrj.SetFalseEasting(50000) \nmyPrj.SetFalseNort hing(0) \nmyPrj.SetSpheroid(#SPHEROID_GRS80)\nnewView.SetProjection(myPrj)\n\n'Set the map units and distance units to feet\nnewView.SetUnits(#UNITS_LINEAR_FEET)\nnewView.GetDisplay.SetDistanceUnits(#UNITS_LINEAR_FEET)\nMsgBox.Info(\"View Projection set to the Lancaster County Projection\",\"PROJECTION MODIFICATION\")\n'\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\n" ) (Script.23 Name: "FindPoint" SourceCode: "'Find a point using Latitude and Longtitude\n'Carl Kinkade\n'3/11/1999\n'A modified version of Edmar Moretti's siuc_vis.ave 11/5/1998\n\n\nnumber.setdefformat(\"d.dddddd\")\n\ntheView = av.GetActiveDoc\ntheDisplay = theView.GetDisplay\ntheGraphics = theView.GetGraphics\n'\n' options for the menu entrance\n'\nlabels = { \"Longtitude Degrees:\", \"Longtitude Minutes:\", \"Longtitude Seconds:\",\"Latitude Degrees:\", \"Latitude Minutes:\", \"Latitude Seconds:\"}\ndefaults = { \"-96\", \"0\", \"0\",\"40\",\"0\",\"0\"}\norder = MsgBox.MultiInput( \"Enter Coordinates:\", \"Lat Long\", labels, defaults )\n'\nif (order.IsEmpty) then\n system.Playsound(\"c:\\sig\\arcview\\oou.wav\".AsFilename,true)\n exit\nend\n'\n' Convert DMS to Decimal Degrees\n'\n longG = order.Get(0).AsNumber\n longM = order.Get(1).AsNumber\n longS = order.Get(2).AsNumber\n if (longG < 0) then\n factor = -1 \n else\n factor = 1\n end\n longG = longG * factor \n seg1 = longM * 60\n seg2 = seg1 + longS\n seg3 = seg2 / 3600\n longDD = longG + seg3\n longDD = longDD * factor\n'\n latG = order.Get(3 ).AsNumber\n latM = order.Get(4).AsNumber \n latS = order.Get(5).AsNumber\n if (latG < 0) then\n factor = -1\n else\n factor = 1\n end\n latG = latG * factor\n seg1 = latM * 60\n seg2 = seg1 + latS\n seg3 = seg2 / 3600\n latDD = latG + seg3\n latDD = latDD * factor\n'\n' Define a point\n'\npt = (longDD@latDD)\n'\n' Project the DMS as needed\n'\nthePrj = theView.GetProjection\ntheproj = thePrj.AsString\naSpheroid = thePrj.GetSpheroid\ntheSpheroid = aSpheroid.GetSpheroidName\nif ((theproj = \"Transverse Mercator\") and (theSpheroid = \"GRS 80\")) then\n pt = pt.ReturnProjected(thePrj)\nelse\n MsgBox.Info(\"View Projection set to the Lancaster County Projection\",\"PROJECTION MODIFICATION\")\n '\n 'Set the map units and distance units to feet\n '\n theView.SetUnits(#UNITS_LINEAR_FEET)\n theView.GetDisplay.SetDistanceUnits(#UNITS_LINEAR_FEET)\n '\n 'Set the project projection to the Lancaster County Projection\n '\n myPrj = TrnMerc.Make(Rect.MakeXY(-180,-90,180,90)) \n myPrj.SetDescription(\"TRANSVERSE\") \n myPrj.SetCentralMeridian(-96.68805 556) \n myPrj.SetReferenceLatitude(40.25) \n myPrj.SetScale(1.000054615) \n myPrj.SetFalseEasting(50000) \n myPrj.SetFalseNorthing(0) \n myPrj.SetSpheroid(#SPHEROID_GRS80)\n theView.SetProjection(myPrj)\n thePrj = theView.GetProjection\n '\n 'Redraw the view and zoom to the themes\n '\n av.GetProject.SetModified(true)\n theView = av.GetActiveDoc\n theThemes = theView.GetActiveThemes\n r = Rect.MakeEmpty\n for each t in theThemes\n r = r.UnionWith(t.ReturnExtent)\n end\n\n if (r.IsEmpty) then\n return nil\n elseif ( r.ReturnS ize = (0@0) ) then\n theView.GetDisplay.PanTo(r.ReturnOrigin)\n else\n theView.GetDisplay.SetExtent(r.Scale(1.1))\n end\n '\n 'Add the point to the view\n pt = pt.ReturnProjected(thePrj)\n '\n 'Zoom to the XY Location\n '\n theDisplay.PanTo(pt)\n theDisplay.ZoomToScale(800)\nend\n' define the type\n'\nListaType = {}\nListaType.Add (\"Draw a Point\")\nListaType.Add (\"Add a Point to a Theme\")\n'\nwhatType = MsgBox.ListAsString ( ListaType, \"\", \"Add a Point\") \nif (whatType = Nil) then\n exit\nend\n'\n' Draw a point\n'\nif ( whatType = \"Draw a Point\" ) then\n gpoint = GraphicShape.make( pt )\n gpoint.GetSymbol.SetColor( color.GetRed )\n gpoint.Getsymbol.SetSize ( 14 )\n theGraphics.add (gpoint)\nend\n'\n' \nif (whatType = \"Add a Point to a Theme\") then\n ListaShape = {}\n for each th in theView.GetThemes\n if (th.GetSrcName.AsString.Contains(\"shp\")) then\n if (th.GetSrcname.GetSubname.AsString.Contains (\"Point\")) then\n th.AsString\n ListaShape.add(th)\n end\n end\n end \n Destination= MsgBox.choice(ListaShape,\"Sele ct a Theme\",\"Insert Point\")\n if (Destination = Nil) then\n exit\n end\n Destination.SetActive(True)\n TheView.SetEditableTheme(Destination)\n theTheme = Destination\n thePrj = theView.GetProjection\n if (thePrj.IsNull.Not) then\n pt = pt.ReturnUnprojected(thePrj)\n end\n theField = theTheme.GetFTab.FindField(\"Shape\")\n theTheme.GetFTab.BeginTransaction\n rec = theTheme.GetFTab.AddRecord\n theTheme.GetFTab.SetValue(theField, rec, pt)\n theTheme.GetFTab.EndTransaction\n theTheme.GetFTab.GetSelection.Cle arAll\n theTheme.GetFTab.GetSelection.Set(rec)\n gp = thetheme.getftab.getselection\n theTheme.GetFTab.UpdateSelection \n av.GetProject.SetModified(true)\n' TheView.SetEditableTheme(NIL)\n' ext = TheView.returnExtent\n' TheDisplay.SetExtent(ext)\nend\n" ) (Script.24 Name: "FindDMS" SourceCode: "' Finds the Latitude and Longtitude of a point in Lancaster County\n' Carl Kinkade\n' 3/4/1999\n' This is a modified version of the showgeo.ave written by Edmar Moretti 11/5/1998\n'\n'\n'\nnumber.setdefformat(\"d.dddddd\")\n\ntheView = av.GetActiveDoc\nproj = theView.Getprojection\ntheproj = proj.AsString\naSpheroid = proj.GetSpheroid\ntheSpheroid = aSpheroid.GetSpheroidName\n\n' Check for the Lancaster County Projection\nif ((theproj = \"Transverse Mercator\") and (theSpheroid = \"GRS 80\")) then\n\n p = theView.GetDisplay.Return UserPoint.ReturnUnprojected(proj)\n\n else\n \n MsgBox.Info(\"View Projection set to the Lancaster County Projection\",\"PROJECTION MODIFICATION\")\n \n 'Set the map units and distance units to feet\n theView.SetUnits(#UNITS_LINEAR_FEET)\n theView.GetDisplay.SetDistanceUnits(#UNITS_LINEAR_FEET)\n \n 'Set the project projection to the Lancaster County Projection\n myPrj = TrnMerc.Make(Rect.MakeXY(-180,-90,180,90)) \n myPrj.SetDescription(\"TRANSVERSE\") \n myPrj.SetCentralMeridian(-96.68805556) \n myPrj.SetReferenceLatitude(40. 25) \n myPrj.SetScale(1.000054615) \n myPrj.SetFalseEasting(50000) \n myPrj.SetFalseNorthing(0) \n myPrj.SetSpheroid(#SPHEROID_GRS80)\n theView.SetProjection(myPrj)\n theView = av.GetActiveDoc\n proj = theView.GetProjection\n \n 'Redraw the view and zoom to the themes\n av.GetProject.SetModified(true)\n theView = av.GetActiveDoc\n theThemes = theView.GetActiveThemes\n r = Rect.MakeEmpty\n for each t in theThemes\n r = r.UnionWith(t.ReturnExtent)\n end\n\n if (r.IsEmpty) then\n return nil\n elseif ( r.ReturnSize = (0@0) ) t hen\n theView.GetDisplay.PanTo(r.ReturnOrigin)\n else\n theView.GetDisplay.SetExtent(r.Scale(1.1))\n end\n\n ' Get the point and unproject it \n p = theView.GetDisplay.ReturnUserPoint.ReturnUnprojected(proj)\n \nend\nx = p.Getx\ny = p.Gety\n\n'\n' convert decimal degrees to DMS\n'\nlongG = x.asString.Substitute (\".\",\" \").Extract(0)\ns = x.asString.Substitute (\".\",\" \").Extract(1)\nseg1g = 0\nseg2g = 0\nif (s <> nil) then\n s = \"0.\"+s\n s2 = s.asnumber * 60\n seg1g = s2.asString.Substitute (\".\",\" \").Extract(0)\n s = s2.asStri ng.Substitute (\".\",\" \").Extract(1)\n s = \"0.\"+s\n seg2g = s.asnumber * 60\nend\nlatG = y.asString.Substitute (\".\",\" \").Extract(0)\nseg1l = 0\nseg2l = 0\ns = y.asString.Substitute (\".\",\" \").Extract(1)\nif (s <> nil) then\n s = \"0.\"+s\n s2 = s.asnumber * 60\n seg1l = s2.asString.Substitute (\".\",\" \").Extract(0)\n s = s2.asString.Substitute (\".\",\" \").Extract(1)\n s = \"0.\"+s\n seg2l = s.asnumber * 60\nend\n\n'msgbox.warning(\"Coordinates in Decimal Degrees:\"++x.AsString+\",\"+y.AsString+NL+\"Long.:\"++longG.asstring+\"° \"\n'+se g1g.AsString+\"' \"+seg2g.AsString+\"''\"+NL+\"Lat.: \"++latG.asstring+\"° \"\n'+seg1l.AsString+\"' \"+seg2l.AsString+\"''\",\"Coordinates in Geo\")\nlabels = {\"Decimal Degrees \",\"Longitude:\",\"Latitude:\"}\ndefaults = {x.AsString+\",\"+y.AsString,longG.asstring+\"° \"+seg1g.AsString+\"' \"+seg2g.AsString+\"''\",\n latG.asstring+\"° \"+seg1l.AsString+\"' \"+seg2l.AsString+\"''\"}\norder = MsgBox.MultiInput( \" \",\"Point Coordinates\", labels, defaults)\nif (order.isempty) then\n exit\nend\n" ) (Script.25 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.26 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" )