Select to view content in your preferred language

Polygon Cut - Using C#.Net

1680
2
11-24-2010 02:40 PM
shravanshravan
Emerging Contributor
I am very much new to Arc Objects, Could you please anyone provide suggestions on this.

I have a polygon fetaure class in which we have 93 features and in that when I select one polygon in that 93 features - i must able to cut that selected feature into two parts using the cut tool and it has to be done programitically using C#.
0 Kudos
2 Replies
RuchiraWelikala
Regular Contributor
I had to do this one for a class assignment last year.  But what you need to do is create a base command that gets the selected feature from the feature class (make sure only 1 feature is selected).
Use the ITopologicalOperator4 interface to cut the polygon (you must start an edit session on the workspace) by a polyline.  The polyline can be programatically created using the envelope of the selected feature (if it's always a proportion of the selected feature, ex. Split the polygon in half).  The ITopologicalOperator Interface will spit out 2 geometries that will be the left and right polygons.  Store these as features and insert them into the feature class. 
Should be good to go.  Obviously you have to do some work with the spatial references, starting and ending edit sessions, etc.

Very doable.  Good luck.
0 Kudos
shravanshravan
Emerging Contributor
Thanks a lot! I appreciate for taking time from your busy schedule to explain about the concept.
0 Kudos