1

I am using ArcMap 10.2 and an ArcPy script tool to create an XY Event Layer from a text file and then save the layer to a .lyr file. This works, but I also want to load a hyperlink file and apply it to the layer automatically. I tried using UpdateLayer, but this just replaces the entire layer, it doesn't keep the same source data.

Does anyone know if there is a way to load a .hlk file using ArcPy?

PolyGeo
  • 65,136
  • 29
  • 109
  • 338
jvangeld
  • 2,292
  • 5
  • 20
  • 34
  • Wow, never heard of .hlk file in ArcGIS. Dare to share a link for more info? ;) – Alex Tereshenkov Apr 24 '14 at 19:26
  • 1
    So, a .hlk file is used to save hyperlink scripts in ArcGIS. If you have a layer in ArcGIS, go to the properties>Display tab. Under "Hyperlinks" check the "Support Hyperlinks" box and click the "Script" radio button. Then click the "Edit" button and you will see an editor similar to that in the Field Calculator functions. From there, you can Save and Load .hlk files. – jvangeld Apr 24 '14 at 19:36
  • 2
    ah, great thank you. Found it here: http://resources.arcgis.com/en/help/main/10.1/index.html#//00s500000004000000. Maybe you could update your questions with those details? You seem to be digging fairly deep :D – Alex Tereshenkov Apr 24 '14 at 20:08
  • 1
    At the moment I am writing a work-around. It will copy the features from the XY Event layer to a shapefile, then change the source of an existing layer file (with the hyperlink script already applied) to point at the new shapefile. – jvangeld Apr 24 '14 at 21:06
  • If you wish to ask a question about how to do this using other than ArcPy (perhaps https://gis.stackexchange.com/questions/80/accessing-arcobjects-from-python) then please do that in a new question. In the meantime can you include what you have tried using ArcPy within this one, please? That may help trigger some ideas from those of us who are frequently coding using ArcPy. – PolyGeo Aug 13 '21 at 04:11
  • I don't have access to the code I was working on. But it is good to hear that you can access all of ArcObjects through Python now. – jvangeld Aug 16 '21 at 20:30

0 Answers0