Dissolve

The following VB 6.0 sub- procedure can be used to dissolve features based upon desired attribute fields: –

Public Sub GPDissolve(strIn, strOut, disField As String)

On Error GoTo EH
Dim GP As IGeoProcessor
Set GP = New GeoProcessor

GP.OverwriteOutput = True

Dim GPU As IGPUtilities
Set GPU = New GPUtilities

'Declare and set a variant array to hold the parameters
Dim parameters As IVariantArray
Set parameters = New VarArray

'Populate the variant array with the parameters
parameters.Add strIn '(in_features)
parameters.Add strOut '(out_feature_class)
parameters.Add disField '(dissolve_field)
parameters.Add "AREA SUM"

'Now execute the Dissolve tool
GP.Execute "Dissolve_management", parameters, Nothing

Exit Sub
EH:
'Show all application errors, and severe GeoProcessor messages
MsgBox "A Runtime Error Occured. Error Number: " & CStr(Err.Number) & _
vbCrLf & "Error Description: " & Err.Description & vbCrLf & vbCrLf & "GP Message: " & GP.GetMessages(2), vbExclamation + vbOKOnly
End Sub

Advertisements

About Paritosh Gupta

I am an M.Tech from IIT Roorkee and MBA from IIM Lucknow India. I am having more than 16 years of experience in design, development, Integration and implementation of Geographical Information System for various applications in Utilities, Watershed Management and Land records domains
This entry was posted in ArcObjects with Visual Basic. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s