document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. public void Execute()
  2. {
  3.     // Load Selected Features
  4.     LoadSelectedFeatures();
  5.  
  6.     // Show the form
  7.     IntPtr p = new IntPtr(m_pApp.hWnd);
  8.     Show((Form)System.Windows.Forms.Form.FromHandle(p));
  9. }
  10.  
  11. private void LoadSelectedFeatures()
  12. {
  13.     // Get the active map and use it to get the current selection
  14.     IMap pMap = m_MxDoc.FocusMap;
  15.     IEnumFeature pFeatures = (IEnumFeature)pMap.FeatureSelection;
  16.     IFeature pFea = pFeatures.Next();
  17.     while (pFea != null)
  18.     {
  19.         // If the feature has a gas trace weight field, then try to interpret it
  20.         int gasTraceWeightFI = pFea.Fields.FindField("GasTraceWeight");
  21.         if (gasTraceWeightFI > -1)
  22.         {
  23.             if (pFea.Shape.GeometryType == esriGeometryType.esriGeometryPolyline)
  24.                 InterpretLineFeature(pFea, gasTraceWeightFI);
  25.             else if (pFea.Shape.GeometryType == esriGeometryType.esriGeometryPoint)
  26.                 InterpretPointFeature(pFea, gasTraceWeightFI);
  27.         }
  28.             pFea = pFeatures.Next();
  29.     }
  30. }
');