Read Trace result in order of spatial appearance

Discussion created by amargupta on Oct 18, 2010
Latest reply on Nov 18, 2014 by FUNDFGMBH

I have a geometric network and I am doing a simple connected Trace programatically. e.g.
//Run trace
pNewTrace.FindFlowElements(esriFlowMethod.esriFMConnected, esriFlowElements.esriFEJunctionsAndEdges, out pJuncSel, out pEdgeSel);

After running the trace function, I need to read the features from the result set (edges and junctions) in the order of their spatial appearance from the start point of the trace. What I get in the result is junctions and edges in the increasing order of their network ids - pJuncSel, pEdgeSel.
Is there any way to get the features in the order of their spatial location from the start point of the Trace.

Please let me know if the my question is not clear.