AnsweredAssumed Answered

problem with intersect

Question asked by JB1234510 on Jun 27, 2019
Latest reply on Jun 28, 2019 by JB1234510

Hello,

This code leads to a error message:

Object: Error in executing tool

Any ideas why? Might be something in line 17?

 

# -*- coding: cp1252 -*-
import arcpy

InFc = r"R:\Karto\Bierer2019\Kaltenbronn_DGM\shapes\Geodaten.gdb\data\graeben_breitlhohloh_Prioritaer"
field = "OBJECTID"
InContour = r"R:\Karto\Bierer2019\Kaltenbronn_DGM\shapes\Geodaten.gdb\data\Hohlohbreitl_Contour_50cm"

try:
    with arcpy.da.SearchCursor(InFc, field) as cursor:
        for row in cursor:
            print(row)
           
            scl = "OBJECTID = {}".format(row[0])
            print scl
            inFcLayer = arcpy.MakeFeatureLayer_management(InFc, "lyr_{}".format(row[0]), scl)

            inFeatures = """ ["{}", "{}"] """.format(inFcLayer, InContour)
            print inFeatures
           
            outFeature = r"R:\Karto\Bierer2019\Kaltenbronn_DGM\shapes\Zwischendaten.gdb\data\a_{}".format(row[0])
           
            arcpy.Intersect_analysis(inFeatures, outFeature, "ALL", "", "POINT")

        del cursor

except Exception:
    e = sys.exc_info()[1]
    print(e.args[0])

Outcomes