arcpy.management.SelectLayerByAttribute("(SHAPE_IN_CONTENTS)", "NEW_SELECTION", "LEASE_NAME LIKE 'ABC%'", None)
arcpy.management.CopyFeatures("(SHAPE_IN_CONTENTS)", r"C:\Data\GIS\Project\Python\Python.gdb\(SELECTED_SHAPE)", None, None, None, None)
arcpy.management.Dissolve("(SELECTED_SHAPE", r"C:\Data\GIS\Project\Python\Python.gdb\(SELECTED_SHAPE_DISSOLVE)", None, None, "MULTI_PART", "DISSOLVE_LINES")
Shapefile name is within ( )
I can run each line separately. I can run 2-3 separately. Occasionally 1-3 work, 1-2 work, 2-3 works 100% of the time.
I'm wondering if I need to add code between line 2-3 to reference the file?
When I try to run the entire code, the trailling dots freeze and windows says ArcGIS Pro has stopped working
So I tried this. It worked and it gave me the the details of the output and loaded onto into contents of the map. Why, when run again does it crash? I am just inputting the arcpy.makefeature layer... function, nothing else.
If you are running it again without quitting and restarting your pro project, you're trying to create the feature layer again of the same name but that name space is already spoken for 'in_memory' which is where the feature layer is held.
It's not giving you an error to that effect?
In the following code snippet I create a table view called 'tv' and make a selection against. If I wanted to try this again in a python window in Pro, I'd run line 1 again but substitute 'tv2' for 'tv' and then substitute 'tv2' for 'tv' in line 4
select = 'JOINID is not null and AN_NAME is not null and AN_POSTDIR is not null'
blah blah blah