We have a number of TINs covering our county and I would like to do a hyperlink script for the index layer to add the appropriate TIN to the Table of Contents when a feature is clicked with the hyperlink tool.
However, I'm having no luck finding the correct Python code to make this happen: Testing with variations of "add a [****]" code I get arcpy.mapping.Layer erroring with "invalid data source", arcpy.MakeFeatureLayer_management says "Dataset does not exist or is not supported", etc.
Sample code where it errors on the last line:
import arcpy
mxd = arcpy.mapping.MapDocument("CURRENT")
df = arcpy.mapping.ListDataFrames(mxd, "Layers")[0]
tinpath = r"\\here\thar\be\TINs"
arcpy.env.workspace = tinpath
tin = arcpy.ListDatasets("tin*", "Tin")[0]
arcpy.MakeFeatureLayer_management(tin, "tin1")Thanks!