1

This is the first time I have tried to add a tool to the ArcMap 10.4.1 Toolbox. I downloaded the Pairwise Intersect Tool from here and installed it in My Toolboxes in the ArcCatalog : http://www.arcgis.com/home/item.html?id=120807ac7f8449f89840ae48e87d7f55

I gave the following parameters, which I thought I understood from here: http://pro.arcgis.com/en/pro-app/tool-reference/analysis/pairwise-intersect.htm

in_feature1 : Table
in_feature2 : Table
out_feature_class : Feature Class
join_attributes : String
Cluster_Tolerance : Linear unit
Output_type : String

But when I run the script I get this error

Executing: pairwiseintersect C:\Users\gree1117\Desktop\Tonya\Wytham\flight_path2_convex_hull.shp C:\Users\gree1117\Desktop\Tonya\Wytham\Wytham_landuse.shp C:\Users\gree1117\Desktop\Tonya\Wytham\fp2_convexhull_landuse5.shp ALL "5 Meters" INPUT
Start Time: Wed Mar 08 16:30:44 2017
Running script pairwiseintersect...
Wed Mar 08 16:30:45 2017
Processing features...
Failed script pairwiseintersect...

Traceback (most recent call last):
  File "C:\Program Files (x86)\ArcGIS\Desktop10.4\ArcToolbox\Scripts\PairWiseIntersect.py", line 166, in <module>
    pairWiseIntersect(inputFC1, inputFC2, outputFC, fldList2Transfer)
  File "C:\Program Files (x86)\ArcGIS\Desktop10.4\ArcToolbox\Scripts\PairWiseIntersect.py", line 123, in pairWiseIntersect
    for row2 in cursor2:
RuntimeError: A column was specified that does not exist.

Failed to execute (pairwiseintersect).
Failed at Wed Mar 08 16:30:47 2017 (Elapsed Time: 3.01 seconds)
1

You are having a problem with this line in the code:

with arcpy.da.SearchCursor(inputLayer2, fldsInput2) as cursor2

...most likely with the setup of your fields list, fldsInput2. I think there is already a toolbox set up with this tool at the download page, but it sounds like (by the comments) that the tbx version may well be unreadable at 10.4.1 (I did not check it), in which case you have to set up the params properly for the script tool yourself. Incidentally, this is why I like Python toolboxes, because all coding is in a single file - you don't have embedded code housed anywhere else.

If you look at the script, it isn't the same as the set up for ArcGIS Pro (which is shipped to you ready to use). For the downloaded tool, aimed at ArcGIS Desktop users, it allows 4 parameters (as indicated in the function call from your error): inputFC1, inputFC2, outputFC, fldList2Transfer

Note that the last parameter, fldList2Transfer, is a multivalue list of a fields to transfer, as indicated by the line in the script file:

fldsInput2 = fldList2Transfer.upper().split(";")

Multivalue list parameters are passed into the script as a semicolon (;) delimited string (and of course splitting by ";" yields the list of fields). I think the geometry field object is appended to the end of the list, so that's the retrieval attempted with the geometry intersect line after the search cursor is established (but you aren't getting this far because there's something awry with the field list):

clippedFeature = row2[-1].intersect(row[-1], dimension)

So, in all of that, I would trace what you're feeding in with your field list 1st....it could be in the originally published tool, there was tool validation code provided to pre-populate the list for you to pick from and you're having trouble reconstructing the validator code....that's really a separate question.

For now, if you're just testing in debugging mode, you can try feeding in a fields string input manually as a string parameter (the 4th parameter), as in fieldname1;fieldname2;fieldname3;etc.

  • Thank you Wayne - your suggestions put me on the right track! – TLander Mar 9 '17 at 16:53

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.