Developing a tool using python based on user's input that runs in ArcGIS 10/10.1

Discussion created by sushilpradhan on Feb 20, 2013
Latest reply on Feb 20, 2013 by Dan_Patterson

If anyone can help me with a python script to create a tool that runs within ArcMap(10.1).

I have three feature classes - a point, line, and a poly. I want to import (combine) information from the Line and Poly feature class into point feature class. I can think of doing through SpatialJoin and there is no problem doing it manually.

Here, I am looking for a script, which should do as follow:

1. Get user's input for a POINT feature class as an target feature (there are many point feature datasets);
2. Get user's input for a LINE feature class from which information has to be combined with the POINT feature;
3. Get user's input for a field (or multiple) from LINE feature class to be combined into the POINT feature;
4. Get user's input for a POLYGON feature class from which information has to be combined with the POINT feature;
5. Process to join these to create a POINT OUTPUT feature class;

After joining,
6. Rename fields joined from LINE or POLYGON feature classes to meaningful ones; for instance, if there is a field called "RdNam" in LINE feature, it should be renamed as "Road_Name" in the output feature class, and so on;
7. Drop any unnecessary joined fields from both LINE and POLY features. If we can keep only the selected fields (in step 3 above) after joining would be fantastic.

I reckon this involves functions like fieldmappings, fieldmap, and spatialjoin, but if anyone could come up with a complete script would be really appreciated.

Thanks in advance for your help and suggestions.