Select to view content in your preferred language

Looping IEnumNetEID Geometric Network Trace Results

2627
2
09-28-2010 02:45 PM
PeterWilt
New Contributor
I developed a custom geometric network trace solver function that repeatedly traces a geometric network and dynamically adds and deletes barriers for each trace.  After each trace runs, I need to determine if particular features (EIDs) in the network were reached by the trace.  In my current solution, I loop through each EID from the trace result???s IEnumNetEID enumeration.  Once the desired EID is found, I break the loop and start the tracing process over.

This works, but it can be extremely slow when the result enumeration reaches thousands of records.  What???s the optimal way to determine if an IEnumNetEID contains a particular EID value?  Is there any way to check the trace results without looping?

It would be great to see an  ???IEnumNetEID.Contains??? method, similar to a generic array.  I tried casting the IEnumNetEID to various array formats and also using IEIDHelper with no success.  Any suggestions?  I???m using C# and Arc v10.  Thanks!
0 Kudos
2 Replies
PeterWilt
New Contributor
If anyone is interested, I solved this problem by storing pertinent EIDs in a List<int> and using IForwardStar to step through the network from a given origin.  At each network feature, the code performs a List.Contains and I am able to track which of the pertinent EIDs were reached.  Performance is actually much faster than using the trace solvers and the results are easier to manipulate for this particular application.
0 Kudos
NathanAmboy
Deactivated User
HEY!  I'm very interested.  I'm attempting to do something similar for a Route Network.  Same problem, the TraversalResult stuff steps me through each 'Edge' arc, whereas I want to loop through each Route and determine the arcs that make up that route.  I think you code may help me.  If you could send it as text in the body of an e-mail??  namboy@fs.fed.us
0 Kudos