I have created a relationship class in arc catalog using the same arguments I'm using below, however if I try and create it using the script below I get:
arcgisscripting.ExecuteError: ERROR 000622: Failed to execute (Create Relationship Class). Parameters are not valid. ERROR 000628: Cannot set input into parameter attributed.
Following is the script I'm using:
import arcpy
from arcpy import env
env.workspace = "C:\a.gdb"
origin_table = "a.gdb\Trail_meta"
destination_table = "a.gdb\trails_mfg"
out_relationship_class = "a.gdb\t3meta"
relationship_type = "SIMPLE"
forward_label = "Attributes from meta"
backward_label = "Attributes from trail"
message_direction = "NONE"
cardinality = "ONE_TO_MANY"
attributed = "NONE"
origin_primary_key = "OBJECTID"
origin_foreign_key = "TRAIL_NAME"
arcpy.CreateRelationshipClass_management(origin_table,destination_table,out_relationship_class,forward_label,backward_label,message_direction,cardinality,attributed,origin_primary_key,origin_foreign_key)
env.workspace
, I think you may be misleading the script by re-stating the name of the database in your variablesorigin_table
,destination_table
, andrelationship_type
. Try removing "a.gdb\" from these strings and see what happens.