'------------------------------------------ '-----------Creation Information----------- '------------------------------------------ ' 'Name: Start 'Author: Cindy How 'Date: July 8, 1997 ' '------------------------------------------ '----------------Purpose------------------- '------------------------------------------ ' 'This script was created to explore and test 'the proposed file structure for the naUTilus/ 'ArcView system. It should be run from the 'directory which holds the OSBL.APR file. In 'this main directory, subdirectories should 'exist for each ISBL unit attached to the 'OSBL unit represented. No other subdirectories 'should exist. ' 'This script finds all the subdirectories '(assumed to hold an ISBL.apr project) and 'creates a table in the OSBL project which will 'or does hold the data on ISBL effluent. ' 'This table will be used to hold data for 'input to the OSBL unit from the ISBL units. ' 'This script will also open a view for the OSBL 'unit and each ISBL unit, titled by the name 'given to the directory in which the information 'is stored. ' 'THIS IS A WORK IN PROGRESS ' '------------------------------------------ '---------Get Initial Information---------- '------------------------------------------ TheProject = av.GetProject ProjName = TheProject.GetFileName.GetBaseName.AsString PrName = ProjName.BasicTrim("",".apr") 'open OSBL view titled by project name OView = View.Make OView.SetName(PrName) OSBLWin = Oview.GetWin 'Add OSBL Themes to OView BrSrc = SrcName.Make("obranch.shp") 'create the sourceNames NDSrc = SrcName.Make("onode.shp") BrTheme = Theme.Make(BrSrc) 'make the themes NdTheme = Theme.Make(NdSrc) OView.AddTheme(BrTheme) 'Add the themes OView.AddTheme(NdTheme) BrTheme.SetVisible(true) 'display the themes NdTheme.SetVisible(true) 'change appearance of themes BrLegend = BrTheme.GetLegend NdLegend = NdTheme.GetLegend BrSymbs = BrLegend.GetSymbols NdSymbs = Ndlegend.GetSymbols Col1 = Color.GetBlue Col2 = Color.GetGray Brsymbs.UniformColor(Col1) NdSymbs.UniformColor(Col2) OSBLWin.Open TheDir = FN.GetCWD ISBLList = TheDir.Read("*.isb") ListCount = ISBLList.Count NameList = List.Make For each i in 1..ListCount Idx = i - 1 ISBLUnit = ISBLList.Get(idx) ISBLName = ISBLUnit.GetBaseName NameList.Add(ISBLName) end TabList = TheDir.Read("*.dbf") TabCount = TabList.Count For each i in 1..TabCount idx = i - 1 Tabname = TabList.get(idx) Tname = Tabname.GetBaseName TabList.Set(idx,Tname) end FindTab = TabList.FindByValue("isbllist.dbf") if (findtab = -1) then TabName = "isbllist.dbf".AsFilename TheTab = Vtab.MakeNew(TabName,dBase) NFld = Field.Make("ISBL_Name",#Field_Char,10,0) ASFld = Field.Make("Ab_sew_emm",#Field_decimal,10,4) SEFld = Field.Make("Strip_eff",#Field_decimal,10,4) MIFld = Field.Make("Mass_In",#Field_decimal,10,4) ERFld = Field.Make("Emm_rate",#Field_decimal,10,4) TheTab.AddFields({NFld,ASFld,SEFld,MIFld,ERFld}) for each i in 1..ListCount TheTab.AddRecord Idx = i - 1 IName = NameList.Get(Idx).AsString TheTab.SetValue(NFld,Idx,IName) end else TabName = av.GetProject.FindDoc("isbllist.dbf") TheTab = TabName.GetVtab end TheTable = Table.Make(TheTab) TheTable.SetName("isbllist.dbf") TheTab.SetEditable(False) '------------------------------------------ '-----------Add ISBL Views----------------- '------------------------------------------ OldDir = FN.GetCWD For each record in TheTab NewView = View.Make ViewName = TheTab.ReturnValue(NFld,record) NewView.SetName(ViewName) NewWin = NewView.GetWin TheDir = ViewName.AsFilename TheDir.SetCWD IBrSrc = SrcName.Make("ibranch.shp") 'create the sourceNames INDSrc = SrcName.Make("inodes.shp") IBrTheme = Theme.Make(IBrSrc) 'make the themes INdTheme = Theme.Make(INdSrc) NewView.AddTheme(IBrTheme) 'Add the themes NewView.AddTheme(INdTheme) IBrTheme.SetVisible(true) 'display the themes INdTheme.SetVisible(true) OldDir.SetCWD 'change appearance of themes IBrLegend = IBrTheme.GetLegend INdLegend = INdTheme.GetLegend IBrSymbs = IBrLegend.GetSymbols INdSymbs = INdlegend.GetSymbols Col1 = Color.GetBlue Col2 = Color.GetGray IBrsymbs.UniformColor(Col1) INdSymbs.UniformColor(Col2) end