Routing Problem

648
1
04-13-2012 12:03 PM
GhadaAssabry
New Contributor
Hi,
I have a problem with the FindRoute() method
private void FindRoute()
        {

            //System.Windows.Forms.Cursor Cursor = this.Cursor;
            try
            {
                //this.Cursor = Cursors.WaitCursor;

                // set highways priority (0.0 - 100.0)   
               // SMRoadPreferences objPreferences = m_objRouter.Preferences;
                //objPreferences.set_Item(esriSMRoadType.esriSMRoadTypeHighways, (short)100);

                // set route type (Time/Length)   
              m_objRouter.NetAttributeName = "Length";                 //<= EXCEPTION AT THIS LINE

                // Set Length Units for Directions output
                SetDirectionsUnits();

==========================================================
It throws an exception here -> m_objRouter.NetAttributeName = "Length";
any suggestions??
Tags (2)
0 Kudos
1 Reply
JaySandhu
Esri Regular Contributor
Is this the entire code or is there more? Does the m_objRouter object exist by the time you are calling the NetAttributeName method on it?

Jay Sandhu
0 Kudos