Hello,
This code leads to a error message:
Object: Error in executing tool
Any ideas why? Might be something in line 17?
<SPAN class="comment token"># -*- coding: cp1252 -*-</SPAN>
<SPAN class="keyword token">import</SPAN> arcpy
InFc <SPAN class="operator token">=</SPAN> r<SPAN class="string token">"R:\Karto\Bierer2019\Kaltenbronn_DGM\shapes\Geodaten.gdb\data\graeben_breitlhohloh_Prioritaer"</SPAN>
field <SPAN class="operator token">=</SPAN> <SPAN class="string token">"OBJECTID"</SPAN>
InContour <SPAN class="operator token">=</SPAN> r<SPAN class="string token">"R:\Karto\Bierer2019\Kaltenbronn_DGM\shapes\Geodaten.gdb\data\Hohlohbreitl_Contour_50cm"</SPAN>
<SPAN class="keyword token">try</SPAN><SPAN class="punctuation token">:</SPAN>
<SPAN class="keyword token">with</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>da<SPAN class="punctuation token">.</SPAN>SearchCursor<SPAN class="punctuation token">(</SPAN>InFc<SPAN class="punctuation token">,</SPAN> field<SPAN class="punctuation token">)</SPAN> <SPAN class="keyword token">as</SPAN> cursor<SPAN class="punctuation token">:</SPAN>
<SPAN class="keyword token">for</SPAN> row <SPAN class="keyword token">in</SPAN> cursor<SPAN class="punctuation token">:</SPAN>
<SPAN class="keyword token">print</SPAN><SPAN class="punctuation token">(</SPAN>row<SPAN class="punctuation token">)</SPAN>
scl <SPAN class="operator token">=</SPAN> <SPAN class="string token">"OBJECTID = {}"</SPAN><SPAN class="punctuation token">.</SPAN>format<SPAN class="punctuation token">(</SPAN>row<SPAN class="punctuation token">[</SPAN><SPAN class="number token">0</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">print</SPAN> scl
inFcLayer <SPAN class="operator token">=</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>MakeFeatureLayer_management<SPAN class="punctuation token">(</SPAN>InFc<SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"lyr_{}"</SPAN><SPAN class="punctuation token">.</SPAN>format<SPAN class="punctuation token">(</SPAN>row<SPAN class="punctuation token">[</SPAN><SPAN class="number token">0</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">,</SPAN> scl<SPAN class="punctuation token">)</SPAN>
inFeatures <SPAN class="operator token">=</SPAN> <SPAN class="string token">""" ["{}", "{}"] """</SPAN><SPAN class="punctuation token">.</SPAN>format<SPAN class="punctuation token">(</SPAN>inFcLayer<SPAN class="punctuation token">,</SPAN> InContour<SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">print</SPAN> inFeatures
outFeature <SPAN class="operator token">=</SPAN> r<SPAN class="string token">"R:\Karto\Bierer2019\Kaltenbronn_DGM\shapes\Zwischendaten.gdb\data\a_{}"</SPAN><SPAN class="punctuation token">.</SPAN>format<SPAN class="punctuation token">(</SPAN>row<SPAN class="punctuation token">[</SPAN><SPAN class="number token">0</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">)</SPAN>
arcpy<SPAN class="punctuation token">.</SPAN>Intersect_analysis<SPAN class="punctuation token">(</SPAN>inFeatures<SPAN class="punctuation token">,</SPAN> outFeature<SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"ALL"</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">""</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"POINT"</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">del</SPAN> cursor
<SPAN class="keyword token">except</SPAN> Exception<SPAN class="punctuation token">:</SPAN>
e <SPAN class="operator token">=</SPAN> sys<SPAN class="punctuation token">.</SPAN>exc_info<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">[</SPAN><SPAN class="number token">1</SPAN><SPAN class="punctuation token">]</SPAN>
<SPAN class="keyword token">print</SPAN><SPAN class="punctuation token">(</SPAN>e<SPAN class="punctuation token">.</SPAN>args<SPAN class="punctuation token">[</SPAN><SPAN class="number token">0</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>