i want to create a ArcEngine function using .net that allow to do the same thing like (see picture): enter image description here

  • select 2 polygons
  • click merge

Is there somebody who can help please!! Sincerely


hello i found the the answer by self :

Private Sub mergeFeatures()

Dim mergee As IFeature 'first ifeature
Dim merger As IFeature 'second ifeature

mergee = featureLayerParcelle.FeatureClass.GetFeature(8) 'get the ifeature that has objectid=8
merger = featureLayerParcelle.FeatureClass.GetFeature(9) 'get the ifeature that has objectid=9
Dim union As ITopologicalOperator = CType(mergee.Shape, ITopologicalOperator) 'itopological variable
StarEditLayer(featureLayerParcelle) ' start editing
mergee.Shape = union.Union(merger.Shape) ' the first ifeature set it geometry with the union of the tow features
merger.Delete() ' delete second ifeature
mergee.Store() 'save 
pEditor.StopEditing(True) 'stop editing and save 
AxMapControl1.CurrentTool = Nothing

End Sub

so you can personalize it : get object id when we clique and start fusion

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.