0

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:
env.workspace="C:\\Test\\shapefiles"
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.

PolyGeo
65.5k29 gold badges115 silver badges350 bronze badges
asked Apr 13, 2013 at 0:37

1 Answer 1

4

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.

gene
55.8k3 gold badges115 silver badges196 bronze badges
answered Apr 13, 2013 at 1:08
2
  • 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? Commented Apr 13, 2013 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. Commented Apr 13, 2013 at 16:01

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.