Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am working with VBA in ArcGIS.I want to use "Traceflowsolver.findpath" but I recieved an error on "SegmentCost".I need to see an example about this subject .anyone can help me? Also my code is: " traceFlowSolver.FindPath esriFMDownstream, esriSPObjFnMinSum, junctionEIDs, edjeEIDs, count, Segment"

share|improve this question
up vote 1 down vote accepted

Try assigning weights first using INetSolverWeights.

Update: See this sample:

' get the INetSchema interface
  Set ipNetSchema = ipNetwork
  Set ipNetWeight = ipNetSchema.WeightByName(WeightName)
  Debug.Assert Not ipNetWeight Is Nothing

  ' set the weight (use the same for both directions)
  Set ipNetSolverWeights = ipTraceFlowSolver
  Set ipNetSolverWeights.FromToEdgeWeight = ipNetWeight
  Set ipNetSolverWeights.ToFromEdgeWeight = ipNetWeight
share|improve this answer
Thank you for your fast reply! But I couldn't solve the problem with your advice yet. – Nima Jan 7 '11 at 16:05
see my update above. – Kirk Kuykendall Jan 7 '11 at 16:24
tnx alot.My problem is solved and I can do my thesis. – Nima Jan 7 '11 at 18:28

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.