Created
August 22, 2014 06:14
-
-
Save M-Bryant/aa334b398314153c2a4f to your computer and use it in GitHub Desktop.
Open multiple relative hyperlinks in ArcGIS for Desktop (python)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def OpenLink([Hyperlink_Log], [Hyperlink_Log2], [Hyperlink_Photo], [Hyperlink_LabTest], [Hyperlink_Televiewer], [Hyperlink_Geonor], [Hyperlink_Instrumentation] ): | |
| """Open multiple hyperlinks fields via python""" | |
| import webbrowser | |
| import os | |
| mxd = arcpy.mapping.MapDocument("CURRENT") | |
| basePath = mxd.hyperlinkBase | |
| paths = [Hyperlink_Log], [Hyperlink_Log2], [Hyperlink_LabTest], [Hyperlink_Photo], [Hyperlink_LabTest], [Hyperlink_Televiewer], [Hyperlink_Geonor], [Hyperlink_Instrumentation] | |
| for path in paths: | |
| if path is not None: | |
| webbrowser.open(os.path.join(basePath, path)) | |
| return |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment