Home > Net >  C # realize FeatureToLine function of AE
C # realize FeatureToLine function of AE

Time:11-20

My main problem is the program runs without error, but there is no output, the output in the target directory file without output line elements, a great god please help look at what went wrong,
The code is as follows:
Private string feature2line (string zadress)
{
Try
{
//call the GP tool
Geoprocessor toLineGeoprocessor=new Geoprocessor ();
//initialization space
ToLineGeoprocessor. SetEnvironmentValue (" workspace "@" C: \ Users \ \ Documents \ 16270 ArcGIS \ Default GDB ");
ToLineGeoprocessor. OverwriteOutput=true;

//input file name and save the path

String featureToLine=OutFilePath + "\ " + OutFileName;//path + name
//MessageBox. Show (featureToLine);
//in the file exists, if any, delete
If (the File. The Exists (featureToLine))
{
File. The Delete (featureToLine);
}
//initialize FeatureToLine tool
FeatureToLine newFeatureToLine=new FeatureToLine ()
{
In_features=zadress,//to be converted to line the SHP file (must be a polygon)
Out_feature_class=featureToLine//output path

};
ToLineGeoprocessor. Execute (newFeatureToLine, null);
//determine whether this file is
if (! File. The Exists (featureToLine))
{
MessageBox. Show ("!!!!! ");
return null;
}
Return featureToLine;
}
The catch (Exception ex)
{
Console. WriteLine (ex. Message);
return null;
}
}
  •  Tags:  
  • C#
  • Related