HOW TO

Hotlink multiple images to Views

Last Published: April 25, 2020

Procedure

Question:

How to hotlink to multiple images and display the images in Views.

Answer:

In the Theme properties, choose 'Link to User Script' for the Predefined Action and link it to the following 'Hotlink to multiple images' script. This script allows hotlinking to two images. To hotlink to more images, duplicate the section enclosed by the ========= lines and change the values theImage2 to theImage3, srcImage2 to srcImage3, Ithme2 to Ithme3, etc.

Code:
'Hotlink to multiple images

theView = av.GetActiveDoc
found = false
p = theView.GetDisplay.ReturnUserPoint
for each t in theView.GetActiveThemes
if (t.Is(FTheme)) then
recs = t.FindByPoint(p)
for each rec in recs


theimage1 = t.getftab.returnvaluestring(t.getftab.Findfield("Newfield"),rec)

if (File.Exists(theimage1.AsFileName)) then
srcImage = SrcName.Make(theimage1)
Ithme = Theme.Make(srcImage)
Ithme.SetVisible(TRUE)

v = View.Make
v.AddTheme(Ithme)
v.SetTOCWidth(0)
v.SetTOCUnresizable(TRUE)
v.SetName(theimage1.AsFileName.GetBaseName)
end
v.GetWin.Open

'===============================================
theimage2 =
t.getftab.returnvaluestring(t.getftab.Findfield("Newfield1"),rec)

if (File.Exists(theimage2.AsFileName)) then
srcImage2 = SrcName.Make(theimage2)
Ithme2 = Theme.Make(srcImage2)
Ithme2.SetVisible(TRUE)

v = View.Make
v.AddTheme(Ithme2)
v.SetTOCWidth(0)
v.SetTOCUnresizable(TRUE)
v.SetName(theimage2.AsFileName.GetBaseName)
end
v.GetWin.Open
'==================================================

found = true


end
end
end
if (not found) then
System.Beep
end


Note:
ESRI hopes that these sample scripts, extensions, and other items are useful and that they contribute to your success in using ArcView. Please note that these samples are not supported by ESRI.

These samples are provided for non-commercial purposes only. Permission to use, copy, and distribute is hereby granted, provided there is no charge or fee for such copies.
THESE SAMPLES ARE PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANT ABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ESRI shall not be liable for any damages under any theory of law related to Licensee's use of these samples, even if ESRI is advised of the possibility of such damage.

Article ID:000001516

Software:
  • Legacy Products

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options

Related Information

Discover more on this topic