'---------------------------------------------- '---------Creation Information----------------- '---------------------------------------------- ' 'Name: brtab 'Author: Cindy How 'Date: 6/97 ' '---------------------------------------------- '------------Purpose/Description--------------- '---------------------------------------------- ' 'This script will use the branch theme of the 'ISBL system and, like DRAININPUT and CONNECTIVITY, 'continue to create the input file by describing 'the reach/branch characteristics as naUTilus requires. ' 'The required data is copied from the branch 'attribute table to a new table called brtable.dbf ' '----------------------------------------------- '-------------------Input----------------------- '----------------------------------------------- ' '1. Attribute table for the theme ibranch ' '----------------------------------------------- '------------------Output----------------------- '----------------------------------------------- ' '1. New table called brtable.dbf holding the information ' on branch diameter, length, and slope needed ' to create part of the naUTilus input file. ' ' '----------------------------------------------- '---------Get Initial Information--------------- '----------------------------------------------- TheView = av.getActiveDoc BrTheme = theView.Findtheme("ibranch.shp") BrTab = BrTheme.GetFtab 'Find Fields: LFld = BrTab.FindField("Length") '----------------------------------------------- '-------------Add New Table/Fields-------------- '----------------------------------------------- NewName = "brtable.dbf".AsFilename NewTab = VTab.MakeNew(NewName,dBase) NewLFld = Field.Make("Length",#Field_Float,8,2) DiamFld = Field.Make("Diameter",#Field_Float,8,2) SlopeFld = Field.Make("Slope",#Field_Float,8,2) NewTab.AddFields({NewLfld,DiamFld,SlopeFld}) NewTab.SetEditable(true) '----------------------------------------------- '---------------Prompt for input---------------- '----------------------------------------------- defd = 1 defs = 0.1 DDiam = msgbox.input("Please enter the default diameter.","Default diameter",defd.AsString) Dslope = msgbox.input("Please enter the default slope.","Default slope",defS.AsString) For each record in BrTab 'fill table with default values NewTab.AddRecord brlength = BrTab.ReturnValue(LFld,record) NewTab.SetValue(NewLfld,record,brlength) NewTab.SetValue(DiamFld,record,defd) NewTab.SetValue(SlopeFld,record,defs) end NewTab.SetEditable(False) TheTab = Table.Make(NewTab) TheTab.SetName("brtable.dbf") '----------------------------------------------- '---------------------END----------------------- '-----------------------------------------------