I do not understand why this simple script won't work. I can get it to dissolve in model builder but not from a script that I run from inside the map document. My output results are 4 polygons, just like my input file. I only want one.

Any suggestions?

# Import arcpy module
import arcpy
from arcpy import env

# Local variables:

infeatures = "Multipolys.shp"
outfeatures = "C:\\Test\\shapefiles\\Dissolve.shp"

# Process: Dissolve
arcpy.Dissolve_management(infeatures, outfeatures, "", "", "SINGLE_PART", "DISSOLVE_LINES")

correct syntax is:

arcpy.Dissolve_management(infeatures, outfeatures, "", "", "MULTI_PART", "DISSOLVE_LINES")

ArcGIS 10.1 advanced.


The syntax is

Dissolve_management (in_features, out_feature_class, {dissolve_field}, {statistics_fields}, {multi_part}, {unsplit_lines})

You need to specify the dissolve_field as the third parameter - here you've left it blank.

  • I intentionally left it blank (it is optional) as I do not want to dissolved on a field. I want it one polygon. Dissolving it on a field will not do this. Coordinates are the same, ran repair. Might need to run in 'foreground'. How would I do this? – user12059 Apr 13 '13 at 15:23
  • Duh. Syntax is 'arcpy.Dissolve_management(infeatures, outfeatures, "", "", "MULTI_PART", "DISSOLVE_LINES")' Still need to figure out how to run in foreground though. – user12059 Apr 13 '13 at 16:01

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.