I've taken the code snippet below from a larger block of code in order test it and made a script tool with it in ArcMap:
import arcpy #Set join parameter variables inFeatures = arcpy.GetParameterAsText(0) inField = arcpy.GetParameterAsText(1) joinTable = arcpy.GetParameterAsText(2) joinField = arcpy.GetParameterAsText(3) arcpy.MakeFeatureLayer_management(inFeatures,"inFeatures_lyr") #make feature layer from feature class #Join road feature class to buffer distance table arcpy.AddJoin_management("inFeatures_lyr", inField, joinTable, joinField, "KEEP_ALL")
In setting up the script tool, I've defined the variable
inFeatures as a feature class,
inField as a field,
joinTable as a table, and
joinField as a field. When I run the tool no errors are generated but no join is created.
Is there a problem with this code snippet?
arcpy.MakeFeatureLayer_management unnecessary or causing problems?