AnsweredAssumed Answered

ArcMap 10.1 hyperlinks with python code

Question asked by jad01106 on Sep 16, 2016

Should the python code below for hyperlinks in ArcMap 10.1 with python 2.7 installed?

 

import arcpy
def OpenLink ([PARCEL]):
parcel = [PARCEL]
mxd = arcpy.mapping.MapDocument("CURRENT")
df = arcpy.mapping.ListDataFrames(mxd)[0]
subID = parcel[1:7]
folder = "rc" + subID[:1] + "00000"
filename = "s" + subID + "f.tif"
rasterPath = "r:\\rectsubr\\" + folder + "\\" + filename
lyr = arcpy.MakeRasterLayer_management(rasterPath, filename)
arcpy.mapping.AddLayer(df, lyr, "TOP")
return

 

This code works in ArcMap 10.2 and up. 

Outcomes