Feature to Point with C# does not work?

268
1
04-23-2012 09:50 AM
kencoc
by
New Contributor
Hi,

We are creating an app for data processing using C# with ESRI.ArcGIS.Geoprocessor, ESRI.ArcGIS.Geoprocessing.
We successfully in most of the geoprocessing tools such as spatial join....

But not about to create the FeatureToPoint. Here is my code:

                  

                    ESRI.ArcGIS.DataManagementTools.FeatureToPoint fp = new FeatureToPoint();                   
                    fp.in_features = "C:/Glacier/data/gowan.gdb/Asset_1";
                    fp.out_feature_class = "C:/Glacier/data/gowan.gdb/Asset";


                   Geoprocessor GP = new Geoprocessor();
                  GP.OverwriteOutput = true;
                  GP.Execute(fp, null);



I got error.

Please Help!
0 Kudos
1 Reply
NobbirAhmed
Esri Regular Contributor
Could please wrap your Execute code with try-catch as follows?

object sev = null;
try
{
    gp.Execute(fp, null);
    Console.WriteLine(gp.GetMessages(ref sev));
}
catch (Exception ex)
{
    Console.WriteLine(gp.GetMessages(ref sev));
    Console.WriteLine(ex.Message);
}


Please let me know what messages you get. Also, do you get a successful run if you run the tool with same parameters in ArcMap?


To get a quicker response post your message in this forum:

http://forums.arcgis.com/forums/20-ArcObjects-All-Development-Languages
0 Kudos