AnsweredAssumed Answered

Programmatically add barriers to geometric network

Question asked by SamuelHenderson on Apr 23, 2015
Latest reply on Jun 1, 2016 by pk_davidson

Hi everyone,


I'm developing an ArcMap add-in that will run a trace against a water main that the user has selected using the selection tool.  The geometric is already defined and I can run the trace by manually placing the edge barriers at each end of the main, putting an edge flag somewhere on the water main between the edge barriers and then tracing downstream (using indeterminate flow).  Basically I am displaying a list of all the customers that are receiving water from that water main.


I'd like to automate this so that the user doesn't need to place barriers or flag(s) but just needs to select the water main and hit a button to preform the trace.  I guess my pseudocode would be something like:


  1. User selects a water main
  2. User clicks my Add-In button
    1. Place Edge Barrier at both ends of selected water main segment
    2. Place Flag somewhere between barriers
    3. Run the trace getting all the curbstop valves fed by the water main


As I said I can already perform the trace manually, I just want things to be automated.  How would I do this?