Geoprocessing arcobjects Intersect

2176
2
Jump to solution
11-01-2015 11:02 PM
Highlighted
Occasional Contributor

Hi,

I have no idea as to how do I pass multiple input features to the intersect tool.

Here is my code

regards,

Nigel

Geoprocessor pGp = new Geoprocessor();

  IFeatureClass pGDMFclass = pGDMFLayer.FeatureClass;

IFeatureClass pZoneFclass = pZoneFLayer.FeatureClass;

               Intersect pIntersect = new Intersect();

                    //Pass more than one feature 

              pIntersect.in_features = pZoneFclass;

 

                pIntersect.join_attributes = "ALL";

                pIntersect.output_type = "INPUT";

                IWorkspace pWs = pFWS as IWorkspace;

                string path = pWs.PathName + "\\" + "TEST";

                pIntersect.out_feature_class = path;

                pGp.OverwriteOutput = true;

                pGp.Execute(pIntersect, null);

Tags (1)
Reply
0 Kudos
1 Solution

Accepted Solutions
Highlighted
Regular Contributor II

You can either put your feature classes into an array or pass a semi-colon delimited string into the parameter.

Update..did a quick search in the documentation and came across this page.

How to use multiple inputs

http://resources.arcgis.com/en/help/arcobjects-net/conceptualhelp/index.html#/How_to_use_multiple_in...

View solution in original post

Reply
0 Kudos
2 Replies
Highlighted
Regular Contributor II

You can either put your feature classes into an array or pass a semi-colon delimited string into the parameter.

Update..did a quick search in the documentation and came across this page.

How to use multiple inputs

http://resources.arcgis.com/en/help/arcobjects-net/conceptualhelp/index.html#/How_to_use_multiple_in...

View solution in original post

Reply
0 Kudos
Highlighted
Occasional Contributor

I have tried passing in an array but it still throws an exception. Could you write down the syntax please? I am doing the following. IFeatureClass [] inputfeturesArr = new IFeatureClass [2] inputfeturesArrp[0] = FClass1; inputfeturesArr[1] = FClass2; Regards, Nigel

Reply
0 Kudos