Help with Create TIN variables

1311
5
03-07-2014 04:55 AM
MarionConstante
New Contributor
I am writing a script that includes creating TINs and it won't allow me to use a variable for the input feature class.  I get a warning that says "Not a member of none". 

It works if I hard code the shapefile in the parameters but not when I use a variable.

the code snippet that isn't working:

# Output TIN
BuildingBase = "BldgBase"
Roof = "BldgRoof"

# Input point feature classes
elevpntsRoof = "elevpntsRoof.shp"
elevpntsbase = "elevpntsBase.shp"

# execute create TIN 3d
arcpy.CreateTin_3d(Roof, Coordinate_System, "elevpntsRoof elev Mass_Points <None>", "DELAUNAY")
arcpy.CreateTin_3d(BuildingBase, Coordinate_System, "elevpntsbase elev Mass_Points <None>", "DELAUNAY")

The error:
ExecuteError: Failed to execute. Parameters are not valid.
ERROR 000800: The value is not a member of <None>.
Failed to execute (CreateTin).

I want this script to allow users to input their variables without having to go into the script
so far the script only works when I add the feature class path directly to the parameters within the ("elevpntsRoof elev Mass_Points <None>") part of arcpy.CreatTin_3d.

This works fine:

arcpy.CreateTin_3d(Roof, Coordinate_System, "elevpntsRoof.shp elev Mass_Points <None>", "DELAUNAY")

Is it because of the "" or does it not work using variables at all.  I have tried no quotes, {}, [], no "" around the variable but nothing has worked.

Thanks
Tags (2)
0 Kudos
5 Replies
MarionConstante
New Contributor
Tried this according to other threads and 10.1 help:

arcpy.CreateTin_3d(Roof, Coordinate_System, "{0} elev Mass_Points <None>".format(elevpntsRoof), "DELAUNAY")
arcpy.CreateTin_3d(BuildingBase, Coordinate_System, "{0} elev Mass_Points <None>".format(elevpntsbase), "DELAUNAY")

it did not work, am I doing something wrong - wrong number or value.

Thanks
0 Kudos
MichaelStead
Occasional Contributor III
I can't remember if it was the exact issue, but in a script I needed to build tins in I pre-built my parameters as a string into a variable like this:

#create a TIN of the area
para_in = InSounding + " " + S_Depth_name + " Mass_Points <None>;" + InShoreline + " " + DepthField + " Hard_Line <None>;" + OutShorelinePY + " <None> hardclip <None>"
arcpy.CreateTin_3d (OutTIN, "#", para_in, "DELAUNAY")

...and it works.

I often seem to need to do things like this.....
0 Kudos
MarionConstante
New Contributor
This is what I tried as a string:

    Roofpnts = "elevpntsroof.shp"
    ParamsRoof = Roofpnts + "elev" + "Mass_Points <None>"
    arcpy.CreateTin_3d(Roof, Coordinate_System, ParamsRoof, "DELAUNAY")
   
    basepnts = "elevpntsbase.shp"
    ParamsBldg = basepnts + "elev" + "Mass_Points <None>"
    arcpy.CreateTin_3d(BuildingBase, Coordinate_System, ParamsBldg, "DELAUNAY")

and I keep getting this error:
ExecuteError: ERROR 999999: Error executing function.
Failed to execute (CreateTin).
0 Kudos
MichaelStead
Occasional Contributor III
The first thing that jumps out is that you need some spaces in between the items you area building the parameter strings with:


This is currently be interpretted as "elevpntsroof.shpelevMass_Points <None>" and needs to be "elevpntsroof.shp elev Mass_Points <None>"

try:
ParamsRoof = Roofpnts + " elev Mass_Points <None>"
and
ParamsBldg = basepnts + " elev Mass_Points <None>"
0 Kudos
MarionConstante
New Contributor
Thanks for the help, it finally worked.  I'm new at python for ArcGIS so I am still getting used to the need for spaces and indentations required for scripts.
0 Kudos