I am trying to create an ArcGIS map tool that includes creating TINS and uses parameters. This tool works fine when taking the data from shapefiles, but when I use map layers, which is what I want it stops working at CreateTin tool with the error: Failed to execute (CreateTin).
Here is the TIN creation code that I am using:
# Import arcpy module import arcpy, sys, string from arcpy import env from sys import exit # Check out any necessary licenses arcpy.CheckOutExtension("3D") # Coordinate System prjfile = r'C:\Data\project.prj' Coordinate_System = arcpy.SpatialReference(prjfile) #Set parameters Points1 = arcpy.GetParameterAsText(0) Points2 = arcpy.GetParameterAsText(1) Polygon = arcpy.GetParameterAsText(2) # Parameters using elevation points for Create TIN tool TIN1 = "test1" TIN2= "test2" Params1 = Points1 + " elev Mass_Points <None>" Params2 = Points2 + " elev Mass_Points <None>" # Create TIN models arcpy.CreateTin_3d(TIN1, Coordinate_System, Params1, "DELAUNAY") arcpy.CreateTin_3d(TIN2, Coordinate_System, Params2, "DELAUNAY")
instead of using a workspace I want to do everything in the current map but I am not sure how to use the arcpy.mapping module to read the layers into the map. I was thinking this might be an issue.
Still new to this but I need to learn.