'------ Script: VIEW.JPGMULTITHEMEPROP ' ' Useage: Run from view.jpgmultitoolapply tool ' ' ' Requires: The full path drawing locations must be added to a ' point attribute table, either by a join to a database ' or directly in the pat of the attribute table. User ' must edit the listofFieldNames to match the data. ' ' Self: A list of drawing locations ' Self(0) through Self (13): JPG Image file locations ' ' Written By: Jeff Natharius - July 8, 1998 ' (modified from code provided by Nancy Cope) '------------------------------------------------------------------ '------------------------------------------------------------------ '------------------------------------------------------------------ 'create list of JPG images of floorplans FilesList = {} floor1 = Self.Get(0) FilesList.Add(floor1.AsFileName) floor2 = Self.Get(1) FilesList.Add(floor2.AsFileName) floor3 = Self.Get(2) FilesList.Add(floor3.AsFileName) floor4 = Self.Get(3) FilesList.Add(floor4.AsFileName) floor5 = Self.GET(4) FilesList.Add(floor5.AsFileName) floor6 = Self.Get(5) FilesList.Add(floor6.AsFileName) floor7 = Self.Get(6) FilesList.Add(floor7.AsFileName) floor8 = Self.Get(7) FilesList.Add(floor8.AsFileName) floor9 = Self.Get(8) FilesList.Add(floor9.AsFileName) floor10 = Self.GET(9) FilesList.Add(floor10.AsFileName) floor11 = Self.Get(10) FilesList.Add(floor11.AsFileName) floor12 = Self.Get(11) FilesList.Add(floor12.AsFileName) floor13 = Self.Get(12) FilesList.Add(floor13.AsFileName) floor14 = Self.Get(13) FilesList.Add(floor14.AsFileName) MsgBox.Info("One moment please..." +NL+"Hit OK to continue.","Floorplans") 'Make sure the JPEG Image Support extension is loaded extdict = extension.getextensions if(extdict.get("JPEG Image Support") = nil) then extname = "$AVEXT"+"/jfif.avx" extension.open(extname.asfilename) end 'Only include fields with valid JPG images (floorplans) JPGList = {} 'JPGList = {"Floor1", "Floor2", "Floor3", "Floor4", . . . "Floor14"} 'Add each valid drawing to list if(floor1 <> "") then JPGList.Add("Floor1") end if(floor2 <> "") then JPGList.Add("Floor2") end if(floor3 <> "") then JPGList.Add("Floor3") end if(floor4 <> "") then JPGList.Add("Floor4") end if(floor5 <> "") then JPGList.Add("Floor5") end if(floor6 <> "") then JPGList.Add("Floor6") end if(floor7 <> "") then JPGList.Add("Floor7") end if(floor8 <> "") then JPGList.Add("Floor8") end if(floor9 <> "") then JPGList.Add("Floor9") end if(floor10 <> "") then JPGList.Add("Floor10") end if(floor11 <> "") then JPGList.Add("Floor11") end if(floor12 <> "") then JPGList.Add("Floor12") end if(floor13 <> "") then JPGList.Add("Floor13") end if(floor14 <> "") then JPGList.Add("Floor14") end 'get number in drawing list and files list ' this will be used to determine if all files are "" listCount = JPGList.Count fileCount = FilesList.Count noEmpty = 0 if(listCount > 0) then for each i in 0..(listCount - 1) if(JPGList.Get(i) = "") then noEmpty = noEmpty + 1 end 'if end 'for end 'if 'If there are no available drawings then exit if(noEmpty = listCount) then msgbox.info("There are no floorplans to display", "NOTICE") return nil end JPGDict = Dictionary.Make(14) JPGDict.Add("Floor1", FilesList.Get(0)) JPGDict.Add("Floor2", FilesList.Get(1)) JPGDict.Add("Floor3", FilesList.Get(2)) JPGDict.Add("Floor4", FilesList.Get(3)) JPGDict.Add("Floor5", FilesList.Get(4)) JPGDict.Add("Floor6", FilesList.Get(5)) JPGDict.Add("Floor7", FilesList.Get(6)) JPGDict.Add("Floor8", FilesList.Get(7)) JPGDict.Add("Floor9", FilesList.Get(8)) JPGDict.Add("Floor10", FilesList.Get(9)) JPGDict.Add("Floor11", FilesList.Get(10)) JPGDict.Add("Floor12", FilesList.Get(11)) JPGDict.Add("Floor13", FilesList.Get(12)) JPGDict.Add("Floor14", FilesList.Get(13)) 'Show available drawings JPGValue = msgbox.ListAsString(JPGList, "Select Floorplan to Display", "Drawings") theFileName = JPGDict.Get(JPGValue) if(theFileName <> nil) then theJPGFileName = theFileName.AsString 'check to make sure selected drawing is not "" if (theJPGFileName = "") then MsgBox.Info("There is no Floorplan to open","") theImageWin = nil return nil end 'display the selected JPG in a view if (File.Exists(theJPGFileName.AsFileName)) then srcImage = SrcName.Make(theJPGFileName) t = Theme.Make(srcImage) t.SetVisible(TRUE) v = View.Make v.AddTheme(t) v.SetTOCWidth(0) v.SetTOCUnresizable(TRUE) v.SetName(theJPGFileName.AsFileName.GetBaseName) if (av.FindScript("View.CloseImageView") = NIL) then s = Script.Make("av.GetProject.RemoveDoc(SELF)") s.SetName("View.CloseImageView") av.GetProject.AddScript(s) end v.SetCloseScript("View.CloseImageView") v.GetWin.Open end end ' '----------------End of Script: VIEW.JPGMULTITHEMEPROP