ESRI.ArcGIS.AnalysisTools.Union question

4159
5
05-18-2016 07:23 PM
Highlighted
New Contributor II


Hi, I want to set the ESRI.ArcGIS.AnalysisTools.Union.out_feature_class property to a new feature class in an existing File GDB. All of the examples I can find only have this property set to a .shp file. Any ideas on how to do this?

Reply
0 Kudos
5 Replies
Highlighted
Occasional Contributor

You may directly set the path to the feature class, like "D:\St_Johns\data.gdb\roads_Buffer". For more information and examples please refer to http://resources.arcgis.com/en/help/arcobjects-net/conceptualHelp/#/How_to_run_a_geoprocessing_tool/...

Reply
0 Kudos
Highlighted
New Contributor II

Great, it works. Thanks!

I have another question which you may be able to help. Currently after the Union is performed, the feature class appears as a layer in the map. Do you know how to stop it from being added to the map?

Reply
0 Kudos
Highlighted
New Contributor II

Ignore the above question as I found out how to do this. I do have another question though. Is there a way to pass a feature class to the Union .in_features property, but tell it to only use the selected features? Currently I am exporting the selected features to a new feature class using the IExportOperation interface. That works but it shows the progress box which i don't want the users to see. If this is the only way to do it, is there a way to stop the progress box from showing?

Reply
0 Kudos
Highlighted
MVP Honored Contributor

Instead of using the feature class as the input, use a feature layer. If a feature layer contains selected features, the Union will only occur with the features that have been selected, not all of them.

This is an example of that done manually using the Union tool. The hashed circles are the result of the union between two feature layers with one selected circle each.

union.png

Reply
0 Kudos
Highlighted
New Contributor II

Great Ken, that works for me. Thanks for the reply!

Reply
0 Kudos