APSF //- Print out the FOV charts for selected objects, 1,2 or 4 charts per page. //- Either portrait or landscape - the script will figure out spacing, etc. //- The current FOV settings will be used for all objects (i.e. FOV size, //- settings, catalogues used). //- //- Paul Rodman, September 2008 //- //- V1.0 24 Sep 2008 //- Initial release dim what,perpage as integer dim s as string, doit as boolean, i,x,y,size,x0,y0,xinc,yinc as integer, c as Canvas what=RestoreIntegerValue("what",0) perpage=RestoreIntegerValue("perpage",0) // Get values using a dialog if SelectedObject>0 then s=Obj(SelectedObject).ID else s="0" SetChoiceParameter("What objects to print/display",what, _ "All objects ("+str(nObj)+")", _ "Highlighted objects only ("+Str(nHighlighted)+")", _ "Selected object only ("+s+")") SetChoiceParameter("Charts per page",perpage,"1 chart","2 charts","4 charts") If not EditParameters("Print FOV Charts") then return what = GetChoiceParameter("What objects to print/display") perpage = GetChoiceParameter("Charts per page") SaveIntegerValue("what",what) SaveIntegerValue("perpage",perpage) c=new Canvas(false) if c.Cancelled then return if perpage=2 then c.TextFont("Times",9) else c.TextFont("Times",12) y0=c.Textheight*2 select case perpage case 0 // 1 per page size=min(c.Width,c.Height) x0=(c.Width-size)\2 xinc=c.Width yinc=c.Height case 1 // 2 per page if c.Widthc.Width then x=x0 y=y+yinc end if if y+size>c.Height then x=x0 y=y0 c.NewPage end if s=Obj(i).ID+" RA: "+Obj(i).RAFormatted+" Dec: "+Obj(i).DecFormatted if Obj(i).Name<>"" and Obj(i).Name<>Obj(i).ID then s=s+" "+Obj(i).Name c.DrawFOV x,y,size,true,s x=x+xinc if x>=c.Width then x=x0 y=y+yinc end if end if if UserAbort then exit next c.Close