Select to view content in your preferred language

AliasNames as input for TIN in_feature_class

627
0
10-21-2013 01:39 PM
Kevin_Smith
Occasional Contributor
I am trying to create a TIN from a cross section layer and then turn that TIN into a raster. The catch is, the TIN tool uses the alias name not the field name (I wish I knew why), and the data has different alias names for the same fields. Does anyone know if you can use the field.aliasName as an input for the TIN tool (or for that matter as an output for the raster tool)?

The script seems to work if I hard code the paths, however I get a syntax error by using the field.aliasName. I tried making field.aliasName a variable and substituting that way, however no luck.

Any help would be greatly appreciated!


# Set Enviromnent Settings
from arcpy import env
env.overwriteOutput = True

# Check out any necessary licenses
arcpy.CheckOutExtension("3D")

# Argument 1 is the XSCutlines Feature Class
Input_Feature_Class = arcpy.GetParameterAsText(0)
# Argument 2 is the Directory Rasters will be stored in
Output_Raster = arcpy.GetParameterAsText(1)



fieldList = arcpy.ListFields(Input_Feature_Class,"P00*","Double")
for field in fieldList:
    print "Field Name: " + field.name
    print "Alias: " + field.aliasName
    if "FEMA" in field.aliasName:
        #Process: Create TIN
        print "Creating " + field.aliasName + " TIN"
        arcpy.CreateTin_3d(Output_TIN, "", Input_Feature_Class field.aliasName hardline <NONE>, "True")
    print arcpy.GetMessages()

    # Process: TIN to Raster
    print "Converting TIN to RASTER"
    arcpy.TinRaster_3d(Output_TIN, Output_Raster + "\\" + fieldaliasName, "FLOAT", "LINEAR", "CELLSIZE 3", "1")
    print arcpy.GetMessages()
print "Complete"
Tags (2)
0 Kudos
0 Replies