geoprocessing in ArcGIS Add-In

563
2
Jump to solution
11-07-2012 10:34 AM
InsuHong1
New Contributor
Hello,

I implemented geoprocessor in add-in.
when I run this Add-in in ArcMap, the result of "result = gp.Execute("FeatureToLine_management", parameters, null);" is automatically added in current view as a new layer.

But I want to implement more geoprocessor, and make those results are not appeared at current view.

How can I do this?

I don't mean background running. I just want resulting featureclass is not appear at view.

Thnks.





namespace Convexpath_mk2 {     public class runConvexPath : ESRI.ArcGIS.Desktop.AddIns.Button     {         IGeoProcessor2 gp;         IGeoProcessorResult result;         IVariantArray parameters;                  public runConvexPath()         {             gp = new GeoProcessorClass();             parameters = new VarArrayClass();         }         protected override void OnClick()         {                          ConvexPathForm newForm = new ConvexPathForm();             newForm.Text = "Test";             newForm.ShowDialog();             Dictionary<string, string> fcDict = new Dictionary<string, string>();             fcDict = newForm.caDi();             string path = fcDict["path"];             gp.SetEnvironmentValue("workspace", path);             gp.OverwriteOutput = true;             List<string> oriList = new List<string>();             List<string> desList = new List<string>();             Dictionary<pair, pairData> pairDict = new Dictionary<pair, pairData>();             List<pair> pairList = new List<pair>();             Dictionary<string, string> belongDict;              FCUtils fcUtils = new FCUtils();              //Making Map boundary (polyline)              string strBoundaryline = "boundaryline";             parameters = new VarArrayClass();             parameters.Add(fcDict["fcBoundary"]);             parameters.Add(strBoundaryline);             result = gp.Execute("FeatureToLine_management", parameters, null);                          MessageBox.Show(result.GetMessages(0));       } } 
0 Kudos
1 Solution

Accepted Solutions
KenBuja
MVP Esteemed Contributor
You can set the IGeoProcessor::AddOutputstoMap property to false.

View solution in original post

0 Kudos
2 Replies
KenBuja
MVP Esteemed Contributor
You can set the IGeoProcessor::AddOutputstoMap property to false.
0 Kudos
InsuHong1
New Contributor
It works!

Thanks!!
0 Kudos