for example sir. i want to merge those highlighted parcels programmatically. Can you please send me some vba codes?
And before that i use this code to highlight them manually.
HIGHLIGHTED CODE:
Private Sub UIToolControl1_MouseDown(ByVal button As Long, ByVal shift As Long, ByVal x As Long, ByVal y As Long)
Dim pMxDoc As IMxDocument
Set pMxDoc = ThisDocument
Dim SearchTol As Double
Dim pPoint As IPoint
Set pPoint = pMxDoc.ActiveView.ScreenDisplay.DisplayTransformation.ToMapPoint(x, y)
'Pass the point to the FindBoundary function along with the Map and search tolerance
SearchTol = pMxDoc.SearchTolerance
FindBoundary SearchTol, pPoint, pMxDoc.FocusMap
'Message box the feature ID and feature class alias name
'MsgBox pFeature.OID & " " & pFeature.Class.AliasName
pMxDoc.ActiveView.Refresh
End Sub
Private Function FindBoundary(SearchTol As Double, pPoint As IPoint, pMap As IMap)
'** This function is called by the subroutine SelectBoundary_MouseDown
'** this selects the boundary based on the click event of the user
Dim pFeatSel As IFeatureSelection
Dim pEnvelope As IEnvelope
Dim pSpatialFilter As ISpatialFilter
Dim pEnumLayer As IEnumLayer
Dim pFeatureLayer As IFeatureLayer
Dim pFeatureClass As IFeatureClass
Dim pUID As New uid
Dim pFeatureCursor As IFeatureCursor
Dim pFeature As IFeature
Dim pSelection As IFeatureSelection
If pMap.LayerCount = 0 Then Exit Function
'Clear any already selected Features
pUID = "{40A9E885-5533-11D0-98BE-00805F7CED21}" 'IFeatureLayer
Set pEnumLayer = pMap.Layers(pUID, False)
pEnumLayer.Reset
Set pFeatureLayer = pEnumLayer.Next
Set pFeatureClass = pFeatureLayer.FeatureClass
'Expand the points envelope to give better search results
Set pEnvelope = pPoint.Envelope
pEnvelope.Expand SearchTol, SearchTol, False
ShapeFieldName = pFeatureLayer.FeatureClass.ShapeFieldName
'Search each selectable feature layer for a feature
'Return the first feature found
Set pSpatialFilter = New SpatialFilter
Set pSpatialFilter.Geometry = pEnvelope
Set pSpatialFilter.OutputSpatialReference(ShapeFieldName) = pMap.SpatialReference
pSpatialFilter.GeometryField = pFeatureLayer.FeatureClass.ShapeFieldName
pSpatialFilter.SpatialRel = esriSpatialRelIntersects
If pFeatureLayer.Selectable Then
Set pSelection = pFeatureLayer
pSelection.SelectFeatures pSpatialFilter, esriSelectionResultAdd, False
Set pFeatSel = pSelection
MsgBox (pFeatSel.SelectionSet.Count & " Features Selected from " & pFeatureLayer.FeatureClass.AliasName)
End If
End Function