Select to view content in your preferred language

Pipe Invert Script

2471
0
01-10-2014 05:19 AM
ToddNordyke1
Emerging Contributor
Hi All,
Below is my first attemt at writing a script for ArcPad to get Pipe Inverts.  The calculation I'm attempting is Pipe Invert = Manhole Rim Elev - Measuredown.  I will have fields to cover Pipes going North, South, East, and West. The calc will run fine for the North Invert but will not calc through if I have to skip a pipe direction.  The script's calculations run N first then,S,E,W.  For example the West calculation will work, but only if it has entries/validates thru N,S,and E first.  I've tried some IF,THEN, and Null statements but really don't know what I'm doing.  Hope I was clear enough for everyone to understand.

sub PipeInvert()

'Pipe Invert Elevations
dim RIMELEV, MEASUREDOWN_N, MEASUREDOWN_S, MEASUREDOWN_E, MEASUREDOWN_W, INVERTN, INVERTS, INVERTE, INVERTW

'Form Values
RIMELEV = Application.Map.Layers("MH").Forms("EDITFORM").Pages("PAGE1").Controls("txtRIMELEV").Value
MEASUREDOWN_N = Application.Map.Layers("MH").Forms("EDITFORM").Pages("PAGE1").Controls("txtMEASUREDOWN_N").Value
MEASUREDOWN_S = Application.Map.Layers("MH").Forms("EDITFORM").Pages("PAGE1").Controls("txtMEASUREDOWN_S").Value
MEASUREDOWN_E = Application.Map.Layers("MH").Forms("EDITFORM").Pages("PAGE1").Controls("txtMEASUREDOWN_E").Value
MEASUREDOWN_W = Application.Map.Layers("MH").Forms("EDITFORM").Pages("PAGE1").Controls("txtMEASUREDOWN_W").Value

'Pipe Invert = Rim Elevation - Measuredown
Application.Map.Layers("MH").Forms("EDITFORM").Pages("PAGE1").Controls("txtINVERTN").Value = (RIMELEV) - (MEASUREDOWN_N)
Application.Map.Layers("MH").Forms("EDITFORM").Pages("PAGE1").Controls("txtINVERTS").Value = (RIMELEV) - (MEASUREDOWN_S)
Application.Map.Layers("MH").Forms("EDITFORM").Pages("PAGE1").Controls("txtINVERTE").Value = (RIMELEV) - (MEASUREDOWN_E)
Application.Map.Layers("MH").Forms("EDITFORM").Pages("PAGE1").Controls("txtINVERTW").Value = (RIMELEV) -(MEASUREDOWN_W)

end sub


Thanks for reading
Todd
Tags (3)
0 Kudos
0 Replies