[GIS] CreateTin_3d fails with ERROR 000800: The value is not a member of

3d-analystarcgis-proarcpyerror-000800

I get 'parameters are not valid' error (see detailed error message below), when I try to execute arcpy.CreateTin_3d() function (code below)

Error I get:

Failed to execute. Parameters are not valid.

ERROR 000800: The value is not a member of .

ERROR 000800: The value is not a member of .

Failed to execute (CreateTin).

Code:

def createTIN():
    try:
        arcpy.AddMessage("You clicked OK")
        shift_tin_source = "C:\\Data\\Interacting with Maps\\Interacting with Maps.gdb\\shift_tin_source"
        shift_dx = "C:\\Data\\Interacting with Maps\\shift_dx"
        # Coordinate System

        table_created = arcpy.CreateTin_3d(shift_dx, "", shift_tin_source+" dx masspoints", "DELAUNAY")
        arcpy.AddMessage("You clicked OK1")
        print ("DX tin created")

    except Exception as ex:
        print ("Exception occurred!" + str(ex))
        print (arcpy.GetMessages())

I also tried below different version of passing argument to CreateTin function.

table_created = arcpy.CreateTin_3d(shift_dx, None, shift_tin_source+" dx masspoints None", "DELAUNAY")

and

table_created = arcpy.CreateTin_3d(shift_dx, None, shift_tin_source+" dx masspoints None", "DELAUNAY")

Best Answer

Below code worked for me. (May it helps someone having similar error).

def createTIN():
    try:
        projHome = sys.argv[1] # path to project home directory

        shift_tin_source = os.path.join(projHome,"shift_tin_source")
        shift_dx = os.path.join(projHome,"shift_dx")
        shift_dy = os.path.join(projHome,"shift_dy")

        # Coordinate System
        desc = arcpy.Describe(shift_tin_source)
        projection = desc.spatialReference

        arcpy.ddd.CreateTin(shift_dx, 
                            projection,
                            shift_tin_source+" dx Mass_Points dx", 
                            "DELAUNAY")


        print ("TIN created!")

    except Exception as ex:
        print ("Exception occurred!" + str(ex))
        print (arcpy.GetMessages())
Related Question