There are some nice features in ArcToolbox we can use, but for some reason, this is NOT working properly. It doesn't even throw me an error.
My software is running inside ArcMap, so no need to AoInitialize again, corret?
public void Execute()
{
InitializeProduct();
try
{
Geoprocessor gp = new Geoprocessor();
gp.OverwriteOutput = true;
FeatureToPoint featureToPoint = new FeatureToPoint();
string outputPathName = CurrentWorkspace.PathName + "\\teste_centroide";
featureToPoint.in_features = InputFeatureClass;
featureToPoint.out_feature_class = outputPathName;
featureToPoint.point_location = "INSIDE";
IGeoProcessorResult result = (IGeoProcessorResult)gp.Execute(featureToPoint, null);
if (result == null)
{
for (int i = 0; i <= gp.MessageCount - 1; i++)
{
Console.WriteLine(gp.GetMessage(i));
}
}
IGPUtilities gpUtils = new GPUtilitiesClass();
this.OutputFeatureClass = gpUtils.OpenFeatureClassFromString(outputPathName);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message + "\r\n");
}
This is a code example I'm having here. I generated the DataManagement tools assembly, but I could not find the file to sign it.
This code just gives me an error. is it because of the signing?
I've tried the other way too, using IVariantArray and calling from the tool name, without sucess. Is it just me or...?
Can anyone point me a "nicer" solution? I need to run several process that are already built in ArcToolbox that I really don't want to duplicate.