'---------------------------------------------- '---------Creation Information----------------- '---------------------------------------------- ' 'Name: junction 'Author: Cindy How 'Date: 6/23/97 ' '---------------------------------------------- '------------Purpose/Description--------------- '---------------------------------------------- ' 'This script will take all points in the onodes.shp 'theme and find which are terminal points (elbows 'vs online drains or manholes). It also flags 'the nodes which are junctions with no manholes 'by calling on the script SELJUNC. ' 'FOR USE ON OSBL UNITS ' '----------------------------------------------- '-------------------Input----------------------- '----------------------------------------------- ' '1. Attribute table for the theme nodes ' '----------------------------------------------- '------------------Output----------------------- '----------------------------------------------- ' '1. Added field to node theme, indicating elbow (-1) ' or online drain or manhole (numbered) ' '----------------------------------------------- '---------Get Initial Information--------------- '----------------------------------------------- TheProject = av.GetProject TheView = av.GetActiveDoc TheTheme= TheView.FindTheme("Onode.shp") TheFtab = TheTheme.GetFtab TheField = TheFtab.FindField("Osbl_") TheField.SetAlias("Onodes") BrTheme = TheView.FindTheme("Obranch.shp") BrTab = BrTheme.GetFtab TNodeField=BrTab.FindField("Tnode_") FnodeField = BrTab.FindField("Fnode_") '----------------------------------------------- '-----Add New Fields to Node Attribute Table---- '----------------------------------------------- TheFtab.setEditable(true) TypeFld=Field.make("Node_Type",#Field_short,4,0) NodeFld=Field.make("Node",#Field_short,4,0) NTypeFld = Field.make("Junction",#Field_short,4,0) BFld = Field.make("Ex_br",#Field_short,4,0) TheFtab.AddFields({TypeFld,NodeFld,NTypeFld,Bfld}) TNodeList = List.Make 'Makes List of "to Nodes" Fnodelist = list.make 'makes a list of "from nodes" i=0 For each rec in BrTab TNode = BrTab.ReturnValue(TNodeField,i) TNodeList.Add(Tnode) Fnode = BrTab.ReturnValue(FnodeField,i) Fnodelist.Add(Fnode) i = i +1 end j= 1 'Assigns value of -1 to the field "Node_Type" for terminal nodes For each rec in TheFtab Check = TNodeList.FindbyValue(j) If (check = -1) then TheFtab.SetValue(TypeFld,rec,check) else TheFtab.SetValue(TypeFld,rec,1) end Check2 = FnodeList.FindByValue(j) If (check2 = -1) then TheFtab.SetValue(typeFld,rec,2) 'set type value of last node in system to 2 (last node by ArcView system) Else end j = j+1 end '---------------------------------------------- '-----------Junction or Manhole---------------- '---------------------------------------------- av.run("graphic.SelectAll",{}) av.run("View.DeleteGraphics",{}) 'Prompt user to select which nodes represent manholes. 'Assign a value of 1 to manholes and -1 to junctions msgbox.info("Click on the nodes which represent junctions with no manholes","Select junctions") av.run("seljunc",{})