/3.1 (Extension.1 Name: "Grid Projector" Dependencies: "$AVEXT/dialog.avx\n$AVEXT/dlogcore.___\n$AVEXT/spatial.avx\n" FirstRootClassName: "PMenu" Roots: 2 Roots: 3 Roots: 4 Roots: 5 Roots: 6 Roots: 7 Roots: 8 Roots: 9 Roots: 10 Roots: 11 Roots: 12 Roots: 13 Roots: 14 Roots: 15 Roots: 16 Roots: 17 Roots: 18 Roots: 19 Roots: 20 Roots: 21 Roots: 22 Roots: 23 Roots: 24 Roots: 48 Roots: 112 Version: 31 About: "Grid Projector for BASINS, February 19, 2001. This extension provides a set of tools for Reprojecting and datum converting grid data This extension requires Spatial Analyst Extension ver.1.1 or later. Developed for EPA by Blackland Research Center - (TAES) Texas A&M University System. Temple, TX" UnloadScript: 118 InstallScript: 119 UninstallScript: 120 ExtVersion: 1 ) (PMenu.2 Child: 3 Label: "Data" ) (Choice.3 Label: "Grid Projector" Click: "basins3.GridProjector" Shortcut: "Keys.None" ) (Script.4 Name: "basins3.addGridtoView" SourceCode: "'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n'***Add the output grid to a view**********\n'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n\n n = Grid.MakeSrcName(self.get(0))\n outTheme = Theme.Make(n)\n if (_dicGridProjector.get(\"aView\") <> nil) then\n _dicGridProjector.get(\"aView\").AddTheme(outTheme)\n outTheme.setVisible(true)\n outTheme.setActive(true)\n _dicGridProjector.get(\"aView\").getWin.Activate\n av.GetProject.SetModified(true)\n theThemes = _dicGridProjector.get(\"aView\").GetActiveThemes\n r = Rect.MakeEmpty\n \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) ) then\n _dicGridProjector.get(\"aView\").GetDisplay.PanTo(r.ReturnOrigin)\n else\n _dicGridProjector.get(\"aView\").GetDisplay.SetExtent(r.Scale(1.1))\n end\n end\n\n return nil" ) (Script.5 Name: "basins3.brc.GridProjector.CenterDialog" SourceCode: "' ----------------------------------- \n \n theDialog = Self\n \n AVUpperLeft = av.ReturnOrigin\n \n AVCenter = avUpperLeft + (av.ReturnExtent / (2@2))\n \n halfDialogWidthHeight = theDialog.ReturnExtent.ReturnSize / (2@2)\n \n MovePoint = AVCenter - halfDialogWidthHeight\n \n theDialog.MoveTo(MovePoint.GetX, MovePoint.GetY) \n \n' ---------------------------------- " ) (Script.6 Name: "basins3.brc.GridProjector.Help" SourceCode: "' basins3.brc.GridProjector.Help \n' -------------------------\n\n if(self.GetDialog.GetName=\"basins3.dlg_gridproj\")then \n system.execute(\"hh.exe -mapid\" ++\"24\"++\"\\BASINS\\Docs\\Basins3.1.chm\") \n end \n " ) (Script.7 Name: "basins3.brc.MsgDlg.Open" SourceCode: "av.Run(\"basins3.brc.GridProjector.CenterDialog\",self)" ) (Script.8 Name: "basins3.dlg_Grid_InPrj_Driver" SourceCode: "'****************************************************************\n'*** Script for reading the input projection from the projection\n'*** dialog.\n'*** Called by: basins3.dlg_gridproj dialog\n'*** Blackland Research Center, Temple, TX 76502\n'****************************************************************\n\ndlgSelf = SELF.GetDialog\nstrCtrlName = SELF.GetName\ntheView = av.getProject.findDoc(_dicGridProjector.get(\"theView\").asString)\n\nif (theView = NIL) then\n theView = av.getProject.findDoc(\"View1\")\nend \n\nif (the View = NIL) then\n View.Make\n theView = av.getProject.findDoc(\"View1\")\nend \n\ninPrj=nil\n\nlbnInProj = dlgSelf.FindByName(\"lbnInProj\")\ninUnits = dlgSelf.FindByName(\"inUnits\")\n\nif (strCtrlName = \"lbnInProj\") then\n inPrj = ProjectionDialog.Show(theView,#UNITS_LINEAR_DEGREES)\nend \n\nif (inPrj.getClass.getClassName = \"prj\") then\n inUnits.defineFromList({\"Decimal Degree\"})\nelse\n inUnits.defineFromList({\"Meter\",\"Feet\",\"Kilometer\",\"Mile\"})\nend\n\n_dicGridProjector.add(\"inPrj\",inPrj)\n'msgBox.info(inPrj.getClass.retur nPrjName,\"\")\n\n\ndlgSelf.Update\n" ) (Script.9 Name: "basins3.dlg_Grid_OutPrj_Driver" SourceCode: "'******************************************************************\n'*** Script for reading the output projection from the projection\n'*** dialog.\n'*** Called by: basins3.dlg_gridproj dialog\n'*** Blackland Research Center, Temple, TX 76502\n'*******************************************************************\n\ndlgSelf = SELF.GetDialog\nstrCtrlName = SELF.GetName\n\ntheView = av.getProject.findDoc(_dicGridProjector.get(\"theView\").asString)\n\nif (theView = NIL) then\n theView = av.getProject.findDoc(\"View1\")\nend \n\n if (theView = NIL) then\n View.Make\n theView = av.getProject.findDoc(\"View1\")\nend \n\noutPrj = nil\n\nlbnOutProj = dlgSelf.FindByName(\"lbnOutProj\")\noutUnits = dlgSelf.FindByName(\"outUnits\")\n\nif (strCtrlName = \"lbnOutProj\") then\n outPrj = ProjectionDialog.Show(theView,#UNITS_LINEAR_DEGREES)\nend \n\nif (outPrj.getClass.getClassName = \"prj\") then\n outUnits.defineFromList({\"Decimal Degree\"})\nelse\n outUnits.defineFromList({\"Meter\",\"Feet\",\"Kilometer\",\"Mile\"})\nend\n\n_dicGridProjector.add(\"outPrj\", outPrj)\n'msgBox.inf o(outPrj.returnPrjName,\"\")\n\ndlgSelf.Update\n\n\n" ) (Script.10 Name: "basins3.GridProjDriver" SourceCode: "'******************************************************************************\n'*** Name: basins3.GridProjDriver\n'**** Controls the output from Grid Projector Dialog\n'**** Called by: basins3.dlg_GridProj when OK button or CANCEL button is clicked\n'****Blackland Research Center, Temple, TX 76502\n'******************************************************************************\n\n\ndlgSelf = SELF.GetDialog\nstrCtrlName = SELF.GetName\n\ntheView = av.getProject.findDoc(_dicGridProjector.get(\"theView\").asString)\n\nif (theView = NIL) then\n theView = av.getProject.findDoc(\"View1\")\nend \n\nif (theView = NIL) then\n View.Make\n theView = av.getProject.findDoc(\"View1\")\nend \n\n\n\nlbnOK = dlgSelf.FindByName(\"lbnOK\")\nlbnCancel = dlgSelf.FindByName(\"lbnCancel\")\nlbnInProj = dlgSelf.FindByName(\"lbnInProj\")\nlbnOutProj = dlgSelf.FindByName(\"lbnOutProj\")\ninlist = dlgSelf.FindByName(\"inList\")\noutList = dlgSelf.FindByName(\"outList\")\nregList = dlgSelf.FindByName(\"regList\")\nstList = dlgSelf.FindByName(\"stList\")\ninUnits = dlgSelf.FindByName (\"inUnits\")\noutUnits = dlgSelf.FindByName(\"outUnits\")\nchkAddtoView = dlgSelf.FindByName(\"chkAddtoView\")\n\nretList = {}\n\ninPrj = _dicGridProjector.get(\"inPrj\")\noutPrj = _dicGridProjector.get(\"outPrj\") \n\n\ninprjClass = inPrj.GetClass.GetClassName\noutprjClass = outPrj.GetClass.GetClassName\n\n\nif (strCtrlName = \"lbnOK\") then\n \n if (inPrj = nil) then\n MsgBox.info(\"No Input Projection Was Selected\",\"Error\")\n return NIL\n else\n retList.add(inPrj)\n end \n \n if (outPrj = nil) then\n MsgBox. info(\"No Output Projection Was Selected\",\"Error\")\n return NIL\n else\n retList.add(outPrj)\n end \n \n retList.add(inUnits.getSelection)\n \n retList.add(outUnits.getSelection)\n \n \n if (inList.HasSelection) then\n inDatum = inList.getSelection\n retList.add(indatum)\n 'msgBox.info(inDatum,\"\") \n else\n Return NIL\n end\n \n if (outList.HasSelection) then\n outDatum = outList.getSelection\n retList.add(outdatum)\n 'msgBox.info(outDatum,\"\") \n else\n Return NIL\n end\n \n if ( regList.HasSelection) then\n region = regList.getSelection\n retList.add(region)\n 'msgBox.info(region,\"\") \n \n else\n MsgBox.Warning(\"Please select a Region.\",\" \")\n Return NIL\n end\n \n if (stList.HasSelection) then\n state = stList.getSelection\n retList.add(state)\n 'msgBox.info(state,\"\") \n \n else\n MsgBox.Warning(\"Please select a State.\",\" \")\n Return NIL\n end\n \n addtoView = ChkAddtoView.IsSelected\n retList.add(addtoView)\n \n dlgSelf.SetModalResult(retList)\n dlgSelf.Close\n \n' ---------------------------------------------------\n' If script called by CLICK event of lbnCancel control\n'---------------------------------------------------\nelseif (strCtrlName = \"lbnCancel\") then\n \n dlgSelf.SetModalResult(NIL)\n dlgSelf.Close\nelse\n dlgSelf.SetModalResult(NIL)\n dlgSelf.Close\n\nend\n\n\n" ) (Script.11 Name: "basins3.GridProjector" SourceCode: "'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n'Name: Basins3.GridProjector\n'Date: 08/16/99\n'Main Program for Grid Projection and Datum Conversion(between NAD27 and NAD83)\n'Blackland Research Center,Temple, TX 76502\n'Called By: \n'Calls: Basins3.nadrun, Basins3.nadWriteProj, Basins3.nadProjDLL, Basins3.RunDll\n'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ \n \n theView = av.getActiveDoc\n _dicGridProjector = dictionary.Make(10) \n _dicGridP rojector.add(\"theView\",theView)\n '****Initialize DLL's********************\n \n fnUser32 = FileName.FindInSystemSearchPath(\"user32.dll\")\n fnKernel32 = FileName.FindInSystemSearchPath(\"kernel32.dll\")\n\n dllUser32 = DLL.Make(fnUser32)\n dllKernel32 = DLL.Make(fnKernel32)\n \n\n _dicGridProjector.add(\"makeDirectory\", DLLProc.Make(dllKernel32,\"CreateDirectoryA\",\n #DLLPROC_TYPE_INT32, {#DLLPROC_TYPE_STR,#DLLPROC_TYPE_PINT32}))\n \n '@_MakeDirectory = DLLProc.Make(dllKernel32,\"Crea teDirectoryA\",\n ' #DLLPROC_TYPE_INT32, {#DLLPROC_TYPE_STR,#DLLPROC_TYPE_PINT32})\n \n '*** Grid Projector DLL ****\n \n 'PROJDLL = DLL.Make(\"$AVBIN\\proj.dll\".asFileName)\n PROJDLL = DLL.Make(\"$basinsEtc\\proj.dll\".asFileName) \n\n if (PROJDLL = nil) then\n msgBox.Error(\"Could not access PROJDLL\",\"\")\n return nil\n end\n _dicGridProjector.Add(\"PROJRUN\",DLLProc.Make(PROJDLL,\"main\",#DLLPROC_TYPE_INT32,{#DLLPROC_TYPE_STR,#DLLPROC_TYPE_STR,\n #DLLPROC_TYPE_STR,#DLLPROC_TYPE_INT32,#DLLPROC_TYPE_INT32,#DLLPROC_TYPE_INT32}))\n \n '@ _PROJRUN = DLLProc.Make(PROJDLL,\"main\",#DLLPROC_TYPE_INT32,\n ' {#DLLPROC_TYPE_STR,#DLLPROC_TYPE_STR,#DLLPROC_TYPE_STR,\n ' #DLLPROC_TYPE_INT32,#DLLPROC_TYPE_INT32})\n \n '*******************************\n '**** Units conversion DLL *****\n '*******************************\n \n 'UNITSDLL = DLL.Make(\"$AVBIN\\units.dll\".asFileName)\n UNITSDLL = DLL.Make(\"$basinsEtc\\units.dll \".asFileName)\n\n if (UNITSDLL = nil) then\n msgBox.Error(\"Could not access UNITSDLL\",\"\")\n return nil\n end\n \n _dicGridProjector.Add(\"UNITSRUN\",DLLProc.Make(UNITSDLL,\"main\",#DLLPROC_TYPE_INT32,\n {#DLLPROC_TYPE_STR,#DLLPROC_TYPE_STR,#DLLPROC_TYPE_STR,\n #DLLPROC_TYPE_STR,#DLLPROC_TYPE_STR}))\n\n '@_UNITSRUN = DLLProc.Make(UNITSDLL,\"main\",#DLLPROC_TYPE_INT32,\n ' {#DLLPROC_TYPE_STR,#DLLPROC_TYPE_STR,#DLLPROC_TYPE_STR,\n ' #DLLPROC_TYPE_STR,#DLLP ROC_TYPE_STR})\n \n '*************************** \n '***** NAD8327 DLL *********\n '***************************\n \n 'NADDLL = DLL.Make(\"$AVBIN\\nad2nad.dll\".asFileName)\n NADDLL = DLL.Make(\"$basinsEtc\\nad2nad.dll\".asFileName) \n\n if (NADDLL = nil) then\n msgBox.Error(\"Could not access NADDLL\",\"\")\n return nil\n end\n _dicGridProjector.Add(\"NADRUN\", DLLProc.Make(NADDLL,\"main\",#DLLPROC_TYPE_INT32,\n {#DLLPROC_TYPE_STR,#DLLPROC_TYPE_STR,#DLLPROC_TYPE_STR,#DLLPROC_TYPE _STR,#DLLPROC_TYPE_INT32}))\n \n '@_NADRUN = DLLProc.Make(NADDLL,\"main\",#DLLPROC_TYPE_INT32,\n '{#DLLPROC_TYPE_STR,#DLLPROC_TYPE_STR,#DLLPROC_TYPE_STR,#DLLPROC_TYPE_STR,#DLLPROC_TYPE_INT32}) \n \n '##########\n \n retList = NIL\n thePrj = NIL\n \n \n '**************************************************\n '**GET THE INPUT GRID TO BE PROJECTED FROM THE USER\n '**************************************************\n '@@@ get a list of themes in the view\n \n theDocList = av.GetActiveDoc.getThemes \n theDict = Dictionary.Make(theDocList.Count)\n for each i in theDocList\n if (i.is(gTheme)) then\n theDict.Add(i.GetName,i)\n end\n end\n \n themesList = theDict.ReturnKeys\n \n if (themesList.count <> 0) then\n themesList.add(\"Select from disk\")\n openCount = 0\n while (openCount < 3)\n inputTheme = msgBox.ListAsString(themesList,\"Choose the grid to be projected\", \"Grid Projector\") \n q = false\n \n if (inputTheme=nil) then\n q = Msgbox.YesNo(\"Do you want to exit?\",\"Grid Projector\", FALSE)\n \n if (q) then\n exit\n else\n openCount=openCount+1\n end\n 'elseif (inputTheme.count=0) then\n ' q = Msgbox.YesNo(\"Do you want to exit?\",\"Grid Projector\", FALSE)\n ' if (q) then\n ' exit\n ' else\n ' openCount=openCount+1\n ' end\n else\n break\n end\n end\n \n '########################################## \n '### IF NO THEME IS SELECTED ##############\n '# #########################################\n \n if (openCount = 3) then\n exit\n \n '##############################################\n '##### IF A THEME IS SELECTED FROM DISK########\n '##############################################\n \n '* elseif(inputTheme.get(0).asString.contains(\"Select from disk\")) then\n elseif(inputTheme.asString.contains(\"Select from disk\")) then\n \n q = FALSE\n openCount=0\n srcList1 = {} \n \n while(openCount < 3)\n srcnamesf = SourceManager.GetDataSet(Grid,\"Choose a Grid for Projection\") \n if (srcnamesf =Nil ) then\n q = Msgbox.YesNo(\"Do you want to exit?\",\"Grid Projector\", FALSE)\n if(q) then\n exit \n else\n openCount=openCount+1\n end\n else\n break\n end\n end\n \n if (openCount=3) then\n exit\n else\n 'for each n in srcnames\n 'gridFN=n\n srcList1.Add(Grid.MakeSrcName(srcnamesf.GetFullName))\n 'end\n dataDir = srcList1.get(0).getFileName.asString.left((srcList1. get(0).getFileName.asString.count)-(srcList1.get(0).asString.count)-1).asFileName\n end\n \n '###########################################\n ' #### if themes are selected from view ####\n '###########################################\n \n else\n srcList1 = {}\n 'for each n in inputTheme\n if ((inputTheme.contains(\"Select from disk\").not) and (inputTheme.contains(\".\").not)) then\n srcList1.add(theView.findTheme(inputTheme).getSrcName)\n end\n 'end\n dataDir = srcList1.get(0).getFileNa me.asString.left((srcList1.get(0).getFileName.asString.count)-(srcList1.get(0).asString.count)-1).asFileName\n end\n \n '####################################################################\n '######No themes in view, choose directly from the disk##############\n '####################################################################\n \n else\n q = FALSE\n openCount=0\n srcList1 = {}\n \n while(openCount < 3)\n srcnamesf = SourceManager.GetDataSet(Grid,\"Choose a Grid for Projection\") \n if (srcname sf =Nil ) then\n q = Msgbox.YesNo(\"Do you want to exit?\",\"Grid Projector\", FALSE)\n if(q) then\n exit \n else\n openCount=openCount+1\n end\n else\n break\n end\n end\n \n if (openCount=3) then\n exit\n else\n 'for each n in srcnames\n 'gridFN=n\n srcList1.Add(Grid.MakeSrcName(srcnamesf.GetFullName))\n 'end\n dataDir = srcList1.get(0).getFileName.asString.left((srcList1.get(0).getFileName.asString.count)-(srcList1.g et(0).asString.count)-1).asFileName\n end \n \n end\n \n dataDir.setCWD\n \n \n '-------------------MDL\n \n listGrids = {}\n \n for each aDocm in av.GetProject.GetDocs\n if(aDocm.Is(View))then \n r = aDocm.GetDisplay.ReturnExtent \n listvr={} \n for eac h adelTheme in aDocm.GetThemes \n \n if(adelTheme.Is(Gtheme))then\n 'MsgBox.Info(\"Check\"++adelTheme.GetGrid.GetSrcName.GetFileName.asString,\"\") \n if(adelTheme.GetGrid.GetSrcName.GetFileName.ReturnDir.ReturnDir.GetFullName=dataDir.GetfullName)then \n ' MsgBox.Info(\"Found\"++adelTheme.GetGrid.GetSrcName.GetFileName.asString,\"\") \n listvr.Add(adelTheme)\n end\n end \n end\n for each adelTheme in listvr\n aDocm.DeleteTheme(aDocm.FindTheme(adelTheme.getName)) \n end \n aDocm.InvalidateTOC(NIL) \n a Docm.Invalidate\n System.RefreshWindows\n \n 'aDocm.GetDisplay.SetExtent(r.Scale(1.1))\n \n end\n end \n av.PurgeObjects\n av.PurgeObjects\n av.ProcessAllInvals\n \n \n ' -----------------------\n \n 'MsgBox.Info(\"Cazzo\",\"\")\n \n \n '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n '***Get the projection,datum and c oordinate units information ***\n '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n\n projDialog = av.FindDialog(\"Basins3.dlg_GridProj\")\n\n openCount=0\n while(openCount < 3)\n retList = projDialog.Open \n if (retList = NIL) then\n q = Msgbox.YesNo(\"Do you want to exit ?\",\"BASINS 3.1 Grid Projector\", FALSE)\n if (q) then\n exit\n end\n openCount=openCount+1\n else\n break\n end\n end\n \n if (openCount=3) then\n exit\n else\n retList = r etList\n end\n \n if (retList= nil) then\n exit\n end\n\n '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n '****The directory where the DATUM FILES are saved ****\n '**** Used when there is datum conversion *****\n '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n '_homeDrive = \"c:\" \n 'datumDir = (_homeDrive+\"\\ravi\\brc\\projectorext\\nadfiles\").asFileName\n datumDir = (_homeDrive+\"\\basins\\etc\\nadfiles\").AsFileName \n \n '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n '****Write the user input according to datum converter requirements****\n '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ \n \n indatum = retList.get(4)\n if (indatum = \"NAD27\") then\n innad=27\n elseif(indatum = \"NAD83\") then\n innad=83\n elseif(indatum = \"Other\") then\n innad=0\n end\n \n outdatum = retlist.get(5)\n if (outdatum = \"NAD27\") then\n outnad=27\n elseif(outdatum = \"NAD83\") then\n outnad=83\n end\n \n region = retList.get(6)\n state = retList.get(7)\n \n if (retList.get(6).asString = \"Conterminous U.S.\") then \n if (retList.get(7).asString = \"Alabama\") then\n nadfile = (datumDir.asString+\"\\alhpgn.txt\")\n elseif (retList.get(7).asString = \"Arizona\") then\n nadfile = (datumDir.asString+\"\\azhpgn.txt\")\n elseif (retList.get(7).asString = \"California-Above 38d\") then\n nadfile = (datumDir.asString+\"\\cnhpgn.txt\")\n elseif (retList.get(7).asString = \"Southern California\") then\n nad file = (datumDir.asString+\"\\cshpgn.txt\")\n elseif (retList.get(7).asString = \"Colorado\") then\n nadfile = (datumDir.asString+\"\\cohpgn.txt\")\n elseif (retList.get(7).asString = \"Georgia\") then\n nadfile = (datumDir.asString+\"\\gahpgn.txt\")\n elseif (retList.get(7).asString = \"Florida\") then\n nadfile = (datumDir.asString+\"\\flhpgn.txt\")\n elseif (retList.get(7).asString = \"Idaho-Montana-East of 113d\") then\n nadfile = (datumDir.asString+\"\\emhpgn.txt\")\n elseif (retLi st.get(7).asString = \"Idaho-Montana-West of 113d\") then\n nadfile = (datumDir.asString+\"\\wmhpgn.txt\")\n elseif (retList.get(7).asString = \"Kentucky\") then\n nadfile = (datumDir.asString+\"\\kyhpgn.txt\")\n elseif (retList.get(7).asString = \"Lousiana\") then\n nadfile = (datumDir.asString+\"\\lahpgn.txt\")\n elseif (retList.get(7).asString = \"Maryland-Delaware\") then\n nadfile = (datumDir.asString+\"\\mdhpgn.txt\")\n elseif (retList.get(7).asString = \"Maine\") then\n nadfile = (datumDir.asString+\"\\mehpgn.txt\")\n elseif (retList.get(7).asString = \"Michigan\") then\n nadfile = (datumDir.asString+\"\\mihpgn.txt\")\n elseif (retList.get(7).asString = \"Mississippi\") then\n nadfile = (datumDir.asString+\"\\mshpgn.txt\")\n elseif (retList.get(7).asString = \"Nebraska\") then\n nadfile = (datumDir.asString+\"\\nbhpgn.txt\")\n elseif (retList.get(7).asString = \"New England\") then\n nadfile = (datumDir.asString+\"\\nehpgn.txt\")\n elseif (retList.get(7).asString = \" New Mexico\") then\n nadfile = (datumDir.asString+\"\\nmhpgn.txt\")\n elseif (retList.get(7).asString = \"North Dakota\") then\n nadfile = (datumDir.asString+\"\\ndhpgn.txt\")\n elseif (retList.get(7).asString = \"Oklahoma\") then\n nadfile = (datumDir.asString+\"\\okhpgn.txt\")\n elseif (retList.get(7).asString = \"Puerto Rico-Virgin Is.\") then\n nadfile = (datumDir.asString+\"\\pvhpgn.txt\")\n elseif (retList.get(7).asString = \"South Dakota\") then\n nadfile = (datumDir.asString+\"\\ sdhpgn.txt\")\n elseif (retList.get(7).asString = \"Tennessee\") then\n nadfile = (datumDir.asString+\"\\tnhpgn.txt\")\n elseif (retList.get(7).asString = \"Texas-East of 100d\") then\n nadfile = (datumDir.asString+\"\\ethpgn.txt\")\n elseif (retList.get(7).asString = \"Texas-West of 100d\") then\n nadfile = (datumDir.asString+\"\\wthpgn.txt\")\n elseif (retList.get(7).asString = \"Virginia\") then\n nadfile = (datumDir.asString+\"\\vahpgn.txt\")\n elseif (retList.get(7).asString = \"Washing ton-Oregon\") then\n nadfile = (datumDir.asString+\"\\wohpgn.txt\")\n elseif (retList.get(7).asString = \"Wisconsin\") then\n nadfile = (datumDir.asString+\"\\wihpgn.txt\")\n elseif (retList.get(7).asString = \"Wyoming\") then\n nadfile = (datumDir.asString+\"\\wyhpgn.txt\")\n elseif (retList.get(7).asString = \"other\") then\n nadfile = (datumDir.asString+\"\\conus.txt\")\n end\n elseif (retList.get(6).asString = \"Alaska\") then\n nadfile = (datumDir.asString+\"\\alaska.txt\")\n elseif (retList .get(6).asString = \"Hawaii\") then\n nadfile = (datumDir.asString+\"\\hawaii.txt\")\n elseif (retList.get(6).asString = \"Puerto Rico/Virgin Islands\") then\n nadfile = (datumDir.asString+\"\\pvhpgn.txt\")\n elseif (retList.get(6).asString = \"St.George Is, Alaska\") then\n nadfile = (datumDir.asString+\"\\stgeorge.txt\")\n elseif (retList.get(6).asString = \"St.Paul Is, Alaska\") then\n nadfile = (datumDir.asString+\"\\stpaul.txt\")\n elseif (retList.get(6).asString = \"St.Lawrence Is, Alaska\") then\n nadfile = ( datumDir.asString+\"\\stlrnc.txt\")\n end \n\n '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n '########## Add Projected Grid to a View ##############\n '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n\n _dicGridProjector.add(\"addtoView\",retList.get(8))\n\n if (_dicGridProjector.get(\"addtoView\")) then\n theDocList = av.GetProject.getDocs\n \n theDict = Dictionary.Make(theDocList.Count)\n for each i in theDocList\n if (i.is(View)) then\n theDict.Add(i.GetName,i)\n end\n e nd\n\n theList = theDict.ReturnKeys\n theList.add(\"New View\")\n _dicGridProjector.add(\"newView\",msgBox.ListAsString(theList,\"Choose the View to add the projected grid\", \"Grid Projector\"))\n '@_aView = msgBox.ListAsString(theList,\"Choose the View to add the projected grid\", \"Grid Projector\")\n \n if (_dicGridProjector.get(\"newView\") = NIL) then \n msgBox.info(\"No View was selected\",\"Grid Projector\")\n elseif (_dicGridProjector.get(\"newView\") = \"New View\") then\n _dicGridProjector.add(\" aView\",view.make)\n else\n _dicGridProjector.add(\"aView\",av.getProject.FindDoc(_dicGridProjector.get(\"newView\")))\n end\n else\n _dicGridProjector.add(\"aView\",nil)\n end\n \n \n '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n '***Get the Input and Output Projection Information***\n '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n\n inPrj = retList.get(0)\n prjClass = inPrj.GetClass.GetClassName\n prjIn = inPrj.returnDescription\n if (prjClass <> \"Prj\") then\n inflag = 0\n innadflag= 0\n else\n inflag = 1\n innadflag= 1 \n end \n \n if(inFlag <> 1) then\n iUnit = retList.get(2)\n else\n iUnit = \"meter\"\n end\n\n\n '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n '****** write the proji.src file required for use with proj***************\n '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n \n i=0\n prjFN = (dataDir.asString + \"\\proji.src\").AsFileName\n prjLF = LineFile.Make(prjFN,#FILE _PERM_WRITE)\n\n av.run(\"basins3.nadwriteProj\",{inPrj,prjLF,i,retList.get(4).asString})\n \n '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n '******Write the ouput Projection Information******\n '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n \n outPrj = retList.get(1)\n if (outPrj <> NIL) then\n prjClass = outPrj.GetClass.GetClassName\n prjOut = outPrj.returnDescription\n if (prjClass <> \"Prj\") then\n outflag = 0\n outnadflag = 0\n else\n outflag = 1\n outnadflag=1\n end \n e lse\n exit\n end\n \n\n if ((prjIn = prjOut) AND (retList.get(4).asString=retList.get(5).asString))then\n msgBox.error(\"Both the input and output projections/datum selections are same\",\"\")\n exit\n end\n \n \n if(outFlag <> 1) then\n oUnit = retList.get(3)\n else\n oUnit = \"meter\"\n end\n\n 'msgBox.ListAsString({inflag.asString, outflag.asString, innadflag.asString, outnadflag.asString},\"\",\"\")\n \n '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n '****** write the projo.src file requi red for use with proj*****\n '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n \n i = 1\n prjFN = (dataDir.asString + \"\\projo.src\").AsFileName\n prjLF = LineFile.Make(prjFN,#FILE_PERM_WRITE)\n\n av.run(\"basins3.nadwriteProj\",{outPrj,prjLF,i,retList.get(5).asString})\n \n '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n '****Create a new directory for projected grids *******\n '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n \n newDir = String.MakeBuffer(120)\n newDir = dataD ir.asString+\"\\grids\"\n \n if (File.Exists((newDir).asFileName).Not) then\n rv = _dicGridProjector.get(\"makeDirectory\").Call({newDir,NIL})\n '@ rv = _makeDirectory.Call({newDir,NIL})\n if (rv = 0) then\n Msgbox.Error(\"Failed to create directory:\" ++ newDir,\"North American Datum Convertor\")\n av.run(\"bas3.removeFiles\",{dataDir})\n exit\n end\n end\n\n\n\n ' ---------------------- Remove Grids Theme with src in the dir \n \n \n \n theFilesList = newDir .asFileName.Read (\"*.*\") ' All the FileNames, included the Directories \n infob=false \n \n listGrids={}\n \n for each el in theFilesList \n ' MsgBox.Info(el.asString,\"\")\n \n if(el.getBasename.asString=\"Info\")then ' Exclude INFO file\n infof = el.clone\n infob = true\n elseif (Grid.IsValidDataSetFileName(el))then \n \n listGrids.Add(el) \n else' \n File.Delete(el) ' Delete the other files\n end ' if \n end ' for \n \n ' ---------------- \n \n 'if(false)then '*******\n \n if(listGrids.IsEmpty.Not)then \n for each el in listGrids \n av.PurgeObjects\n av.PurgeObjects\n av.ProcessAllInvals \n \n end \n \n newDir.asFileName.SetCwd \n \n SourceManager.ManageDataSets (Grid, \"Please, select and remove all the grids in this folder..\")\n \n ' for each el in listGrids \n ' Grid.DeleteDataSet (el)' ' Delete GRIDs \n 'end \n av.PurgeObjects\n av.PurgeObjects\n av.ProcessAllInvals \n System.RefreshWindows \n \n \n \n end\n ' end' ******** \n ' ---------------- \n \n dataDir.SetCwd\n \n theFl2 = NewDir.asFileName.ReadFiles(\"*\") ' Remaining Files without extension \n for each e in theFl2 \n File.Delete(e) \n end\n \n if (infob)then \n theIFlist = Infof.Read(\"*.*\") ' Remove the Files inthe INFO DIR\n for each theFile in theIFlist \n File.Delete(theFile) \n end \n _RemoveDirectory.Call({Infof.asString}) \n end \n \n \n \n \n ' ---------------------\n \n\n nFilesList = newDir.asFileName.Read (\"*.*\") ' All the FileNames, included the Directories \n\n for each el1 in nFilesList \n \n if(File.Exists(el1))then \n if(el1.IsDir)then \n theFl2 = el1.ReadFiles(\"*\") ' Remaining Files without ex tension \n for each e in theFl2 \n File.Delete(e) \n end \n\n theFl2 = el1.ReadFiles(\"*.*\") ' Remaining Files without extension \n for each e in theFl2 \n File.Delete(e) \n end \n \n _RemoveDirectory.Call({el1.asString}) \n end \n \n \n '***if (Grid.IsValidDataSetFileName(el1))then \n '** MsgBox.Info(\"Not removed all the Grids in\"++newdir ,\"\")\n '** exit\n \n '*** end ' if \n \n \n end \n end \n\n\n\n '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n '***** Get the data directory *****\n '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ \n \n if (srcList1 = NIL) then\n msgBox.Error(\"There are no Grids in the Directory\",\"\")\n end\n\n\n '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n '*****Check for different scenarios***\n '***1- Both Input and Ouput Projectio ns are Geographic***\n '***Just run the NADCON program*****\n '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n\n if ((outnadflag = 1) AND (innadflag = 1)) then\n 'MsgBox.info(\"I am here1\",\"\")\n\n if (retList.get(4).asString=retList.get(5).asString) then\n msgBox.error(\"Both the input and output projections/datum selections are same\",\"\")\n exit\n end\n if(innad <> 0) then \n av.run(\"basins3.runnad\",{srcList1,dataDir,theView,innadflag,outnadflag,\n in flag,outflag,innad,nadfile,iUnit,oUnit})\n end\n \n '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n '****Input geographic and output not geographic********\n '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n\n elseif ((innadflag=1) AND (outnadflag=0)) then\n 'MsgBox.info(\"I am here2\",\"\")\n \n if ((retList.get(4).asString=retList.get(5).asString) or (innad=0)) then\n av.run(\"Basins3.runDll\",{srcList1,dataDir,inFlag,outFlag,theView,iUnit,oUnit})\n else\n av.run(\"basins3.runnad\" ,{srcList1,dataDir,theView,innadflag,outnadflag,\n inflag,outflag,innad,nadfile,iUnit,oUnit})\n end\n \n '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ \n '****Input not geographic and output geographic\n '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n \n elseif ((innadflag=0) AND (outnadflag=1)) then \n 'MsgBox.info(\"I am here3\",\"\")\n\n if ((retList.get(4).asString=retList.get(5).asString) or (innad=0)) then\n av.run(\"Basins3.runDll\",{srcList1,dataD ir,inFlag,outFlag,theView,iUnit,oUnit})\n else\n av.run(\"basins3.nadprojdll\",{srcList1,dataDir,inflag,outflag,\n theView,innadflag,outnadflag,innad,nadfile,iUnit,oUnit})\n end\n \n '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n '******both input and output are not geographic\n '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n \n elseif ((innadflag=0) AND (outnadflag=0)) then\n 'MsgBox.info(\"I am here4\",\"\")\n if ((retList.get(4).asString=retList.get(5) .asString) or (innad=0)) then\n av.run(\"Basins3.runDll\",{srcList1,dataDir,inFlag,outFlag,theView,iUnit,oUnit}) \n exit\n end\n av.run(\"basins3.nadprojdll\",{srcList1,dataDir,inflag,outflag,theView,\n innadflag,outnadflag,innad,nadfile,iUnit,oUnit})\n \n end\n \n \n'***End***\n\n\n\n\n\n\n" ) (Script.12 Name: "basins3.GridProjOpen" SourceCode: "'**********************************************************\n'Basins3.gridProjOpen\n'Initialize the grid projector dialog\n'**********************************************************\n'ptCenter = (av.ReturnOrigin + (av.ReturnExtent / (1.05@2))) - (SELF.ReturnExtent.ReturnSize / (1.05@2))\n'SELF.MoveTo(ptCenter.GetX, ptCenter.GetY)\n\nav.Run(\"basins3.brc.GridProjector.CenterDialog\",self)\n\ninlist = SELF.FindByName(\"inList\")\noutList = SELF.FindByName(\"outList\")\nregList = SELF.FindByName(\"regList\")\nstList = SELF.Find ByName(\"stList\")\ninUnits = SELF.findByName(\"inUnits\")\noutUnits = SELF.findByName(\"outUnits\")\n\n\ninUnits.defineFromList({\"Meter\",\"Feet\",\"Kilometer\",\"Mile\"})\noutUnits.defineFromList({\"Meter\",\"Feet\",\"Kilometer\",\"Mile\"})\ninList.DefineFromList({\"NAD83\",\"NAD27\",\"Other\"})\noutList.DefineFromList({\"NAD83\",\"NAD27\"})\nregList.DefineFromList({\"Conterminous U.S.\", \"Alaska\", \"Hawaii\", \"Puerto Rico/Virgin Is.\", \"St.George Is, Alaska\", \"St.Paul Is, Alaska\",\"St.Lawrence Is, Alaska\"})\nstList.DefineFromList({\"Other\",\"Alabama\",\" Arizona\",\"California-Above 38d\",\"Southern California\",\n \"Colorado\",\"Georgia\",\"Florida\",\"Idaho-Montana-East of 113d\",\n \"Idaho-Montana-West of 113d\",\"Kentucky\",\"Lousiana\",\"Maryland-Delaware\",\n \"Maine\",\"Michigan\",\"Mississippi\",\"Nebraska\",\"New England\",\"New Mexico\",\n \"North Dakota\", \"Oklahoma\",\"Puerto Rico-Virgin Is.\",\"South Dakota\",\n \"Tennessee\",\"Texas-East of 100d\",\"Texas-West of 100d\",\"Virginia\" ,\n \"Washington-Oregon\",\"Wisconsin\",\"Wyoming\"}) \n \n'inPrj = NIL\n'outPrj = NIL\n\nself.FindByName(\"txl.buffer\").SetText(\"100\")\n\nreturn nil\n" ) (Script.13 Name: "basins3.nadprojdll" SourceCode: "'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n'Called By: Basins3.gridProjector\n'Calls : Basins3.projnadproj, basins3.runprojnad, basins3.projerr\n'Date : 08/16/99\n'Blackland Research Center,Temple, TX 76502\n'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n\n'##################################################\n'Execute the projgrid.dll for each of the grids \n'##################################################\n\n srcList1 = self.get(0)\n dataDir = self.get(1)\n inflag = self.get(2)\n outflag = self.get(3)\n theView = self.get(4)\n innadflag = self.get(5)\n outnadflag = self.get(6)\n innad = self.get(7)\n nadfile = self.get(8)\n iUnit = self.get(9).Lcase\n oUnit = self.get(10).Lcase\n\n \n inflag=0\n outflag=1\n \n '############################\n '*****Delete temp grids\n '############################\n \n f = (dataDir.asString+\"\\grids\\ptemp\").asFileName\n s = SrcName.Make(f.AsString)\n if ((s <> NIL) AND (s.Is(SrcName))) then\n grid.deleteDataSet((dataD ir.asString+\"\\grids\\ptemp\").asFileName)\n end\n av.PurgeObjects\n\n \n \n dataDir.setCWD\n ind = 0\n anum=0\n cnum = srcList1.count\n rCount = srcList1.count \n for each i in srcList1\n '***Initialize the DLL\n \n av.SetStatus((ind/rCount) * 100)\n repeat = 0\n '***Check if unit conversion is required for input grid\n if ((inflag=0) AND (iUnit <> \"meter\")) then\n oUnit1=\"meter\"\n uflag=0\n anum = av.Run(\"basins3.unitDLL\",{i.asString,dataDir,iUnit,oUnit1,uflag,i.asStri ng})\n if(anum <> 7) then\n msgBox.info(\"Error During Units Conversion\",\"Error\")\n exit\n end\n mylist = {dataDir.asString+\"\\grids\\utemp\",\n dataDir.asString+\"\\grids\\ptemp\",dataDir.asString,inflag,outflag}\n else \n mylist = {dataDir.asString+\"\\\"+i.asString,dataDir.asString+\"\\grids\\ptemp\",dataDir.asString,inflag,outflag}\n end\n \n ' ------------ MDL 4/10/2001 \n \n buffValue = av.FindDialog(\"basins3.dlg_gridproj\").FindByName(\"txl.buffer\").G etText\n \n if(buffValue.IsNumber.Not)then \n MsgBox.Info(\"Not a valid number for Buffer\",\"\")\n return Nil\n \n end\n \n buffValue = buffValue.asNumber.Abs\n Mylist.Add(buffValue)\n \n ' ------------------------\n \n \n MsgDlg = av.FindDialog(\"basins3.MsgDlg\")\n 'MsgBox.info(\"I am here1\",\"\")\n MsgDlg.SetTitle(\"Projecting Grid. Please Wait..\")\n ptCenter = (av.ReturnOrigin + (av.ReturnExtent / (2@2))) - (MsgDlg.ReturnExtent.ReturnSize / (2@2))\n MsgDlg. Open\n System.RefreshWindows\n MsgDlg.MoveTo(ptCenter.GetX, ptCenter.GetY)\n System.RefreshWindows\n \n anum = _dicGridProjector.get(\"PROJRUN\").call(mylist)\n \n MsgDlg.Close\n \n if (anum <> 7) then\n cnum = av.run(\"Basins3.projerr\",{anum,dataDir,i.asString,cnum})\n end\n \n if ((innadflag=0) AND (outnadflag=1)) then\n outDict = av.run(\"basins3.runprojnad\",{\"ptemp\",dataDir,inflag,outflag,theView,innadflag,outnadflag,i.asString,innad,nadfile})\n a num = outDict.get(\"anum\")\n outputGrid = outDict.get(\"OutputGrid\")\n if (anum <> 7) then\n cnum = av.run(\"Basins3.projerr\",{anum,dataDir,i.asString,cnum})\n end\n end\n \n if ((innadflag=0) AND (outnadflag=0)) then\n innadflag=1\n outnadflag=0\n anum= av.run(\"basins3.runprojnadproj\",{\"ptemp\",dataDir,inflag,outflag,theView,\n innadflag,outnadflag,i.asString,innad,nadfile})\n if (anum <> 7) then\n cnum = av.r un(\"Basins3.projerr\",{anum,dataDir,i.asString,cnum})\n end\n innadflag=1\n outnadflag=0\n inflag=1\n outflag=0\n 'for each x in 1..100000\n 'wait\n 'end\n anum=-1\n outDict= av.run(\"basins3.runnadproj\",{\"ntemp\",dataDir,inflag,outflag,theView,\n innadflag,outnadflag,i.asString,iUnit,oUnit})\n anum = outDict.get(\"anum\")\n outputGrid = outDict.get(\"outputGrid\")\n \n if (anum <> 7) then\n cnum = av.run(\"Basins3.projerr\",{anum,dataDir,i.asString,cnum})\n end\n end\n \n if(_dicGridProjector.get(\"addtoView\")) then\n addtoViewFlag = av.run(\"basins3.addgridtoView\",{OutputGrid})\n end\n \n ind = ind + 1\n av.purgeobjects\n \n end\n \n av.clearStatus\n \n '_PROJRUN = NIL\n '_NADRUN = NIL\n '_UNITSRUN = NIL\n 'projdll = nil\n 'naddll = nil\n 'unitsdll = nil\n _dicGridProjector = nil\n outDict = nil\n 'unitDict = nil\n\n if (anum = 7) then\n msgBox.info(cnum .asString++\"of\"++rCount.asString++\"Grids\"++\n \"Projected Successfully.\" +nl\n +\"Projected Grid(s) Saved in the Directory:\"+nl+\n dataDir.asString+\"\\grids\\\",\"BASINS3.1 Projector\")\n end\n \n if (anum=0) then\n msgBox.Error(\"No Grids to Project in:\"+nl+dataDir.asString,\"\")\n end\n\n\n if(file.exists((dataDir.asString + \"\\proji.src\").AsFileName)) then\n file.Delete((dataDir.asString + \"\\proji.src\").AsFileName)\n end\n if (file.exists((dataDir.asString + \"\\projo.src\").AsFile Name)) then\n file.Delete((dataDir.asString + \"\\projo.src\").AsFileName)\n end\n if (file.exists((dataDir.asString + \"\\bound.asc\").AsFileName)) then\n file.Delete((dataDir.asString + \"\\bound.asc\").AsFileName)\n end\n if (file.exists((dataDir.asString + \"\\nbound.asc\").AsFileName)) then\n file.Delete((dataDir.asString + \"\\nbound.asc\").AsFileName)\n end\n if (file.exists((dataDir.asString + \"\\datumf.src\").AsFileName)) then\n file.Delete((dataDir.asString + \"\\datumf.src\").AsFileName)\n end\n if (file.exi sts((dataDir.asString + \"\\datumr.src\").AsFileName)) then\n file.Delete((dataDir.asString + \"\\datumr.src\").AsFileName)\n end\n\n" ) (Script.14 Name: "basins3.nadwriteproj" SourceCode: "'*****************************************************************\n'Date: 08/16/99\n'Called by: basins3.GridProjector\n'Blackland Research Center, Temple, TX 76502\n'******************************************************************\n\nthePrj = self.get(0)\nprjLF = self.get(1)\ni = self.get(2)\nnad = self.get(3) \n'******Write the projection name in PROJ format************\n if (thePrj <> NIL) then\n prjLF.WriteElt(\"proj\")\n prjClass = thePrj.GetClass.GetClassName\n 'if ((i=0) AND (prjClass <> \"Prj\")) then\n 'prjLF.WriteElt(\"-I\")\n 'prjLF.WriteElt(\"-f\")\n 'end \n if(prjClass = \"EqualAreaCylindrical\")then\n prjLF.WriteElt(\"+proj=cea\")\n elseif(prjClass = \"Hammer\")then\n prjLF.WriteElt(\"+proj=hammer\")\n prjLF.WriteElt(\"+W=.5\")\n msgBox.info(\"There is some problem with Hammer projection, which needs to be fixed.\",\"\")\n exit\n elseif(prjClass = \"Mercator\")then\n prjLF.WriteElt(\"+proj=merc\")\n elseif(prjClass = \"Miller\")then\n prjLF.WriteElt(\"+proj=mill\")\n elseif(prj Class = \"Mollweide\")then\n prjLF.WriteElt(\"+proj=moll\")\n elseif(prjClass = \"EquidistantCylindrical\")then\n prjLF.WriteElt(\"+proj=eqc\")\n elseif(prjClass = \"Robinson\")then\n prjLF.WriteElt(\"+proj=robin\")\n elseif(prjClass = \"Sinusoid\")then\n prjLF.WriteElt(\"+proj=sinu\")\n elseif(prjClass = \"Orthographic\")then\n prjLF.WriteElt(\"+proj=ortho\")\n elseif(prjClass = \"EqualAreaAzimuthal\")then\n prjLF.WriteElt(\"+proj=laea\")\n elseif(prjClass = \"EquidistantAzimuthal\")then\n pr jLF.WriteElt(\"+proj=aeqd\")\n elseif(prjClass = \"Gnomonic\")then\n prjLF.WriteElt(\"+proj=gnom\")\n elseif(prjClass = \"Stereographic\")then\n prjLF.WriteElt(\"+proj=stere\")\n elseif(prjClass = \"Albers\")then\n prjLF.WriteElt(\"+proj=aea\")\n elseif(prjClass = \"EquidistantConic\")then\n prjLF.WriteElt(\"+proj=eqdc\")\n elseif(prjClass = \"Lambert\")then\n prjLF.WriteElt(\"+proj=lcc\")\n elseif(prjClass = \"TransverseMercator\")then\n if (thePrj.returnDescription.contains(\"State Plane\") OR t hePrj.returnDescription.contains(\"Custom Transverse Mercator\")) then\n prjLF.WriteElt(\"+proj=tmerc\")\n elseif (thePrj.returnDescription.contains(\"National Grids\")) then\n msgBox.info(\"National Grids not supported by PROJ\", \"Error\")\n anum=0\n exit\n else\n prjLF.WriteElt(\"+proj=utm\")\n prjLF.WriteElt(\"+zone=\"+thePrj.returnDescription.extract(5))\n end\n elseif (prjClass = \"NewZealand\")then\n prjLF.WriteElt(\"+proj=nzmg\")\n elseif (prjClass = \"Cassini\" )then\n prjLF.WriteElt(\"+proj=cass\")\n elseif (prjClass = \"ObliqueMercator\")then\n prjLF.WriteElt(\"+proj=omerc\")\n elseif (prjClass = \"NearSide\")then\n prjLF.WriteElt(\"+proj=nsper\")\n elseif (prjClass = \"Prj\") then\n prjLF.WriteElt(\"+proj=dd\")\n else \n msgBox.info(\"Projection Not Supported in PROJ\", \"Error\")\n anum=0\n exit\n end\n\n '*****Write the ellipsoid information *********\n if (nad = \"NAD27\") then\n prjLF.WriteElt(\"+ellps=clrk66\")\n elseif (nad = \"NAD83 \") then\n prjLF.WriteElt(\"+ellps=GRS80\")\n elseif (thePrj.GetSpheroid.GetSpheroidName.contains(\"Airy 1830\")) then\n prjLF.WriteElt(\"+ellps=airy\")\n elseif (thePrj.GetSpheroid.GetSpheroidName.contains(\"Australian\")) then\n prjLF.WriteElt(\"+ellps=aust_SA\")\n elseif (thePrj.GetSpheroid.GetSpheroidName.contains(\"Bessel\")) then\n prjLF.WriteElt(\"+ellps=bessel\") \n elseif (thePrj.GetSpheroid.GetSpheroidName.contains(\"Clarke 1866\")) then\n prjLF.WriteElt(\"+ellps=clrk66\")\n elseif (t hePrj.GetSpheroid.GetSpheroidName.contains(\"Clarke 1880\")) then\n prjLF.WriteElt(\"+ellps=clrk80\")\n elseif (thePrj.GetSpheroid.GetSpheroidName.contains(\"Everest\")) then\n prjLF.WriteElt(\"+ellps=evrst30\")\n elseif (thePrj.GetSpheroid.GetSpheroidName.contains(\"GRS 80\")) then\n prjLF.WriteElt(\"+ellps=GRS80\")\n elseif (thePrj.GetSpheroid.GetSpheroidName.contains(\"International 1909\")) then\n prjLF.WriteElt(\"+ellps=intl\")\n elseif (thePrj.GetSpheroid.GetSpheroidName.contains(\"Krasovsky\")) then\n prjLF.WriteElt(\"+ellps=krass\")\n elseif (thePrj.GetSpheroid.GetSpheroidName.contains(\"WGS 72\")) then\n prjLF.WriteElt(\"+ellps=WGS72\")\n elseif (thePrj.GetSpheroid.GetSpheroidName.contains(\"WGS 84\")) then\n prjLF.WriteElt(\"+ellps=WGS84\")\n elseif (thePrj.GetSpheroid.GetSpheroidName.contains(\"Sphere\")) then\n prjLF.WriteElt(\"+ellps=clrk66\")\n else\n msgBox.info(\"Unknown Spheroid - Please Choose Again\",\"Error\")\n end\n\n '***********Write the other parameter information***** ***************\n \n if (((thePrj.GetClass.GetClassName = \"ObliqueMercator\") OR (thePrj.GetClass.GetClassName = \"Prj\") OR (thePrj.GetClass.GetClassName = \"RSO\")\n OR (thePrj.GetClass.GetClassName = \"NewZealand\")).NOT) then\n prjLF.WriteElt(\"+lon_0=\" + thePrj.ReturnCentralMeridian.AsString)\n end\n \n\n if (thePrj.GetClass.GetClassName = \"Albers\") then\n prjLF.WriteElt(\"+lat_0=\" + thePrj.ReturnReferenceLatitude.AsString)\n prjLF.WriteElt(\"+lat_1=\" + thePrj.ReturnLowerStandardParallel.AsS tring)\n prjLF.WriteElt(\"+lat_2=\" + thePrj.ReturnUpperStandardParallel.AsString)\n prjLF.WriteElt(\"+y_0=\" + thePrj.ReturnFalseNorthing.AsString)\n prjLF.WriteElt(\"+x_0=\" + thePrj.ReturnFalseEasting.AsString)\n \n elseif (thePrj.GetClass.GetClassName = \"Cassini\") then\n prjLF.WriteElt(\"+lat_0=\" + thePrj.ReturnReferenceLatitude.AsString)\n \n elseif (thePrj.GetClass.GetClassName = \"EqualAreaAzimuthal\") then\n prjLF.WriteElt(\"+lat_0=\" + thePrj.ReturnReferenceLatitude.AsString)\n \n elseif (thePrj.GetClass.GetClassName = \"EqualAreaCylindrical\") then\n prjLF.WriteElt(\"+lat_ts=\"+thePrj.ReturnStandardParallel.AsString)\n \n elseif (thePrj.GetClass.GetClassName = \"EquidistantAzimuthal\") then\n prjLF.WriteElt(\"+lat_0=\" + thePrj.ReturnReferenceLatitude.AsString)\n \n elseif (thePrj.GetClass.GetClassName = \"EquidistantConic\") then\n prjLF.WriteElt(\"+lat_0=\" + thePrj.ReturnReferenceLatitude.AsString)\n prjLF.WriteElt(\"+lat_1=\" + thePrj.ReturnLowerStandardParallel.AsString)\n prjLF.WriteElt(\"+lat_2=\" + thePrj.ReturnUpperStandardParallel.AsString)\n \n elseif (thePrj.GetClass.GetClassName = \"EquidistantCylindrical\") then\n prjLF.WriteElt(\"+lat_ts=\" + thePrj.ReturnReferenceLatitude.AsString)\n \n elseif (thePrj.GetClass.GetClassName = \"Lambert\") then\n prjLF.WriteElt(\"+lat_0=\" + thePrj.ReturnReferenceLatitude.AsString)\n prjLF.WriteElt(\"+lat_1=\" + thePrj.ReturnLowerStandardParallel.AsString)\n prjLF.WriteElt(\"+lat_2=\" + thePrj.ReturnUpperStandardParallel. AsString)\n prjLF.WriteElt(\"+y_0=\" + thePrj.ReturnFalseNorthing.AsString)\n prjLF.WriteElt(\"+x_0=\" + thePrj.ReturnFalseEasting.AsString)\n \n elseif (thePrj.GetClass.GetClassName = \"Mercator\") then\n prjLF.WriteElt(\"+lat_ts=\" + thePrj.ReturnLatitudeOfTrueScale.AsString)\n \n elseif (thePrj.GetClass.GetClassName = \"Perspective\") then\n prjLF.WriteElt(\"+lat_0=\" + thePrj.ReturnReferenceLatitude.AsString)\n \n elseif (thePrj.GetClass.GetClassName = \"TransverseMercator\") then\n prjLF.Wr iteElt(\"+lat_0=\" + thePrj.ReturnReferenceLatitude.AsString)\n prjLF.WriteElt(\"+y_0=\" + thePrj.ReturnFalseNorthing.AsString)\n prjLF.WriteElt(\"+x_0=\" + thePrj.ReturnFalseEasting.AsString)\n prjLF.WriteElt(\"+k=\" + thePrj.ReturnScale.AsString)\n \n elseif (thePrj.GetClass.GetClassName = \"ObliqueMercator\") then\n prjLF.WriteElt(\"+lonc=\" + thePrj.ReturnCentralLongitude.AsString)\n prjLF.WriteElt(\"+lat_0=\" + thePrj.ReturnCentralLatitude.AsString)\n prjLF.WriteElt(\"+y_0=\" + thePrj.ReturnF alseNorthing.AsString)\n prjLF.WriteElt(\"+x_0=\" + thePrj.ReturnFalseEasting.AsString)\n prjLF.WriteElt(\"+k=\" + thePrj.ReturnScale.AsString)\n if (thePrj.ReturnAzimuthofCentralLine = 0) then\n prjLF.WriteElt(\"+no_rot\")\n end\n prjLF.WriteElt(\"+alpha=\" + thePrj.ReturnAzimuthofCentralLine.AsString)\n msgBox.info(\"There is some problem with Oblique Mercator projection, which need to be fixed.\",\"\")\n exit\n\n elseif (thePrj.getClass.GetClassName = \"Stereographic\") then\n pr jLF.WriteElt(\"+lat_0=\" + thePrj.ReturnReferenceLatitude.AsString)\n elseif (prjClass = \"NearSide\")then\n prjLF.WriteElt(\"+lat_0=\" + thePrj.ReturnReferenceLatitude.AsString)\n prjLF.WriteElt(\"+h=\" + thePrj.ReturnHeight.AsString)\n end\n else\n prjLF.WriteElt(\"Projection: Unprojected\")\n prjLF.WriteElt(\"Units: Decimal Degrees\")\n prjLF.WriteElt(\"Datum: NAD83\")\n prjLF.WriteElt(\"Spheroid: clrk66\")\n end\n \n 'if ((i=0) AND (prjClass <> \"Prj\")) then\n 'prjLF.WriteElt(\"%.32f\")\n 'end \n \n prjLF.writeELT(\"end\") \n prjLF.Close\n\n\n'-----\n\n" ) (Script.15 Name: "basins3.projerr" SourceCode: "'***********************************\n'Error messages\n'***********************************\n\nanum=self.get(0)\ndataDir = self.get(1)\ni = self.get(2)\ncnum = self.get(3)\n\nif (anum=2) then\n msgBox.Error(\"Error Opening Input Grid:\"++dataDir.asString+\"\\\"+i.asString,\"Error:\"++anum.asString)\n cnum=cnum-1\n elseif (anum=3) then\n msgBox.Error(\"Error Reading Input Grid:\"++dataDir.asString+\"\\\"+i.asString,\"Error:\"++anum.asString)\n cnum=cnum-1\n elseif (anum=4) then\n msgBox.Error(\"Error Reading the Projection Input File PROJ.SRC\",\"Error:\"++anum.asString)\n cnum=cnum-1\n elseif (anum=6) then\n msgBox.Error(\"Error During Projection of Grid - Check the Parameters\",\"Error:\"++anum.asString)\n cnum=cnum-1\n elseif (anum=5) then\n msgBox.Error(\"Error Writing the Output Grid\"+nl+\"Please Check the Projection Parameters\",\"Error:\"++anum.asString)\n cnum=cnum-1\n elseif(anum=8) then\n msgBox.Error(dataDir.asString+\"\\\"+i.asString++\"is not a Grid\",\"Error:\"++anum.a sString)\n elseif(anum=9) then\n msgBox.Error(\"Error during Memory Allocation\",\"Error:\"++anum.asString) \n elseif(anum=10) then\n msgBox.Error(\"Error During Datum Conversion\",\"Error:\"++anum.asString)\n elseif(anum=11) then\n msgBox.Error(\"Error Opening/Reading Datum Conversion Reference File\",\"Error:\"++anum.asString)\n\n 'elseif(anum=7) then\n 'for each f in ((dataDir.asString+\"\\grids\\\").asFileName).read(\"*.*\")\n 'if ((f.IsDir) AND (f.AsString.Contains(i.asStrin g+repeat.asString))) then\n 'theView.addTheme(theme.make(SrcName.Make(f.AsString)))\n 'end\n 'end\n end\n return cnum\n" ) (Script.16 Name: "basins3.projselect" SourceCode: "dlgSelf = SELF.GetDialog\nstrCtrlName = SELF.GetName\n\n\ninDatList = dlgSelf.FindByName(\"inList\")\noutDatList = dlgSelf.FindByName(\"outList\")\noutDatText = dlgSelf.FindByName(\"OutDatText\")\nregList = dlgSelf.findByName(\"regList\")\nstList = dlgSelf.findByName(\"stList\")\nstText = dlgSelf.findByName(\"stText\")\n \nif ((inDatList.getSelection=\"NAD27\") OR (inDatList.getSelection=\"NAD83\") ) then\n outDatList.setVisible(true)\n outDatText.setLabel(\"Output Datum:\")\n dlgSelf.Update\nelse\n outDatList.setVisible(false)\n outDat Text.setLabel(\"\")\n dlgSelf.Update\nend\n\n \n if(regList.getSelection=\"Conterminous U.S.\") then\n stList.setVisible(true)\n stText.setLabel(\"State:\")\n dlgSelf.Update\n else \n stList.setVisible(false)\n stText.setLabel(\"\")\n dlgSelf.Update\nend\n \n \n \n\n\n" ) (Script.17 Name: "basins3.removefiles" SourceCode: "dataDir = self.get(0)\nif(file.exists((dataDir.asString + \"\\proji.src\").AsFileName)) then\n file.Delete((dataDir.asString + \"\\proji.src\").AsFileName)\nend\nif (file.exists((dataDir.asString + \"\\projo.src\").AsFileName)) then\n file.Delete((dataDir.asString + \"\\projo.src\").AsFileName)\nend\nif (file.exists((dataDir.asString + \"\\bound.asc\").AsFileName)) then\n file.Delete((dataDir.asString + \"\\bound.asc\").AsFileName)\nend\nif (file.exists((dataDir.asString + \"\\nbound.asc\").AsFileName)) then\n file.Delete((dataDir.asS tring + \"\\nbound.asc\").AsFileName)\nend\n\n" ) (Script.18 Name: "basins3.rundll" SourceCode: "'Execute the projgrid.dll for each of the grids \n'Called by: Basins3.gridProjector\n\n srcList1 = self.get(0)\n dataDir = self.get(1)\n inflag = self.get(2)\n outflag = self.get(3)\n theView = self.get(4)\n iUnit = self.get(5).Lcase\n oUnit = self.get(6).Lcase\n \n uflag = 0\n \n dataDir.setCWD\n ind = 0\n anum=0\n cnum = srcList1.count\n rCount = srcList1.count \n for each i in srcList1\n av.SetStatus((ind/rCount) * 100)\n repeat = 0\n '***Check if unit conversion is required for input grid\n if ((inflag=0) AND (iUnit <> \"meter\")) then\n oUnit1=\"meter\"\n anum = av.Run(\"basins3.unitDLL\",{i.asString,dataDir,iUnit,oUnit1,uflag,i.asString})\n if(anum <> 7) then\n msgBox.info(\"Error During Units Conversion\",\"Error\")\n exit\n end\n mylist = {dataDir.asString+\"\\grids\\utemp\",\n dataDir.asString+\"\\grids\\\"+i.asString+repeat.asString,dataDir.asString,inflag,outflag}\n else \n mylist = {dataDir.asString+\"\\\"+i.asString,dataDir.asString+\"\\gri ds\\\"+i.asString+repeat.asString,\n dataDir.asString,inflag,outflag}\n end\n \n ' ------------ MDL 4/10/2001 \n \n \n buffValue = av.FindDialog(\"basins3.dlg_gridproj\").FindByName(\"txl.buffer\").GetText\n \n if(buffValue.IsNumber.Not)then \n MsgBox.Info(\"Not a valid number for Buffer\",\"\")\n return Nil\n \n end\n \n buffValue = buffValue.asNumber.Abs\n Mylist.Add(buffValue)\n \n ' ------------------------\n \n \n MsgDlg = av.FindDialog(\"basins3.MsgDlg\")\n MsgDlg.SetTitle(\"Projecting Grid. Please Wait..\")\n ptCenter = (av.ReturnOrigin + (av.ReturnExtent / (2@2))) - (MsgDlg.ReturnExtent.ReturnSize / (2@2))\n MsgDlg.Open\n System.RefreshWindows\n MsgDlg.MoveTo(ptCenter.GetX, ptCenter.GetY)\n System.RefreshWindows\n \n anum = _dicGridProjector.get(\"PROJRUN\").call(mylist)\n \n OutputGrid = dataDir.asString+\"\\grids\\\"+i.asString+repeat.asString\n \n \n \n 'add check here for VAT\n hasVat = file.exists((OutputGrid + \"\\vat.adf\").asfilename)\n if (hasVat = FALSE) then\n theSrcName = grid.makesrcname(OutputGrid)\n if (theSrcName <> NIL) then\n theGrid = grid.make(theSrcName)\n if (theGrid.isinteger) then\n done = theGrid.BuildVAT\n end\n end\n end \n \n \n \n 'msgbox.info(anum.asString,\"\")\n while (anum = 1)\n repeat = repeat + 1\n mylist = {dataDir.asString+\"\\\"+i.asStri ng,dataDir.asString+\"\\grids\\\"+i.asString+repeat.asString,dataDir.asString,inflag,outflag}\n \n Mylist.Add(buffValue) \n \n anum = _dicGridProjector.get(\"PROJRUN\").call(mylist)\n OutputGrid = dataDir.asString+\"\\grids\\\"+i.asString+repeat.asString\n \n \n 'add check here for VAT\n hasVat = file.exists((OutputGrid + \"\\vat.adf\").asfilename)\n if (hasVat = FALSE) then\n theSrcName = grid.makesrcname(OutputGrid)\n if (theSrcName <> NIL) t hen\n theGrid = grid.make(theSrcName)\n if (theGrid.isinteger) then\n done = theGrid.BuildVAT\n end\n end\n end \n \n \n\n end\n \n \n MsgDlg.Close\n \n 'msgbox.info(anum.asString,\"\")\n if (anum=2) then\n msgBox.Error(\"Error Opening Input Grid:\"++dataDir.asString+\"\\\"+i.asString,\"\")\n cnum = cnum-1\n elseif (anum=3) then\n msgBox.Error(\"Error Reading Input Grid:\"++dataDir.asString+\"\\\"+i.asString,\"\")\n cnum = cnum-1\n elseif (anum=4) then\n msgBox.Error(\"Error Reading the Projection Input File PROJ.SRC\",\"\")\n cnum = cnum-1\n elseif (anum=6) then\n msgBox.Error(\"Error During Projection of Grid - Check the Parameters\",\"\")\n cnum=cnum-1\n elseif (anum=5) then\n msgBox.Error(\"Error Writing the Output Grid\" + nl\n + dataDir.asString+\"\\grids\\\"+i.asString+repeat.asString+nl+\n \"Please Check the Projection Parameters\",\"\")\n cnum=cnum-1\n elseif(anum=8) then\n msgBox.Error(dataDir.asString+\"\\\"+i.asString++\"is not a Grid\",\"\")\n end\n \n '***Check if Output grid unit is not in meter\n if ((outflag=0) AND (oUnit <> \"meter\")) then\n iUnit=\"meter\"\n uflag=1\n unitDict = av.Run(\"basins3.unitDLL\",{i.asString+repeat.asString,dataDir,iUnit,oUnit,uflag,i.asString})\n anum = unitDict.get(\"anum\")\n OutputGrid = unitDict.get(\"OutputGrid\")\n\n if(anum <> 7) then\n msgBox.info(\"Error During Units Conversion\",\"Error\")\n exit\n else\n if(_dicGridProjector.get(\"addtoView\")) then\n addtoViewFlag = av.run(\"basins3.addgridtoView\",{OutputGrid})\n end\n end\n else\n if(_dicGridProjector.get(\"addtoView\")) then\n addtoViewFlag = av.run(\"basins3.addgridtoView\",{OutputGrid})\n end\n end\n ind = ind + 1\n end\n \nav.clearStatus\n\n '_PROJRUN = NIL\n '_NADRUN = NIL\n '_UNITSRUN = NIL\n ' projdll = nil\n ' naddll = nil\n ' unitsdll = nil\n _dicGridProjector = nil\n unitDic t = nil\n\n\nif (anum = 7) then\n msgBox.info(cnum.asString++\"of\"++rCount.asString++\"Grids\"++\n \"Projected Successfully.\" +nl\n +\"Projected Grid(s) Saved in the Directory:\"+nl+\n dataDir.asString+\"\\grids\\\",\"BASINS3.1 Projector\")\n end\n\nif (anum=0) then\n msgBox.Error(\"No Grids to Project in:\"+nl+dataDir.asString,\"\")\nend\n\nif(file.exists((dataDir.asString + \"\\proji.src\").AsFileName)) then\n file.Delete((dataDir.asString + \"\\proji.src\").AsFileName)\nend\nif (file.exists((dataDir.as String + \"\\projo.src\").AsFileName)) then\n file.Delete((dataDir.asString + \"\\projo.src\").AsFileName)\nend\nif (file.exists((dataDir.asString + \"\\bound.asc\").AsFileName)) then\n file.Delete((dataDir.asString + \"\\bound.asc\").AsFileName)\nend\nif (file.exists((dataDir.asString + \"\\nbound.asc\").AsFileName)) then\n file.Delete((dataDir.asString + \"\\nbound.asc\").AsFileName)\nend\n\n\n\n\n\n\n\n\n\n\n" ) (Script.19 Name: "basins3.runnad" SourceCode: "'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n'Called By : Basins3.GridProjector\n'Calls : Basins3.runnadproj, Basins3.projErr\n'Date : 08/16/99 \n'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n\n'##############################################\n'Execute the projgrid.dll for each of the grids \n'##############################################\n\n srcList1 = self.get(0)\n dataDir = self.get(1)\n theView = self.get(2)\n innadflag = self.get(3)\n outnadflag = self.get(4)\n inflag = self.get(5)\n outflag = self.get(6)\n innad = self.get(7)\n nadfile = self.get(8)\n iUnit = self.get(9).Lcase\n oUnit = self.get(10).Lcase\n outputGrid = nil\n addtoView = _dicGridProjector.get(\"addtoView\")\n \n \n dataDir.setCWD\n ind = 0\n anum=0\n \n f = (dataDir.asString+\"\\grids\\ntemp\").asFileName\n s = SrcName.Make(f.AsString)\n if ((s <> NIL) AND (s.Is(SrcName))) then\n grid.deleteDataSet((dataDir.asString+\"\\grids\\ntemp\").asFileName)\n end\n av.PurgeObjects\n\n \n cnum = srcList1.count\n r Count = srcList1.count \n for each i in srcList1\n \n av.SetStatus((ind/rCount) * 100)\n repeat = 0\n if ((innadflag=1) AND (outnadflag=1)) then\n mylist = {dataDir.asString+\"\\\"+i.asString,dataDir.asString+\"\\grids\\\"+i.asString+repeat.asString,dataDir.asString,nadfile,innad}\n OutputGrid = dataDir.asString+\"\\grids\\\"+i.asString+repeat.asString\n elseif ((innadflag=1) AND (outnadflag=0)) then\n mylist = {dataDir.asString+\"\\\"+i.asString,dataDir.asString+\"\\grids\\nte mp\",dataDir.asString,nadfile,innad}\n end\n MsgDlg = av.FindDialog(\"basins3.MsgDlg\")\n MsgDlg.SetTitle(\"Converting Datum. Please Wait..\")\n ptCenter = (av.ReturnOrigin + (av.ReturnExtent / (2@2))) - (MsgDlg.ReturnExtent.ReturnSize / (2@2))\n MsgDlg.Open\n System.RefreshWindows\n MsgDlg.MoveTo(ptCenter.GetX, ptCenter.GetY)\n System.RefreshWindows\n NADRUN = _dicGridProjector.get(\"NADRUN\") \n anum = NADRUN.call(mylist)\n 'msgbox.info(anum.asString,\"\")\n while (anum = 1)\n repeat = repeat + 1\n if ((innadflag=1) AND (outnadflag=1)) then\n mylist = {dataDir.asString+\"\\\"+i.asString,dataDir.asString+\"\\grids\\\"+i.asString+repeat.asString,dataDir.asString,nadfile,innad}\n OutputGrid = dataDir.asString+\"\\grids\\\"+i.asString+repeat.asString\n elseif ((innadflag=1) AND (outnadflag=0)) then\n mylist = {dataDir.asString+\"\\\"+i.asString,dataDir.asString+\"\\grids\\ntemp\",dataDir.asString,nadfile,innad}\n end\n anum = NADRUN.call(mylist)\n end\n \n \n MsgDlg.Close\n \n \n if (anum <> 7) then\n cnum = av.run(\"Basins3.projerr\",{anum,dataDir,i.asString,cnum})\n end\n \n \n if ((innadflag=1) AND (outnadflag=0)) then\n outDict = av.run(\"basins3.runnadproj\",{\"ntemp\",dataDir,inflag,outflag,theView,innadflag,outnadflag,i.asString,iUnit,oUnit})\n anum = outDict.get(\"anum\")\n OutputGrid = outDict.get(\"outputGrid\")\n if (anum <> 7) then\n cnum = av.run(\"Basins3.projerr\",{anum,dataDir,i.asString,cnum})\n else\n if(addtoView) then\n addtoViewFlag = av.run(\"basins3.addgridtoView\",{OutputGrid})\n end\n end\n else\n if(addtoView) then\n addtoViewFlag = av.run(\"basins3.addgridtoView\",{OutputGrid})\n end\n end \n ind = ind + 1\n end\n \nav.clearStatus\n\n if (anum = 7) then\n msgBox.info(cnum.asString++\"of\"++rCount.asString++\"Grids\"++\n \"Datum Shited Successfully.\" +nl\n +\"Ne w Grid(s) Saved in the Directory:\"+nl+\n dataDir.asString+\"\\grids\\\",\"BASINS3.1 Datum Convertor\")\n end\n\n '_PROJRUN = NIL\n '_NADRUN = NIL\n '_UNITSRUN = NIL\n 'projdll = nil\n 'naddll = nil\n 'unitsdll = nil\n _dicGridProjector = nil\n outDict = nil\n\n if (anum=0) then\n msgBox.Error(\"No Grids in:\"+nl+dataDir.asString,\"\")\n end\n\n if(file.exists((dataDir.asString + \"\\proji.src\").AsFileName)) then\n file.Delete((dataDir.asString + \"\\proji.src\").AsFileName)\n end\n \n if (file.exists(( dataDir.asString + \"\\projo.src\").AsFileName)) then\n file.Delete((dataDir.asString + \"\\projo.src\").AsFileName)\n end\n\n if (file.exists((dataDir.asString + \"\\bound.asc\").AsFileName)) then\n file.Delete((dataDir.asString + \"\\bound.asc\").AsFileName)\n end\n \n if (file.exists((dataDir.asString + \"\\nbound.asc\").AsFileName)) then\n file.Delete((dataDir.asString + \"\\nbound.asc\").AsFileName)\n end\n \n if (file.exists((dataDir.asString + \"\\datumf.src\").AsFileName)) then\n file.Delete((dataDir.asString + \" \\datumf.src\").AsFileName)\n end\n \n if (file.exists((dataDir.asString + \"\\datumr.src\").AsFileName)) then\n file.Delete((dataDir.asString + \"\\datumr.src\").AsFileName)\n end\n\n\n\n\n\n\n\n\n" ) (Script.20 Name: "basins3.runnadproj" SourceCode: "'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n'Execute the projgrid.dll for each of the grids \n'Called by: Basins3.runnad,basins3.nadprojdll\n'Date : 08/16/99\n'Calls: Basins3.projErr \n'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n\n i = self.get(0)\n dataDir = self.get(1)\n inflag = self.get(2)\n outflag = self.get(3)\n theView = self.get(4)\n innadflag = self.get(5)\n outnadflag = self.get(6)\n j = self.get(7)\n iUnit = self.get(8)\n oUnit = self.get(9)\n \n \n \n inflag=1\n outflag=0\n cn um=1\n \n\n \n if ((innadflag=1) AND (outnadflag=0)) then\n dataDir.setCWD\n ind = 0\n anum=0\n repeat = 0\n \n \n mylist = {dataDir.asString+\"\\grids\\\"+i.asString,dataDir.asString+\"\\grids\\\"+j.asString+repeat.asString,dataDir.asString,inflag,outflag}\n\n ' ------------ MDL 4/10/2001 \n \n buffValue = av.FindDialog(\"basins3.dlg_gridproj\").FindByName(\"txl.buffer\").GetText\n \n if(buffValue.IsNumber.Not)then \n MsgBox.Info(\"Not a valid number for Buffer\",\"\")\n return Nil\n \n end\n \n buffValue = buffValue.asNumber.Abs\n Mylist.Add(buffValue)\n \n ' ------------------------\n \n MsgDlg = av.FindDialog(\"basins3.MsgDlg\")\n MsgDlg.SetTitle(\"Projecting Grid. Please Wait..\")\n ptCenter = (av.ReturnOrigin + (av.ReturnExtent / (2@2))) - (MsgDlg.ReturnExtent.ReturnSize / (2@2))\n MsgDlg.Open\n System.RefreshWindows\n MsgDlg.MoveTo(ptCenter.GetX, ptCenter.GetY)\n System.RefreshWindows\n \n PROJRUN = _dicGridProjector.get(\"PROJRUN\")\n anum = PROJRUN.call(mylist)\n OutputGrid = dataDir.asString+\"\\grids\\\"+j.asString+repeat.asString\n while (anum = 1)\n repeat = repeat + 1\n mylist = {dataDir.asString+\"\\grids\\\"+i.asString,dataDir.asString+\"\\grids\\\"+j.asString+repeat.asString,dataDir.asString,inflag,outflag}\n anum = PROJRUN.call(mylist)\n OutputGrid = dataDir.asString+\"\\grids\\\"+j.asString+repeat.asString\n end\n \n MsgDlg.Close\n \n \n if (anum <> 7) then\n av.run(\"basins3.projerr \",{anum,dataDir,i.asString,cnum})\n end\n \n if(oUnit <> \"meter\") then\n iUnit=\"meter\"\n uflag=1\n unitDict = av.Run(\"basins3.unitDLL\",{j.asString+repeat.asString,dataDir,iUnit,oUnit,uflag,j.asString})\n anum = unitDict.get(\"anum\")\n OutputGrid = unitDict.get(\"OutputGrid\")\n unitDict = nil\n\n if(anum <> 7) then\n msgBox.info(\"Error During Units Conversion\",\"Error\")\n exit\n end\n end\n outDict = Dictionary.Make(2)\n outDict.add(\"anum\",anum) \n outDict.add(\"OutputGrid\",OutputGrid)\n return outDict \n end\n \n " ) (Script.21 Name: "basins3.runprojnad" SourceCode: "'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n'Execute the nad2nad.dll for each of the grids \n'Called By: BASINS3.NADPROJDLL\n'Calls : \n'Date : 08/16/99\n'Blackland Research Center, Temple, TX\n'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n\n i = self.get(0)\n dataDir = self.get(1)\n theView = self.get(4)\n innadflag = self.get(5)\n outnadflag = self.get(6)\n inflag = self.get(2)\n outflag = self.get(3)\n j= self.get(7)\n innad = self.get(8)\n nadfile = self.get(9)\n \n dataDir.setCWD\n ind = 0\n anum=0\n \n repeat = 0\n mylist = {dataDir.asString+\"\\grids\\\"+i.asString,dataDir.asString+\"\\grids\\\"+j.asString+repeat.asString,dataDir.asString,nadfile,innad}\n MsgDlg = av.FindDialog(\"basins3.MsgDlg\")\n MsgDlg.SetTitle(\"Converting Datum. Please Wait..\")\n ptCenter = (av.ReturnOrigin + (av.ReturnExtent / (2@2))) - (MsgDlg.ReturnExtent.ReturnSize / (2@2))\n MsgDlg.Open\n System.RefreshWindows\n MsgDlg.MoveTo(ptCenter.GetX, ptCenter.GetY)\n System.RefreshWindows\n\n 'msgBox.info(\"I am here 1\",\"\")\n\n anum = _ dicGridProjector.get(\"NADRUN\").call(mylist)\n 'msgBox.info(\"I am here 2\",\"\")\n OutputGrid = dataDir.asString+\"\\grids\\\"+j.asString+repeat.asString\n \n while (anum = 1)\n repeat = repeat + 1\n mylist = {dataDir.asString+\"\\grids\\\"+i.asString,dataDir.asString+\"\\grids\\\"+j.asString+repeat.asString,dataDir.asString,nadfile,innad}\n anum = _dicGridProjector.get(\"NADRUN\").call(mylist)\n OutputGrid = dataDir.asString+\"\\grids\\\"+j.asString+repeat.asString\n end\n \n msgDlg.Close\n outDict = Dictionary.Make(2)\n outDict.add(\"anum\",anum)\n outDict.add(\"OutputGrid\",OutputGrid)\n \n av.PurgeObjects\n return outDict\n " ) (Script.22 Name: "basins3.runprojnadproj" SourceCode: "'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n'Execute the nad.dll for each of the grids \n'Called By: basins3.nadprojdll\n'Date : 08/16/99\n'Blackland Research Center, Temple, TX\n'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n\n i = self.get(0)\n dataDir = self.get(1)\n theView = self.get(2)\n innadflag = self.get(3)\n outnadflag = self.get(4)\n inflag = self.get(5)\n outflag = self.get(6)\n j = self.get(7)\n innad = self.get(8)\n nadfile = self.get(9)\n \n \n inflag=1\n outfalg=0\n \n '############### #############\n '*****Delete temp grids****\n '############################\n \n f = (dataDir.asString+\"\\grids\\ntemp\").asFileName\n s = SrcName.Make(f.AsString)\n if ((s <> NIL) AND (s.Is(SrcName))) then\n grid.deleteDataSet((dataDir.asString+\"\\grids\\ntemp\").asFileName)\n end\n av.PurgeObjects\n \n dataDir.setCWD\n ind = 0\n anum=0\n \n mylist = {dataDir.asString+\"\\grids\\\"+i.asString,dataDir.asString+\"\\grids\\ntemp\",dataDir.asString,nadfile,innad}\n \n MsgDlg = av.FindDialog(\"basins3.MsgDlg\")\n ' MsgBox.info(\"I am here2\",\"\")\n\n MsgDlg.SetTitle(\"Converting Datum. Please Wait..\")\n ptCenter = (av.ReturnOrigin + (av.ReturnExtent / (2@2))) - (MsgDlg.ReturnExtent.ReturnSize / (2@2))\n MsgDlg.Open\n System.RefreshWindows\n MsgDlg.MoveTo(ptCenter.GetX, ptCenter.GetY)\n System.RefreshWindows\n anum = _dicGridProjector.get(\"NADRUN\").call(mylist)\n\n msgDlg.Close\n \n return anum" ) (Script.23 Name: "basins3.unitdll" SourceCode: "'Basins3.UnitsDLL\n'Script for calling the DLL for grid UNIT conversion\n\ninGrid = self.get(0)\ndataDir = self.get(1)\niUnit = self.get(2)\noUnit = self.get(3)\nuFlag = self.get(4)\nj = self.get(5)\nUNITSRUN = _dicGridProjector.get(\"UNITSRUN\")\n\n\nif (uflag = 0) then\n '***Check of a grid named UTEMP already exists and delete\n \n f = (dataDir.asString+\"\\grids\\utemp\").asFileName\n s = SrcName.Make(f.AsString)\n if ((s <> NIL) AND (s.Is(SrcName))) then\n grid.deleteDataSet((dataDir.asString+\"\\gri ds\\utemp\").asFileName)\n end\n\n mylist = {dataDir.asString+\"\\\"+inGrid,dataDir.asString+\"\\grids\\utemp\",\n dataDir.asString,iUnit,oUnit}\n \n MsgDlg = av.FindDialog(\"basins3.MsgDlg\")\n MsgDlg.SetTitle(\"Converting Units. Please Wait..\")\n ptCenter = (av.ReturnOrigin + (av.ReturnExtent / (2@2))) - (MsgDlg.ReturnExtent.ReturnSize / (2@2))\n MsgDlg.Open\n System.RefreshWindows\n MsgDlg.MoveTo(ptCenter.GetX, ptCenter.GetY)\n System.RefreshWindows\n \n anum = UNITSRUN.call(myList)\n \n MsgDlg.Close\n\n return anum\nelseif (uflag = 1) then\n repeat = 0\n mylist = {dataDir.asString+\"\\grids\\\"+inGrid,dataDir.asString+\"\\grids\\\"+j.asString+repeat.asString,\n dataDir.asString,iUnit,oUnit}\n anum = UNITSRUN.call(myList)\n \n MsgDlg = av.FindDialog(\"basins3.MsgDlg\")\n MsgDlg.SetTitle(\"Converting Units. Please Wait..\")\n ptCenter = (av.ReturnOrigin + (av.ReturnExtent / (2@2))) - (MsgDlg.ReturnExtent.ReturnSize / (2@2))\n MsgDlg.Open\n System.RefreshWindows\n MsgDlg.MoveTo(ptCenter.Ge tX, ptCenter.GetY)\n System.RefreshWindows\n\n OutputGrid = dataDir.asString+\"\\grids\\\"+j.asString+repeat.asString\n while (anum = 1)\n repeat = repeat + 1\n mylist = {dataDir.asString+\"\\grids\\\"+inGrid,dataDir.asString+\"\\grids\\\"+j.asString+repeat.asString,\n dataDir.asString,iUnit,oUnit}\n anum = UNITSRUN.call(mylist)\n OutputGrid = dataDir.asString+\"\\grids\\\"+j.asString+repeat.asString\n end\n \n msgDlg.Close\n \n if (anum=7) then\n if(file.exists((dataDir.asString+ \"\\grids\\\"+inGrid).asFileName)) then\n grid.DeleteDataSet((dataDir.asString+\"\\grids\\\"+inGrid).asFileName)\n end\n end\n unitDict = Dictionary.Make(2)\n unitDict.add(\"anum\",anum)\n unitDict.add(\"OutputGrid\",OutputGrid)\n return unitDict\n end\n\n\n" ) (AVDLog.24 Name: "Basins3.ChooseDir" X: 365 Y: 267 W: 421 H: 339 ConstrainedControlNames: 25 ConstrainedControlNames: 26 Constraints: 27 Constraints: 28 Server: 29 ControlPanel: 30 Title: "Grid Projector - Identify Data Directory" EscapeEnabled: 1 Modal: 1 Resizable: 1 AlwaysOnTop: 1 HasTitleBar: 1 Closeable: 1 Open: "basins3.DirBrowserOpen" DefaultButton: 29 ) (AVStr.25 S: "lbnOK" ) (AVStr.26 S: "lbnCancel" ) (Numb.27 N: 85.00000000000000 ) (Numb.28 N: 85.00000000000000 ) (Nil.29 ) (CPanel.30 Child: 31 Child: 34 Child: 35 Child: 36 Child: 37 Child: 38 Child: 40 ResBox: 41 ResBox: 42 ResBox: 43 ResBox: 44 ResBox: 45 ResBox: 46 ResBox: 47 Listening: 1 ) (AVLBox.31 InternalName: "lbxDirs" NextControl: 29 ContentKind: 4 Constraints: 0x55 Listening: 1 VerticalScroll: 1 SelectionStyle: 33 Apply: "basins3.Browser" ) (Nil.32 ) (AVEnum.33 Name: "LISTBOX_SELECTION_SINGLECELL" ) (AVCBBox.34 InternalName: "cbxDrives" NextControl: 29 ContentKind: 4 Constraints: 0x55 Listening: 1 Select: "basins3.Browser" ) (LButn.35 InternalName: "lbnOK" Label: "OK" Click: "basins3.Browser" ) (LButn.36 InternalName: "lbnCancel" Label: "Cancel" Click: "basins3.Browser" ) (TextLabel.37 InternalName: "driveLabel" Constraints: 0x55 Label: "Drive:" Listening: 1 ) (TextLine.38 InternalName: "tlnPath" Label: "Path:" Constraints: 0x55 Listening: 1 TextType: 39 Apply: "basins3.Browser" NextControl: 29 ) (AVEnum.39 Name: "TEXTLINE_TYPE_ALL" ) (TextLabel.40 InternalName: "aTextLabel2" Constraints: 0x55 Label: "Please choose the data directory:" Listening: 1 ) (RectD.41 Left: 21.00000000000000 Top: 275.00000000000000 Right: 289.00000000000000 Bottom: 85.00000000000000 ) (RectD.42 Left: 18.00000000000000 Top: 449.00000000000000 Right: 275.00000000000000 Bottom: 305.00000000000000 ) (RectD.43 Left: 314.00000000000000 Top: 119.00000000000000 Right: 410.00000000000000 Bottom: 87.00000000000000 ) (RectD.44 Left: 314.00000000000000 Top: 163.00000000000000 Right: 410.00000000000000 Bottom: 130.00000000000000 ) (RectD.45 Left: 21.00000000000000 Top: 299.00000000000000 Right: 153.00000000000000 Bottom: 282.00000000000000 ) (RectD.46 Left: 21.00000000000000 Top: 47.00000000000000 Right: 411.00000000000000 Bottom: 27.00000000000000 ) (RectD.47 Left: 23.00000000000000 Top: 85.00000000000000 Right: 239.00000000000000 Bottom: 59.00000000000000 ) (AVDLog.48 Name: "basins3.dlg_gridproj" X: 246 Y: 68 W: 508 H: 403 HelpTopic: "Projection Conversion tool for ArcView/ArcInfo Grids in ArcView Environment" ConstrainedControlNames: 49 ConstrainedControlNames: 50 ConstrainedControlNames: 51 ConstrainedControlNames: 52 ConstrainedControlNames: 53 Constraints: 54 Constraints: 55 Constraints: 56 Constraints: 57 Constraints: 58 Server: 29 ControlPanel: 59 Title: "Grid Projector" Modal: 1 AlwaysOnTop: 1 HasTitleBar: 1 Closeable: 1 Open: "basins3.GridProjOpen" DefaultButton: 103 ) (AVStr.49 S: "lbnInProj" ) (AVStr.50 S: "lbnOutProj" ) (AVStr.51 S: "lbnCancel" ) (AVStr.52 S: "lbnOK" ) (AVStr.53 S: "aLabelButton1" ) (Numb.54 N: 85.00000000000000 ) (Numb.55 N: 85.00000000000000 ) (Numb.56 N: 85.00000000000000 ) (Numb.57 N: 85.00000000000000 ) (Numb.58 N: 85.00000000000000 ) (CPanel.59 Child: 60 Child: 80 Child: 94 Child: 103 Child: 104 Child: 105 ResBox: 106 ResBox: 107 ResBox: 108 ResBox: 109 ResBox: 110 ResBox: 111 Listening: 1 ) (CPanel.60 InternalName: "aControlPanel10" Child: 62 Child: 63 Child: 64 Child: 65 Child: 66 Child: 67 Child: 68 Child: 69 Child: 70 Constraints: 0x55 ResBox: 71 ResBox: 72 ResBox: 73 ResBox: 74 ResBox: 75 ResBox: 76 ResBox: 77 ResBox: 78 ResBox: 79 Label: "Datum Conversion" VisibleBorder: 1 Listening: 1 ) (Nil.61 ) (TextLabel.62 InternalName: "regText" Constraints: 0x55 Label: "Region:" Listening: 1 ) (AVCBBox.63 InternalName: "regList" Help: "Select the region of the grid to be datum shifted" Tag: "Region of the Grid to be datum shifted " NextControl: 29 ContentKind: 4 Constraints: 0x55 Listening: 1 Select: "basins3.projselect" ) (TextLabel.64 InternalName: "stText" Constraints: 0x55 Label: "State:" Listening: 1 ) (AVCBBox.65 InternalName: "stList" Help: "Select a state for using high precision GPS data. If a state is not listed choose \"Other\"." NextControl: 29 ContentKind: 4 Constraints: 0x55 Listening: 1 ) (TextLabel.66 InternalName: "outDatText" Constraints: 0x55 Label: "Output Datum:" Listening: 1 ) (TextLabel.67 InternalName: "inDatText" Constraints: 0x55 Label: "Input Datum:" Listening: 1 ) (AVCBBox.68 InternalName: "outList" Help: "Datum of the output grid" NextControl: 29 ContentKind: 4 Constraints: 0x55 Listening: 1 Select: "basins3.projselect" ) (AVCBBox.69 InternalName: "inList" Help: "Datum of the input grid. If you do not want any datum conversion, choose \"other\"." NextControl: 29 ContentKind: 4 Constraints: 0x55 Listening: 1 Select: "basins3.projselect" ) (TextLabel.70 InternalName: "aTextLabel24" Constraints: 0x55 Label: "Choose only if you need to convert to & from NAD 27 - NAD 83 datums:" Listening: 1 ) (RectD.71 Left: 23.00000000000000 Top: 122.00000000000000 Right: 124.00000000000000 Bottom: 104.00000000000000 ) (RectD.72 Left: 20.00000000000000 Top: 144.00000000000000 Right: 170.00000000000000 Bottom: 127.00000000000000 ) (RectD.73 Left: 187.00000000000000 Top: 134.00000000000000 Right: 243.00000000000000 Bottom: 105.00000000000000 ) (RectD.74 Left: 188.00000000000000 Top: 151.00000000000000 Right: 363.00000000000000 Bottom: 125.00000000000000 ) (RectD.75 Left: 191.00000000000000 Top: 80.00000000000000 Right: 262.00000000000000 Bottom: 57.00000000000000 ) (RectD.76 Left: 24.00000000000000 Top: 76.00000000000000 Right: 86.00000000000000 Bottom: 55.00000000000000 ) (RectD.77 Left: 188.00000000000000 Top: 93.00000000000000 Right: 304.00000000000000 Bottom: 76.00000000000000 ) (RectD.78 Left: 23.00000000000000 Top: 99.00000000000000 Right: 139.00000000000000 Bottom: 78.00000000000000 ) (RectD.79 Left: 19.00000000000000 Top: 69.00000000000000 Right: 358.00000000000000 Bottom: 26.00000000000000 ) (CPanel.80 InternalName: "aControlPanel9" Child: 81 Child: 82 Child: 83 Child: 84 Child: 86 Child: 87 Constraints: 0x55 ResBox: 88 ResBox: 89 ResBox: 90 ResBox: 91 ResBox: 92 ResBox: 93 Label: "Projection Conversion" VisibleBorder: 1 Listening: 1 ) (LButn.81 InternalName: "lbnInProj" Label: "Input Grid Projection" Click: "basins3.dlg_Grid_InPrj_Driver" ) (LButn.82 InternalName: "lbnOutProj" Label: "Output Grid Projection" Click: "basins3.dlg_Grid_OutPrj_Driver" ) (AVCBox.83 InternalName: "chkAddtoView" Listening: 1 Label: "Add Projected Grid to a View" Constraints: 0x55 ) (TextLine.84 InternalName: "txl.buffer" Label: " " Constraints: 0x55 Listening: 1 TextType: 85 Size: 6 NextControl: 29 ) (AVEnum.85 Name: "TEXTLINE_TYPE_INTEGER" ) (TextLabel.86 InternalName: "aTextLabel2" Constraints: 0x55 Label: "Buffer:" Listening: 1 ) (TextLabel.87 InternalName: "aTextLabel3" Constraints: 0x55 Label: "Cells" Listening: 1 ) (RectD.88 Left: 39.00000000000000 Top: 60.00000000000000 Right: 156.00000000000000 Bottom: 22.00000000000000 ) (RectD.89 Left: 230.00000000000000 Top: 62.00000000000000 Right: 346.00000000000000 Bottom: 23.00000000000000 ) (RectD.90 Left: 206.00000000000000 Top: 87.00000000000000 Right: 379.00000000000000 Bottom: 73.00000000000000 ) (RectD.91 Left: 62.00000000000000 Top: 88.00000000000000 Right: 122.00000000000000 Bottom: 68.00000000000000 ) (RectD.92 Left: 23.00000000000000 Top: 91.00000000000000 Right: 62.00000000000000 Bottom: 72.00000000000000 ) (RectD.93 Left: 130.00000000000000 Top: 91.00000000000000 Right: 163.00000000000000 Bottom: 72.00000000000000 ) (CPanel.94 InternalName: "aControlPanel15" Child: 95 Child: 96 Child: 97 Child: 98 Constraints: 0x55 ResBox: 99 ResBox: 100 ResBox: 101 ResBox: 102 Label: "X-Y Coordinate Unit Conversion" VisibleBorder: 1 Listening: 1 ) (AVCBBox.95 InternalName: "inUnits" NextControl: 29 ContentKind: 4 Constraints: 0x55 Listening: 1 ) (AVCBBox.96 InternalName: "outUnits" NextControl: 29 ContentKind: 4 Constraints: 0x55 Listening: 1 ) (TextLabel.97 InternalName: "aTextLabel22" Constraints: 0x55 Label: "Input Units:" Listening: 1 ) (TextLabel.98 InternalName: "aTextLabel23" Constraints: 0x55 Label: "Output Units:" Listening: 1 ) (RectD.99 Left: 53.00000000000000 Top: 69.00000000000000 Right: 162.00000000000000 Bottom: 52.00000000000000 ) (RectD.100 Left: 212.00000000000000 Top: 70.00000000000000 Right: 320.00000000000000 Bottom: 50.00000000000000 ) (RectD.101 Left: 54.00000000000000 Top: 55.00000000000000 Right: 150.00000000000000 Bottom: 26.00000000000000 ) (RectD.102 Left: 215.00000000000000 Top: 56.00000000000000 Right: 311.00000000000000 Bottom: 28.00000000000000 ) (LButn.103 InternalName: "lbnCancel" Label: "Cancel" Click: "basins3.GridProjDriver" ) (LButn.104 InternalName: "lbnOK" Label: "OK" Click: "basins3.GridProjDriver" ) (LButn.105 InternalName: "aLabelButton1" Label: "Help" Click: "basins3.brc.GridProjector.Help" ) (RectD.106 Left: 21.00000000000000 Top: 388.00000000000000 Right: 400.00000000000000 Bottom: 222.00000000000000 ) (RectD.107 Left: 20.00000000000000 Top: 121.00000000000000 Right: 395.00000000000000 Bottom: 23.00000000000000 ) (RectD.108 Left: 20.00000000000000 Top: 214.00000000000000 Right: 398.00000000000000 Bottom: 126.00000000000000 ) (RectD.109 Left: 411.00000000000000 Top: 113.00000000000000 Right: 483.00000000000000 Bottom: 83.00000000000000 ) (RectD.110 Left: 411.00000000000000 Top: 73.00000000000000 Right: 483.00000000000000 Bottom: 43.00000000000000 ) (RectD.111 Left: 411.00000000000000 Top: 158.00000000000000 Right: 483.00000000000000 Bottom: 128.00000000000000 ) (AVDLog.112 Name: "Basins3.MsgDlg" X: 378 Y: 352 W: 267 H: 56 Server: 29 ControlPanel: 113 Title: "Projecting Grid. Please Wait.." EscapeEnabled: 1 HasTitleBar: 1 Open: "basins3.brc.MsgDlg.Open" DefaultButton: 29 ) (CPanel.113 Child: 114 ResBox: 116 Listening: 1 ) (AVIBox.114 InternalName: "aIconBox4" Constraints: 0x55 Icon: 115 Listening: 1 ) (AVIcon.115 Name: "Execute" Res: "Icons.Execute" ) (RectD.116 Left: 106.00000000000000 Top: 52.00000000000000 Right: 166.00000000000000 Bottom: 11.00000000000000 ) (Nil.117 ) (Script.118 Name: "ExtensionUnLoad" SourceCode: "\nreturn Nil\n\nif(av.GetProject<>Nil)then\n\n\n for each aDialog in av.GetProject.GetDialogs \n aDialog.SetObjectTag(Nil)\n for each aListBox in aDialog.Findbyclass(ListBox)\n aListBox.Empty \n end\n end \n \n\n\n Dialog.DetachFromExtension(self) \n \nend " ) (Script.119 Name: "ExtensionInstall" SourceCode: "'Script: ExtensionInstall \n' ------------------ \n\n if (av.getproject=nil) then return(nil) end \n \n \n theString = \"Automatic Watershed Delineation\"\n\n theFname1 = FileName.Merge(\"$AVEXT\".asFileName.GetFullName,\"spatial.avx\")\n theFname2 = FileName.Merge(\"$AVBIN\".asFileName.GetFullName,\"avgrid.dll\")\n\n if((File.Exists(theFname1).Not)or(File.Exists(theFname2).Not))then \n MsgBox.Info(\"Can not load this extension.\"+nl\n +\"Spatial Analyst is not installed !!\",theString) \n r eturn Nil \n end\n \n' ------------------------------ \n\n'* theMenuBar = av.GetProject.FindGui(\"View\").GetMenuBar \n'* theMenu = theMenuBar.FindByLabel(\"Surface\") \n \n'* if(theMenu<> nil)then \n'* theMenu.SetVisible(false) \n'* end \n\n'* theMenuBar = av.GetProject.FindGui(\"View\").GetMenuBar \n'* theMenu = theMenuBar.FindByLabel(\"Analysis\") \n \n'* if(theMenu<> nil)then \n'* theMenu.SetVisible(false) \n'* end \n \n' ------------------\n' Scripts and Dialogs are not installed: they are in the extension\n' -------------------\n \n theMenuObject = Self.Get(0) ' (0) \n theChoiceObject1 = Self.Get(1) ' (1)\n MenuFound = av.run(\"basins3.MenuAdd\",{theMenuObject,theChoiceObject1}) \n \n' ------------------------------ \n" ) (Script.120 Name: "ExtensionUninstall" SourceCode: "' --------------\n'' if (av.getproject=nil) then return(nil) end\n\n'' if (av.GetProject.IsClosing)then \n'' return Nil\n'' end \n\n' -----------------\n\n'Remove the menu Choices\n\n \n theMenuObject = av.GetProject.FindGUI(\"View\").GetMenuBar.FindbyLabel(\"Data\") '(0)\n theChoiceObject1 = theMenuObject.FindbyLabel(\"Grid Projector\") '(1) \n av.run(\"BASINS3.MenuRemove\", {theMenuObject, theChoiceObject1}) \n \n' ----------------------------- \n\n av.getproject.s etmodified(true) \n \n' ----------- \n\n\n" )