Python Table Select and Join

3102
13
11-08-2011 06:34 AM
MichellePetersen
New Contributor
Hi All,

I have created a python script that performs first a table select and then attempt to join the selected attributes from the table to a feature class. I have added the script into MyTool Box in ArcCatalog and set all parameter properties; however, I can not get the tool to work.  In fact, the tool can not even run through the table select command.  I am not sure if the fact that you have to choose an already created table for the output table in table select is the reason for the execution failure.  Any suggestions? I have attached the python script below.

Thanks in advance,
Michelle
Tags (2)
0 Kudos
13 Replies
DuncanHornby
MVP Notable Contributor
Michelle,

It looks like you got confused and removed the wrong parameter from the wrong thing. I have corrected this and uploaded the script and toolbox in a single zip file. You may need to repoint the toolbox to point to the python script as it may have picked up the location where I stored it on my machine.

As you'll see it's not your script that was wrong but the toolbox interface. You were introducing an 8th input which was never used, but your python script only had 7 parameters and it was looking at the table when it really wanted your field.

Duncan
0 Kudos
MichellePetersen
New Contributor
Duncan,

This maybe a stupid question, but I am not sure how to get the toolbox you sent displayed under my toolbox. I put yours into my "my toolbox" folder and named it the same as my other one, but it still looks like the toolbox I created. As I stated in my first post, I have never done this before.

I am not sure if I sent you the python code that had a workspace in it, but I thought I removed it. Do I need a workspace?

Michelle
0 Kudos
DuncanHornby
MVP Notable Contributor
Michelle,

My toolbox in my opinion is not a good place to store anything as it's in my documents which is a directory on the computer so if that blows up you loose the lot!

I would recommend you create a folder in the projects folder and call it something simple like GeoProcessing. Then unzip the zip folder into it and you will have your toolbox and the python script in it.  You can then use the catalog window in arcmap to navigate to that folder then you'll see the toolbox, navigate into that for the script tool and at that point you will probably want to go into it properties to ensure the python script it's point to is the one in that folder and not my computer!

Duncan
0 Kudos
MichellePetersen
New Contributor
Duncan,

Thank you sooo much. It finally works!  It would be great if I you would give me your credentials so I can acknowledge you in my work. Thanks Again Duncan for your patients!

Cheers,
Michelle
0 Kudos