Select to view content in your preferred language

TraceFlowsolver.FindFlowElements Fails

4113
1
10-02-2014 01:23 PM
EdwardBlair
Occasional Contributor

Hello -

 

Have got a program that tries to perform a "Find Connected" trace  on a network starting on a edge on which an edge flag has been placed and bounded by a set of edge barriers.  It consistently fails at this line:

 

 

tfs.FindFlowElements(esriFlowMethod.esriFMConnected, edgeElements, out junctionEIDs, out edgeEIDs);

 

With this error message:

+  $exception {"Attempted to read or write protected memory. This is often an indication that other memory is corrupt."} System.Exception {System.AccessViolationException}

 

where tfs is a ITraceFlowSolverGEN

 

Barriers are set on edges where an intersection is found between a selected polygon graphic and a line feature and the origin flag is set on the longest line feature found inside the polygon.  The method where the trace is attempted is "ExecuteTrace." The full C# class is attached.

 

I should also say that on occasion the trace has not failed, however its returned results that are the inverse of what I expected -- that is, everything OUTSIDE the polygon is traced when I thought everything INSIDE the polygon would be.

 

Thanks in advance for any suggestions,

Ed

 

 

 


0 Kudos
1 Reply
EdwardBlair
Occasional Contributor

Found the problem.  I was not getting the value for UserSubID correctly when setting barriers and flags.  When corrected the routine now works fine.

Ed

0 Kudos