/3.2
(Extension.1
	Name:	"GB2UTM Tools"
	FirstRootClassName:	"Space"
	Roots:	2
	Roots:	3
	Roots:	4
	Roots:	5
	Roots:	6
	Roots:	7
	Roots:	8
	Roots:	9
	Roots:	10
	Roots:	11
	Roots:	12
	Roots:	13
	Roots:	14
	Roots:	15
	Roots:	16
	Roots:	17
	Roots:	18
	Roots:	19
	Roots:	20
	Roots:	21
	Roots:	22
	Roots:	23
	Version:	32
	About:	"GB2UTM Tools ver.1.0 - 27.06.2005\n\nAmt für raumbezogene und statistische Informatik\nUfficio informatica geografica e statistica\nWalter.Gruber@provinz.bz.it"
	InstallScript:	11
	UninstallScript:	21
)

(Space.2
)

(Choice.3
	Label:	"GB2UTM - Check Themes"
	Click:	"GB2UTM.View.CheckThemes"
	Shortcut:	"Keys.None"
)

(Choice.4
	Label:	"GB2UTM - Convert View and Graphics"
	Click:	"GB2UTM.View.ConvertView"
	Shortcut:	"Keys.None"
)

(Choice.5
	Label:	"GB2UTM - Help"
	Click:	"GB2UTM.Script.Help"
	Shortcut:	"Keys.None"
)

(Space.6
)

(Choice.7
	Label:	"GB2UTM - Check Themes in selected ViewFrame"
	Click:	"GB2UTM.Layout.CheckThemes"
	Shortcut:	"Keys.None"
)

(Choice.8
	Label:	"GB2UTM - Convert ViewFrames"
	Click:	"GB2UTM.Layout.ConvertNotLiveLinkedViewFrames"
	Shortcut:	"Keys.None"
)

(Choice.9
	Label:	"GB2UTM - Help"
	Click:	"GB2UTM.Script.Help"
	Shortcut:	"Keys.None"
)

(Script.10
	Name:	"GB2UTM.History"
	SourceCode:	"' History for Extension GB2UTM\n' 13.05.2005 - Walter Gruber, original\n' 27.06.2005 - modified GB2UTM.InstallScript and GB2UTM.UninstallScript\n'              menu choices are now added and removed also to Custom View Documents and\n'              Custom Layout Documents (for example for project RADMAP - Luca Verdi)"
)

(Script.11
	Name:	"GB2UTM.InstallScript"
	SourceCode:	"'Check if there's an active project\n'\nif (av.getProject = nil) then\n  return nil\nend\n\n'Add the new menu choices to all View Documents, including Custom View Documents\n'\nlstViewDocs = av.GetProject.FindGUIsFor(View)\n'\nfor each theViewDoc in lstViewDocs\n  theViewMenuBar = theViewDoc.GetMenuBar\n  theViewMenu = theViewMenuBar.FindByLabel(\"View\")\n  '\n  'Add the Choices last in \"View\" menu on the View Menu Bar\n  if (theViewMenu <> nil) then\n    theViewMenu.Add(self.Get(0),999)\n    theViewMenu.Add(self.Get(1),999)
\n    theViewMenu.Add(self.Get(2),999)\n    theViewMenu.Add(self.Get(3),999)\n  end\nend\n  \n'Add the new menu choices to all Layout Documents, including Custom Layout Documents\n'\nlstLayoutDocs = av.GetProject.FindGUIsFor(Layout)\n'\nfor each theLayoutDoc in lstLayoutDocs\n  theLayoutMenuBar = theLayoutDoc.GetMenuBar\n  theLayoutMenu = theLayoutMenuBar.FindByLabel(\"Layout\")\n  '\n  'Add the Choices last in \"Layout\" menu on the Layout Menu Bar\n  if (theLayoutMenu <> nil) then\n    theLayoutMenu.Add(self.Get(4),999)\n    
theLayoutMenu.Add(self.Get(5),999)\n    theLayoutMenu.Add(self.Get(6),999)\n    theLayoutMenu.Add(self.Get(7),999)\n  end\nend\n\n'Show warning message if no ini-File is found\n'\nbolFileExists = False\nif (File.Exists(\"$AVEXT/GB2UTM_Tools.ini\".AsFileName)) then\n  bolFileExists = True\nend\nif (File.Exists(\"$USEREXT/GB2UTM_Tools.ini\".AsFileName)) then\n  bolFileExists = True\nend\nif (bolFileExists.Not) then\n  MsgBox.Warning(\"File GB2UTM_Tools.ini not found in %AVHOME%\\Ext32 or %USEREXT% !\"+NL+NL+\n                 \"Using
 standard default values.\", \"Warning\")\nend\n\n'Popup a message for a few seconds when the Extension is loaded\n'\ntheDefaultValuesList = av.Run(\"GB2UTM.Script.SetDefaultVariables\", { })\nbolShowMessage = theDefaultValuesList.Get(12)\nif (bolShowMessage) then\n  bolFileExists = False\n  if (File.Exists(\"$AVEXT/GB2UTM_Tools.gif\".AsFileName)) then\n    theFileName = \"$AVEXT/GB2UTM_Tools.gif\".AsFileName\n    bolFileExists = True\n  end\n  if (File.Exists(\"$USEREXT/GB2UTM_Tools.gif\".AsFileName)) then\n    theFileName = \"$USE
REXT/GB2UTM_Tools.gif\".AsFileName\n    bolFileExists = True\n  end\n  if (bolFileExists) then\n    MsgBox.Banner(theFileName,5,\"Warning\")\n  end\nend"
)

(Script.12
	Name:	"GB2UTM.Layout.CheckThemes"
	SourceCode:	"'Name: GB2UTM.Layout.CheckThemes\n'\n'Titel: Checkt Themes der aktiven View\n'\n'Beschreibung: Checkt alle Themen der aktiven View und gibt Liste aus\n'              ob Themen in GB6, GB7 und somit zu konvertieren sind\n'              oder ob Themen bereits in UTM WGS84 ETRS89.\n'\n'Wird aufgerufen von: Menu in ViewDocument - View - Check Themes\n'\n'Self: -\n'\n'Gibt zurück: -\n'\n'Entstehungsgeschichte:\n'12.04.2005 Walter Gruber - Original\n\nif (av.GetActiveDoc.Is(Layout)) then\n  theLayout = av.GetActiveDoc\nelse\n  MsgBo
x.Warning(\"This scripts works only with Layout Documents!\"+NL+NL+\"Exiting...\",\"Warning\")\n  exit\nend\n\n'Wenn Layout keine Graphics enthält dann Ausstieg ohne Info\nif (theLayout.GetGraphics.Count = 0) then\n  exit\nend\n\n'\nlstGraphics = theLayout.GetGraphics\nnumSelectedNotLivedLinkedViewFramesCounter = 0\nfor each theLayoutGraphic in lstGraphics\n  if (theLayoutGraphic.IsSelected) then\n    if (theLayoutGraphic.Is(ViewFrame)) then\n      if (theLayoutGraphic.IsLiveLinked.Not) then\n        numSelectedNotLivedLinkedVie
wFramesCounter = numSelectedNotLivedLinkedViewFramesCounter + 1\n      end\n    end\n  end\nend\nif (numSelectedNotLivedLinkedViewFramesCounter = 0) then\n  MsgBox.Warning(\"No NOT Live Linked ViewFrame selected!\"+NL+NL+\n              \"Please select one.\",\"Warning\")\n  exit\nelseif (numSelectedNotLivedLinkedViewFramesCounter > 1) then\n  MsgBox.Warning(\"More than one NOT Live Linked ViewFrames selected!\"+NL+NL+\n                 \"Please select only one NOT Live Linked ViewFrame.\",\"Warning\")\n  exit\nend\n'\nfor each theLa
youtGraphic in lstGraphics\n  if (theLayoutGraphic.IsSelected) then\n    if (theLayoutGraphic.Is(ViewFrame)) then\n      if (theLayoutGraphic.IsLiveLinked.Not) then\n        theLayout.GetGraphics.UnselectAllExcept(theLayoutGraphic)\n      end\n    end\n  end\nend \n\ntheView = theLayout.GetGraphics.GetSelected.Get(0).GetView\n\nlstSummary = av.Run(\"GB2UTM.Script.CheckThemes\", { True, False, theView, theLayout.GetName })\n"
)

(Script.13
	Name:	"GB2UTM.Layout.ConvertNotLiveLinkedViewFrames"
	SourceCode:	"'Name: GB2UTM.Layout.ConvertNotLiveLinkedViewFrames\n'\n'Titel: Konvertiert ViewFrames ohne LiveLink in Layout\n'\n'Beschreibung: Konvertiert den Extent von ViewFrames ohne Live Link \n'              von GaussBoaga 6-stellig bzw. GaussBoaga 7-stellig nach UTM ETRS89.\n'              Auch sämtliche grafischen Objekte im ViewFrame werden konvertiert.\n'\n'Wird aufgerufen von: \n'\n'Self: -\n'\n'Gibt zurück: -\n'\n'Entstehungsgeschichte:\n'12.04.2005 Walter Gruber - Original\n\nif (av.GetActiveDoc.Is(Layout)) then\n  theLayout 
= av.GetActiveDoc\nelse\n  MsgBox.Warning(\"This scripts works only with Layout Documents!\"+NL+NL+\"Exiting...\",\"Warning\")\n  exit\nend\n\n'Liste der NotLiveLinked(=NLL) ViewFrames erstellen\nlstNLLViewFrames = List.Make\n\nif (theLayout.GetGraphics.HasSelected) then\n  theLayoutGraphicList = theLayout.GetGraphics.GetSelected\n  numSelectedGraphics = theLayoutGraphicList.Count\n  for each theLayoutGraphic in theLayoutGraphicList\n    if ((theLayoutGraphic.Is(ViewFrame)) and (theLayoutGraphic.IsLiveLinked.Not)) then\n      
lstNLLViewFrames.Add(theLayoutGraphic)\n    end\n  end\n  if (lstNLLViewFrames.IsEmpty) then\n    MsgBox.Info(\"None of the selected Graphic(s) is a NOT Live Linked ViewFrame!\"+NL+NL+\n                \"Exiting...\",\"Information\")\n    exit\n  elseif (MsgBox.YesNo(lstNLLViewFrames.Count.AsString++\"of selected Graphic(s) are NOT Live Linked ViewFrames\"+NL+\n                       \"and will be converted to UTM WGS84 ETRS89.\"+NL+NL+\"Continue?\",\"Confirm\",true).Not) then\n    exit\n  else\n    theLayout.GetGraphics.UnselectAl
l\n  end\nelse\n  theLayoutGraphicList = theLayout.GetGraphics\n  for each theLayoutGraphic in theLayoutGraphicList\n    if ((theLayoutGraphic.Is(ViewFrame)) and (theLayoutGraphic.IsLiveLinked.Not)) then\n      lstNLLViewFrames.Add(theLayoutGraphic)\n    end\n  end\n  if (lstNLLViewFrames.IsEmpty) then\n    MsgBox.Info(\"Layout has no NOT Live Linked ViewFrames!\"+NL+NL+\"Exiting...\",\"Information\")\n    exit\n  elseif (MsgBox.YesNo(lstNLLViewFrames.Count.AsString++\"ViewFrame(s) that are NOT Live Linked to a View\"+NL+\n    
                   \"will be converted to UTM WGS84 ETRS89.\"+NL+NL+\"Continue?\",\"Confirm\",true).Not) then\n    exit\n  end\nend\n\nfor each theNLLViewFrame in lstNLLViewFrames\n  if (theNLLViewFrame.IsSelected.Not) then\n    theNLLViewFrame.Select\n  end\n  '\n  theView = theNLLViewFrame.GetView\n  \n  'Wenn ViewFrame Themen enthält die in GB6 oder GB7 sind dann Info und weiter mit nächstem ViewFrame\n  'Wenn ViewFrame Themen mit unbekannten Koordinatensystem dann kann Benutzer entscheiden ob weiter\n  'Wenn alle Themen ei
nes ViewFrames in UTM WGS84 ETRS89 dann weiter ohne Info\n  lstSummary = av.Run(\"GB2UTM.Script.CheckThemes\", { False, True, theView, \"Layout\" })\n  numGB6_Counter = lstSummary.Get(0)\n  numGB7_Counter = lstSummary.Get(1)\n  numUTM_WGS84_ETRS89_Counter = lstSummary.Get(2)\n  numUnknown_Counter = lstSummary.Get(3)\n  bolContinue = False\n  if ((numGB6_Counter > 0) or (numGB7_Counter > 0)) then\n    MsgBox.Warning(\"ViewFrame has Themes that are in Gauss Boaga 6 or Gauss Boaga 7!\"+NL+\n                   \"Please use \"+\"
GB2UTM - Check Themes in selected ViewFrame\".Quote+NL+\n                   \"to get a report of all that Themes and convert them to UTM WGS84 ETRS89 before running this Tool.\",\n                   \"Warning\")\n    bolContinue = True\n  end\n  if (numUnknown_Counter > 0) then\n    if (bolContinue) then\n      'Wenn auch GB6- oder GB7-Themen in ViewFrame dann eine Art von Info\n      MsgBox.Warning(\"ViewFrame has also Themes with Unknown Coordinate System!\"+NL+NL+\n                     \"Please use \"+\"GB2UTM - Check Them
es\".Quote+\" to get a report of all\"+NL+\n                     \"that Themes and modify the XMin,YMin-XMax,YMax values in the ini-File \"+\n                     \"GB2UTM_Tools.ini\".Quote+\" as described in the manual.\",\n                     \"Warning\")\n    else\n      'Wenn ausschließlich Themen mit unbekanntem Koordinatensystem dann andere Art von Info\n      MsgBox.Warning(\"ViewFrame has Themes with Unknown Coordinate System!\"+NL+\n                     \"Please use \"+\"GB2UTM - Check Themes\".Quote+\" to get a report of
 all\"+NL+\n                     \"that Themes and modify the XMin,YMin-XMax,YMax values in the ini-File \"+\n                     \"GB2UTM_Tools.ini\".Quote+\" as described in the manual before running this Tool.\",\n                     \"Warning\")\n    end\n    bolContinue = True\n  end\n  if (bolContinue) then\n    theNLLViewFrame.Unselect\n    continue\n  end\n\n  'Wenn View Extent und Graphics bereits in UTM WGS84 ETRS89 dann Info und weiter mit nächstem ViewFrame\n  'Graphics\n  if (theView.GetGraphics.Count > 0) then\n   
 theRect = theView.GetGraphics.ReturnExtent\n    strGraphicsCoordSys = av.Run(\"GB2UTM.Script.CoordinateSystemChecker\", { theRect })\n  else\n    strGraphicsCoordSys = \"UTM_WGS84_ETRS89\"\n  end\n  'View Extent\n  theRect = theView.GetDisplay.ReturnVisExtent\n  strViewCoordSys = av.Run(\"GB2UTM.Script.CoordinateSystemChecker\", { theRect })\n  '\n  if ((strGraphicsCoordSys = \"UTM_WGS84_ETRS89\") and (strViewCoordSys = \"UTM_WGS84_ETRS89\")) then\n    MsgBox.Info(\"ViewFrame Extent and Graphics are already in UTM WGS84 ETRS89
!\"+NL+NL+\n                \"Skipping this ViewFrame...\",\"Information\")\n    theNLLViewFrame.Unselect\n    continue\n  end\n  '\n  'Wenn View Extent mit unbekannten Koordinatensystem dann Info und weiter mit nächstem ViewFrame\n  if (strViewCoordSys = \"Unknown\") then\n    MsgBox.Warning(\"Coordinate system of current ViewFrame Extent is unknown!\"+NL+\n                   \"Please modify the XMin,YMin-XMax,YMax values in the ini-File \"+\n                   \"GB2UTM_Tools.ini\".Quote+\" as described in the manual and run \"+\n 
                  \"again this Tool.\"+NL+\"Skipping this ViewFrame...\",\"Warning\")\n    theNLLViewFrame.Unselect\n    continue\n  end\n\n  'Are you sure?\n  'Die Frage wird je nachdem, ob die View Graphics beinhaltet oder nicht, anders formuliert\n  if (theView.GetGraphics.Count > 0) then\n    if (MsgBox.YesNo(\"Do you really want to convert current ViewFrame Extent\"+NL+\n                     \"and all Graphics to UTM WGS84 ETRS89?\",\"Confirm\",true).Not) then\n      theNLLViewFrame.Unselect\n      continue\n    end\n  elseif 
(MsgBox.YesNo(\"Do you really want to convert current ViewFrame Extent\"+NL+\n                       \"to UTM WGS84 ETRS89?\",\"Confirm\",true).Not) then\n    theNLLViewFrame.Unselect\n    continue\n  end\n  \n  'Clonen der View (View muss geclont werden damit alles funktioniert)\n  'Achtung: Ab hier kein Exit-Statement mehr absetzen denn sonst wird in der Liste der Views\n  '         eine Kopie dieser View angelegt!!\n  theView = theNLLViewFrame.GetView.Clone\n\n  'Konversion der View und Graphics\n  theView = av.Run(\"GB2UT
M.Script.ConvertViewAndGraphics\", { theView, \"ViewFrame\" })\n  \n  'Zuweisen der geclonten, verändertern View zum ViewFrame\n  theNLLViewFrame.SetView(theView,false)\n\n  av.GetProject.RemoveDoc(theView)\n  theNLLViewFrame.Unselect\nend\n\ntheLayout.Invalidate\ntheLayout.GetDisplay.Flush"
)

(Script.14
	Name:	"GB2UTM.Script.CheckThemes"
	SourceCode:	"'Name: GB2UTM.Script.CheckThemes\n'\n'Titel: Checkt Themes der aktiven View oder eines ViewFrames im aktiven Layout\n'\n'Beschreibung: Checkt alle Themen der aktiven View oder eines ViewFrames im\n'              aktiven Layout und gibt Liste aus ob Themen in GB6, GB7 und somit\n'              zu konvertieren sind oder ob Themen bereits in UTM WGS84 ETRS89.\n'              \n'Wird aufgerufen von: GB2UTM.View.CheckThemes, GB2UTM.Layout.CheckThemes,\n'                     GB2UTM.View.ConvertView, GB2UTM.Layout.ConvertN
otLiveLinkedViewFrames\n'\n'Self: siehe unten\n'\n'Gibt zurück: -\n'\n'Entstehungsgeschichte:\n'12.04.2005 Walter Gruber - Original\n\n'Auslesen der übergebenen Objekte\nbolMakeReport = SELF.Get ( 0 ) 'Boolean, a switch\nbolReturnSummaryList = SELF.Get ( 1 ) 'Boolean, a switch\ntheView = SELF.Get ( 2 ) 'Object, a View\nstrViewOrLayout = SELF.Get ( 3 ) 'String, contains string \"View\" or Name of Layout\n\n'SetNumberFormat damit GB7- u. UTM WGS84 ETRS89-Koordinaten nicht in wissenschaftlicher\n'Notatation (z.B. e+006) angezei
gt werden\nScript.The.SetNumberFormat(\"d.ddd\")\n\n'\nif (bolMakeReport) then\n  'BenutzerInput für Filename eingeben und anlegen\n  FNOutputFile = FileDialog.Put(\"GB2UTM_ThemeReport.txt\".AsFileName,\"*.txt\", \"Output File Name:\")\n  if (FNOutputFile = Nil) then\n    exit\n  end\n  WriteFileOutputFile = LineFile.Make(FNOutputFile, #FILE_PERM_WRITE)\n  '\n  'Schreiben der Überschrift\n  if (strViewOrLayout = \"View\") then\n    strViewDocType = \"View\"\n    strUeberschrift = \"GB2UTM - Theme(s) of View:\"++theView.GetName.UCase\n  
else\n    strViewDocType = \"ViewFrame\"\n    strUeberschrift = \"GB2UTM - Theme(s) of ViewFrame in Layout\"++strViewOrLayout.UCASE.Quote++\"that has NO Live Link to View:\"++theView.GetName.UCase\n  end\n  recOutputFile = strUeberschrift\n  WriteFileOutputFile.WriteElt(recOutputFile)\n  recOutputFile = \"\"\n  WriteFileOutputFile.WriteElt(recOutputFile)\n  '\n  'Schreiben der Überschrift 2\n  theViewRect = theView.GetDisplay.ReturnVisExtent\n  numXMin_View = theViewRect.GetLeft\n  numYMin_View = theViewRect.GetBottom\n  numXMa
x_View = theViewRect.GetRight\n  numYMax_View = theViewRect.GetTop\n  strUeberschrift2 = \"Bounding Coordinates of\"++strViewDocType+\":\"++numXMin_View.AsString+\",\"+numYMin_View.AsString+\n                       \", \"+numXMax_View.AsString+\",\"+numYMax_View.AsString\n  recOutputFile = strUeberschrift2\n  WriteFileOutputFile.WriteElt(recOutputFile)\n  '\n  'Schreiben der Überschrift 3\n  strCoordSys = av.Run(\"GB2UTM.Script.CoordinateSystemChecker\", { theViewRect })\n  if (strCoordSys = \"GaussBoaga_6\") then\n    strUebersch
rift3 = \"Coordinate system of\"++strViewDocType++\"is Gauss Boaga 6.\"\n  elseif (strCoordSys = \"GaussBoaga_7\") then\n    strUeberschrift3 = \"Coordinate system of\"++strViewDocType++\"is Gauss Boaga 7.\"\n  elseif (strCoordSys = \"UTM_WGS84_ETRS89\") then\n    strUeberschrift3 = \"Coordinate system of\"++strViewDocType++\"is UTM WGS84 ETRS89.\"\n  else\n    strUeberschrift3 = \"Coordinate system of\"++strViewDocType++\"is unknown! Use \"+\"GB2UTM - Help\".Quote+\" for more info.\"\n  end\n  recOutputFile = strUeberschrift3\n  WriteFile
OutputFile.WriteElt(recOutputFile)\n  '\n  recOutputFile = \"\"\n  WriteFileOutputFile.WriteElt(recOutputFile)\n\n  numGB6_Counter = 0\n  numGB7_Counter = 0\n  numUTM_WGS84_ETRS89_Counter = 0\n  numUnknown_Counter = 0\n  lstRecords = List.Make\n  '\n  for each theTheme in theView.GetThemes\n    '\n    strThemeName = theTheme.GetName.UCase\n    lstRecords.Add(strThemeName)\n  \n    '\n    if (theTheme.GetSrcName = Nil) then\n      strThemeSource = \"Source:\"++theTheme.GetSColumn.AsString\n    else\n      strThemeSource = \"Source:\"
++theTheme.GetSrcName.GetDataSource\n    end\n    lstRecords.Add(strThemeSource)\n    \n    '\n    theRect = theTheme.ReturnExtent\n    numXMin = theRect.GetLeft\n    numYMin = theRect.GetBottom\n    numXMax = theRect.GetRight\n    numYMax = theRect.GetTop\n    strExtent = \"Bounding Coordinates:\"++numXMin.AsString+\",\"+numYMin.AsString+\n                \", \"+numXMax.AsString+\",\"+numYMax.AsString\n    lstRecords.Add(strExtent)\n    '  \n    strCoordSys = av.Run(\"GB2UTM.Script.CoordinateSystemChecker\", { theRect })\n    if (
strCoordSys = \"GaussBoaga_6\") then\n      strThemeCoordSys = theTheme.GetName.UCase++\"is in Gauss Boaga 6 and should be converted to UTM WGS84 ETRS89!\"\n      numGB6_Counter = numGB6_Counter + 1\n    elseif (strCoordSys = \"GaussBoaga_7\") then\n      strThemeCoordSys = theTheme.GetName.UCase++\"is in Gauss Boaga 7 and should be converted to UTM WGS84 ETRS89!\"\n      numGB7_Counter = numGB7_Counter + 1\n    elseif (strCoordSys = \"UTM_WGS84_ETRS89\") then\n      strThemeCoordSys = theTheme.GetName.UCase++\"is already in
 UTM WGS84 ETRS89. No conversion needed!\"\n      numUTM_WGS84_ETRS89_Counter = numUTM_WGS84_ETRS89_Counter + 1\n    else\n      strThemeCoordSys = \"Coordinate system of\"++theTheme.GetName.UCase++\"is unknown! Use \"+\"GB2UTM - Help\".Quote+\" for more info.\"\n      numUnknown_Counter = numUnknown_Counter + 1\n    end\n    lstRecords.Add(strThemeCoordSys)\n    '\n    if (theRect.IsEmpty) then\n      strInvalidDatasource = \"The most probable reason is that the Datasource of the Theme is invalid!\"\n      lstRecords.Add(strIn
validDatasource)\n    end\n  \n    '\n    lstRecords.Add(\"\")\n  end\n\n  'Zusammenfassung in File schreiben\n  strNumberOfThemesInView = \"View has a total of\"++theView.GetThemes.Count.SetFormat(\"d\").AsString++\"Theme(s)\"\n  WriteFileOutputFile.WriteElt(strNumberOfThemesInView)\n  '\n  if (numGB6_Counter > 0) then\n    strNumberOfGB6Themes = numGB6_Counter.SetFormat(\"d\").AsString++\"Theme(s) are in Gauss Boaga 6 and should be converted to UTM WGS84 ETRS89!\"\n    WriteFileOutputFile.WriteElt(strNumberOfGB6Themes)\n  end\n  '\n
  if (numGB7_Counter > 0) then\n    strNumberOfGB7Themes = numGB7_Counter.SetFormat(\"d\").AsString++\"Theme(s) are in Gauss Boaga 7 and should be converted to UTM WGS84 ETRS89!\"\n    WriteFileOutputFile.WriteElt(strNumberOfGB7Themes)\n  end\n  '\n  if (numUTM_WGS84_ETRS89_Counter > 0) then\n    strNumberOfUTM_WGS84_ETRS89_Themes = numUTM_WGS84_ETRS89_Counter.SetFormat(\"d\").AsString++\"Theme(s) are already in UTM WGS84 ETRS89. No conversion needed!\"\n    WriteFileOutputFile.WriteElt(strNumberOfUTM_WGS84_ETRS89_Themes)
\n  end\n  '\n  if (numUnknown_Counter > 0) then\n    strNumberOfUnknownThemes = numUnknown_Counter.SetFormat(\"d\").AsString++\"Theme(s) have unknown coordinate system! Use \"+\"GB2UTM - Help\".Quote+\" for more info.\"\n    WriteFileOutputFile.WriteElt(strNumberOfUnknownThemes)\n  end\n  '\n  recOutputFile = \"\"\n  WriteFileOutputFile.WriteElt(recOutputFile)\n  \n  'Details in File schreiben\n  recOutputFile = \"DETAIL:\"\n  WriteFileOutputFile.WriteElt(recOutputFile)\n  for each Record in lstRecords\n    WriteFileOutputFile.Write
Elt(Record)\n  end\n  \n  'Schliessen des OutputFiles\n  WriteFileOutputFile.Close\n  \n  'Öffnen des Reports im Notepad (Script läuft weiter)\n  System.Execute(\"notepad.exe\"++FNOutputFile.AsString)\n  \n  '\n  return Nil\nend\n\nif (bolReturnSummaryList) then\n  '\n  numGB6_Counter = 0\n  numGB7_Counter = 0\n  numUTM_WGS84_ETRS89_Counter = 0\n  numUnknown_Counter = 0\n  lstSummary = List.Make\n  '\n  for each theTheme in theView.GetThemes\n    '\n    theRect = theTheme.ReturnExtent\n    '\n    strCoordSys = av.Run(\"GB2UTM.Script.C
oordinateSystemChecker\", { theRect })\n    if (strCoordSys = \"GaussBoaga_6\") then\n      numGB6_Counter = numGB6_Counter + 1\n    elseif (strCoordSys = \"GaussBoaga_7\") then\n      numGB7_Counter = numGB7_Counter + 1\n    elseif (strCoordSys = \"UTM_WGS84_ETRS89\") then\n      numUTM_WGS84_ETRS89_Counter = numUTM_WGS84_ETRS89_Counter + 1\n    else\n      numUnknown_Counter = numUnknown_Counter + 1\n    end\n    '\n  end\n  \n  '\n  lstSummary.Add(numGB6_Counter)\n  lstSummary.Add(numGB7_Counter)\n  lstSummary.Add(numUTM_WGS84
_ETRS89_Counter)\n  lstSummary.Add(numUnknown_Counter)\n  \n  '\n  return lstSummary\nend"
)

(Script.15
	Name:	"GB2UTM.Script.ConvertViewAndGraphics"
	SourceCode:	"'Name: GB2UTM.Script.ConvertViewAndGraphics\n'\n'Titel: Konvertiert eine View und dessen Graphics\n'\n'Beschreibung: Konvertiert den Extent einer View GaussBoaga 6-stellig\n'              bzw. GaussBoaga 7-stellig nach UTM WGS84 ETRS89.\n'              Auch sämtliche grafischen Objekte werden konvertiert.\n'\n'Wird aufgerufen von: GB2UTM.View.ConvertView, GB2UTM.Layout.ConvertNotLiveLinkedViewFrames\n'\n'Self: siehe unten\n'\n'Gibt zurück: theView\n'\n'Entstehungsgeschichte:\n'12.04.2005 Walter Gruber - Original\n\n'Auslese
n der übergebenen Objekte\ntheView = SELF.Get ( 0 ) 'Object, a View\nstrDocType = SELF.Get ( 1 ) 'String, can be \"View\" or \"ViewFrame\"\n\n'Convert Graphics\n'Wenn sich Graphics innerhalb GB6- oder GB7-Rects befinden dann Konversion\nif (theView.GetGraphics.Count > 0) then\n  lstCoordSysRects = av.Run(\"GB2UTM.Script.CoordinateSystemRects\", { })\n  theRectGB6 = lstCoordSysRects.Get(0)\n  theRectGB7 = lstCoordSysRects.Get(1)\n  theRectUTM_WGS84_ETRS89 = lstCoordSysRects.Get(2)\n  '\n  lstSelectionRects = List.Make\n  lstSe
lectionRects.Add(theRectGB6)\n  lstSelectionRects.Add(theRectGB7)\n  for each theSelectionRect in lstSelectionRects\n    if (theView.GetGraphics.SelectRect(theSelectionRect, false)) then\n      lstViewGraphicsSelected = theView.GetGraphics.GetSelected\n      '\n      bolStatusBarProgress = av.SetStatus(0)\n      numProgressCounter = 1\n      numNumberOfSelectedGraphics = lstViewGraphicsSelected.Count\n      '\n      if (numNumberOfSelectedGraphics > 50000) then\n        if (MsgBox.YesNo(\"A total of\"++numNumberOfSelect
edGraphics.AsString++\"Graphics (Labels, Rects,...) will be converted!\"+NL+\n                         \"Depending on the speed of your Computer this could take\"+NL+\n                         \"a long time.\"+NL+NL+\n                         \"Continue?\",\"Confirm\",true).Not) then\n          exit\n        end\n      end\n      '\n      for each theViewGraphic in lstViewGraphicsSelected\n        theOriginPoint_GB = theViewGraphic.GetOrigin\n        theOriginPoint_UTM_WGS84_ETRS89 = av.Run(\"GB2UTM.Script.CoordinateConverter\",
 { theOriginPoint_GB })\n        theViewGraphic.SetOrigin(theOriginPoint_UTM_WGS84_ETRS89)\n        '\n        av.ShowMsg(\"Converting\"++numNumberOfSelectedGraphics.AsString++\"Graphics...\")\n        numProgress = (numProgressCounter/numNumberOfSelectedGraphics) * 100\n        bolStatusBarProgress = av.SetStatus(numProgress)\n        numProgressCounter = numProgressCounter + 1\n      end\n      '\n      theView.GetGraphics.UnselectAll\n    end\n    av.ClearMsg\n  end\nend\n\n'Convert View-Extent\n'Wenn View-Extent der View b
ereits in UTM WGS84 ETRS89 dann keine Konversion und Info\n'Wenn View-Extent der View in GB6 oder GB7 sind dann Konversion\ntheViewRect = theView.GetDisplay.ReturnVisExtent\nstrCoordSys = av.Run(\"GB2UTM.Script.CoordinateSystemChecker\", { theViewRect })\nif (strCoordSys = \"UTM_WGS84_ETRS89\") then\n  MsgBox.Info(strDocType++\"is already in UTM WGS84 ETRS89!\"+NL+NL+\n              \"View Extent will not be changed.\",\"Information\")\nelse\n  numViewScale = theView.ReturnScale\n  '\n  theLLPoint_GB = Point.Make(theViewRect.G
etLeft, theViewRect.GetBottom)\n  theURPoint_GB = Point.Make(theViewRect.GetRight, theViewRect.GetTop)\n  theLLPoint_UTM_WGS84_ETRS89 = av.Run(\"GB2UTM.Script.CoordinateConverter\", { theLLPoint_GB })\n  theURPoint_UTM_WGS84_ETRS89 = av.Run(\"GB2UTM.Script.CoordinateConverter\", { theURPoint_GB })\n  theNewRect = Rect.MakeXY(theLLPoint_UTM_WGS84_ETRS89.GetX,theLLPoint_UTM_WGS84_ETRS89.GetY, theURPoint_UTM_WGS84_ETRS89.GetX,theURPoint_UTM_WGS84_ETRS89.GetY)\n  theView.GetDisplay.SetExtent(theNewRect)\n  '\n  theView.Ge
tDisplay.ZoomToScale(numViewScale)\nend\n\n'Wenn View einer ViewFrame konvertiert wird dann Rückgabe des Objekts \"theView\" an die\n'aufrufende Routine weil es dort gebraucht wird\nif (strDocType = \"ViewFrame\") then\n  return theView\nelse\n  return Nil\nend"
)

(Script.16
	Name:	"GB2UTM.Script.CoordinateConverter"
	SourceCode:	"'Name: GB2UTM.Script.CoordinateConverter\n'\n'Titel: Konvertiert Koordinatenpunkte\n'\n'Beschreibung: Konvertiert Koordinatenpunkte von GaussBoaga 6-stellig bzw.\n'              GaussBoaga 7-stellig nach UTM ETRS89 gemäss Formel die im \n'              Amtsblatt der Region vom 20. April 199 - Nr. 19 veröffentlicht wurde\n'\n'Wird aufgerufen von: \n'\n'Self: siehe unten\n'\n'Gibt zurück: thePoint_UTM_ETRS89\n'\n'Entstehungsgeschichte:\n'12.04.2005 Walter Gruber - Original\n\n'Auslesen der übergebenen Objekte\nthePoint_GB = SE
LF.Get ( 0 ) 'Object, a Point\n\nnumgbE89Alfa = 0.999981929972442\nnumgbE89Beta = -0.00000808884040434622\nnumgbE89P = 82.9213694651314\nnumgbE89Q = -1000040.08814668\n\n'Check durch CoordinateSystemChecker ob Punkt in GaussBoaga6 oder GaussBoaga7\n'CoordinateSystemChecker funktioniert nur mit Rects, also mach ich kleines Rect\ntheRect = Rect.Make(thePoint_GB, 10@10)\nstrCoordSys = av.Run(\"GB2UTM.Script.CoordinateSystemChecker\", { theRect })\nif (strCoordSys = \"GaussBoaga_6\") then\n  'Punkt ist GB6, ich addiere also di
e Millionen\n  numX_GB = thePoint_GB.GetX + 1000000\n  numY_GB = thePoint_GB.GetY + 5000000\nelse\n  'Punkt ist bereits GB7\n  numX_GB = thePoint_GB.GetX\n  numY_GB = thePoint_GB.GetY\nend\n\nnumX_UTM_WGS84_ETRS89 = numgbE89Q + (numX_GB * numgbE89Alfa) - (numY_GB * numgbE89Beta)\nnumY_UTM_WGS84_ETRS89 = numgbE89P + (numY_GB * numgbE89Alfa) + (numX_GB * numgbE89Beta)\n\nthePoint_UTM_WGS84_ETRS89 = Point.Make(numX_UTM_WGS84_ETRS89, numY_UTM_WGS84_ETRS89)\n\n'MsgBox.Info(\"GaussBoaga Point: \"+numX_GB.AsString+\",\"+numY_GB.AsS
tring+NL+NL+\n'             \"UTM WGS84 ETRS89 \"+thePoint_UTM_WGS84_ETRS89.AsString,\"\")\n\n'Übergabe der Objekte an aufrufenden Routine\nreturn thePoint_UTM_WGS84_ETRS89\n"
)

(Script.17
	Name:	"GB2UTM.Script.CoordinateSystemChecker"
	SourceCode:	"'Name: GB2UTM.Script.CoordinateSystemChecker\n'\n'Titel: Checkt welches Koordinatensystem verwendet wird\n'\n'Beschreibung: Checkt aufgrund eines Extents welches Koordinatensystem verwendet wird:\n'              GaussBoaga 6-stellig, GaussBoaga 7-stellig oder UTM WGS84 ETRS89 \n'\n'Wird aufgerufen von: sämtlichen Scripts die das Koordinatensystem prüfen wollen\n'\n'Self: siehe unten\n'\n'Gibt zurück: strCoordSys\n'\n'Entstehungsgeschichte:\n'12.04.2005 Walter Gruber - Original\n\n'Auslesen der übergebenen Objekte\ntheRect =
 SELF.Get ( 0 ) 'Object, a Rect\n\n'\nlstCoordSysRects = av.Run(\"GB2UTM.Script.CoordinateSystemRects\", { })\ntheRectGB6 = lstCoordSysRects.Get(0)\ntheRectGB7 = lstCoordSysRects.Get(1)\ntheRectUTM_WGS84_ETRS89 = lstCoordSysRects.Get(2)\n\nif (theRectGB6.Contains(theRect)) then\n  strCoordSys = \"GaussBoaga_6\"\nelseif (theRectGB7.Contains(theRect)) then\n  strCoordSys = \"GaussBoaga_7\"\nelseif (theRectUTM_WGS84_ETRS89.Contains(theRect)) then\n  strCoordSys = \"UTM_WGS84_ETRS89\"\nelse\n  strCoordSys = \"Unknown\"\nend\n\n'Übergabe d
er Objekte an aufrufenden Routine\nreturn strCoordSys\n"
)

(Script.18
	Name:	"GB2UTM.Script.CoordinateSystemRects"
	SourceCode:	"'Name: GB2UTM.Script.CoordinateSystemRects\n'\n'Titel: Macht eine Liste mit Koordinatensystem-Rects\n'\n'Beschreibung: Erstellt Rects welche die Ausdehnung der jeweiligen Koordinatensysteme\n'              begrenzen und fügt diese dann einer Liste hinzu:\n'              GaussBoaga 6-stellig, GaussBoaga 7-stellig oder UTM WGS84 ETRS89 \n'\n'Wird aufgerufen von: GB2UTM.Script.CoordinateSystemChecker, GB2UTM.Script.ConvertViewAndGraphics\n'\n'Self: siehe unten\n'\n'Gibt zurück: lstCoordSysRects\n'\n'Entstehungsgeschichte:\n'
12.04.2005 Walter Gruber - Original\n\n'Auslesen der übergebenen Objekte\n'-\n\n'\nlstCoordSysRects = List.Make\n\n'Setzen der Standardwerte für GB6, GB7 und UTM WGS84 ETRS89\ntheDefaultValuesList = av.Run(\"GB2UTM.Script.SetDefaultVariables\", { })\n'\nnumGB6_XMin = theDefaultValuesList.Get(0)\nnumGB6_YMin = theDefaultValuesList.Get(1)\nnumGB6_XMax = theDefaultValuesList.Get(2)\nnumGB6_YMax = theDefaultValuesList.Get(3)\ntheRectGB6 = Rect.MakeXY(numGB6_XMin,numGB6_YMin, numGB6_XMax,numGB6_YMax)\nnumGB7_XMin = theDefaultValu
esList.Get(4)\nnumGB7_YMin = theDefaultValuesList.Get(5)\nnumGB7_XMax = theDefaultValuesList.Get(6)\nnumGB7_YMax = theDefaultValuesList.Get(7)\ntheRectGB7 = Rect.MakeXY(numGB7_XMin,numGB7_YMin, numGB7_XMax,numGB7_YMax)\nnumUTM_WGS84_ETRS89_XMin = theDefaultValuesList.Get(8)\nnumUTM_WGS84_ETRS89_YMin = theDefaultValuesList.Get(9)\nnumUTM_WGS84_ETRS89_XMax = theDefaultValuesList.Get(10)\nnumUTM_WGS84_ETRS89_YMax = theDefaultValuesList.Get(11)\ntheRectUTM_WGS84_ETRS89 = Rect.MakeXY(numUTM_WGS84_ETRS89_XMin,numUTM_WGS84
_ETRS89_YMin, numUTM_WGS84_ETRS89_XMax,numUTM_WGS84_ETRS89_YMax)\n\n'Hinzufügen der Rects zur Liste\nlstCoordSysRects.Add(theRectGB6)\nlstCoordSysRects.Add(theRectGB7)\nlstCoordSysRects.Add(theRectUTM_WGS84_ETRS89)\n\n'Übergabe der Objekte an aufrufenden Routine\nreturn lstCoordSysRects"
)

(Script.19
	Name:	"GB2UTM.Script.Help"
	SourceCode:	"'Name: GB2UTM.Script.Help\n'\n'Titel: Lädt die Online-Hilfe\n'\n'Beschreibung: Lädt das Online Hilfesystem\n'              \n'Wird aufgerufen von: View, Layout\n'\n'Self: siehe unten\n'\n'Gibt zurück: -\n'\n'Entstehungsgeschichte:\n'12.04.2005 Walter Gruber - Original\n\n'Warnhinweis wenn kein chm-File gefunden wurde, ansonsten starten des\n'Hilfesystems\n'\nbolFileExists = False\nif (File.Exists(\"$AVEXT/GB2UTM_Tools.chm\".AsFileName)) then\n  theFileName = \"$AVEXT/GB2UTM_Tools.chm\".AsFileName\n  bolFileExists = True\nend\nif (Fil
e.Exists(\"$USEREXT/GB2UTM_Tools.chm\".AsFileName)) then\n  theFileName = \"$USEREXT/GB2UTM_Tools.chm\".AsFileName\n  bolFileExists = True\nend\n'\nif (bolFileExists.Not) then\n  MsgBox.Warning(\"Help-File \"+\"GB2UTM_Tools.chm\".Quote+\" not found in\"+NL+\n                 \"%AVHOME%\\Ext32 or %USEREXT% !\"+NL+NL+\n                 \"Help system can't be started.\", \"Warning\")\nelse\n  'Starten des Hilfesystems (Script läuft weiter)\n  System.Execute(\"hh.exe\"++theFileName.GetFullName)\nend\n"
)

(Script.20
	Name:	"GB2UTM.Script.SetDefaultVariables"
	SourceCode:	"'Name: GB2UTM.Script.SetDefaultVariables\n'\n'Titel: Setzt Standardwerte\n'\n'Beschreibung: Script das zeilenweise aus einem INI-File liest und nach Auswertung eines\n'              Teils der Zeile (Trennungszeichen ist der Doppelpunkt) den Rest der Zeile\n'              einer Variable zuweist\n'\n'Wird aufgerufen von: \n'\n'Self: -\n'\n'Gibt zurück: -\n'\n'Entstehungsgeschichte:\n'12.04.2005 Walter Gruber - Original\n\ntheUSEREXTSysVar = System.GetEnvVar(\"USEREXT\")\ntheAVEXTSysVar = System.GetEnvVar(\"AVEXT\")\n'First search f
or the ini-File in the USEREXT-Directory\ntheDefaultValuesFN = (theUSEREXTSysVar+\"/GB2UTM_Tools.ini\").AsFileName\ntheDefaultValuesLF = LineFile.Make(theDefaultValuesFN, #FILE_PERM_READ)\nif (theDefaultValuesLF = nil) then\n  'If ini-File not found in USEREXT-Directory, search in AVEXT-Directory\n  theDefaultValuesFN = (theAVEXTSysVar+\"/GB2UTM_Tools.ini\").AsFileName\n  theDefaultValuesLF = LineFile.Make(theDefaultValuesFN, #FILE_PERM_READ)\nend\n\n'SetNumberFormat damit GB7- u. UTM WGS84 ETRS89-Koordinaten nicht in w
issenschaftlicher\n'Notatation (z.B. e+006) angezeigt werden\nScript.The.SetNumberFormat(\"d.ddd\")\n\n'Standards gemäss Judith und Walter damit gesamte Provinz Trient und\n'Bundesländer Österreichs Nord- und Osttirol abgedeckt sind\n'Es wird nur der Extent in GaussBoaga6 definiert, GaussBoaga7 und\n'UTM_WGS84_ETRS89 werden von GaussBoaga6 abgeleitet.\n'\n'GaussBoaga6\nnumGB6_XMin = 500000\nnumGB6_YMin = 10000\nnumGB6_XMax = 900000\nnumGB6_YMax = 350000\n'\n'Standard für WelcomeMessage\nbolShowMessage = True\n\nif (theDefaultV
aluesLF <> Nil) then\n  theDefaultValuesLINE = theDefaultValuesLF.ReadElt\n  while (theDefaultValuesLINE <> nil)\n    theString = theDefaultValuesLINE.AsString\n    if (theString.Contains(\"[ThemeMaxExtent_GaussBoaga6]\")) then\n      for each numIndex in 1..4\n        theDefaultValuesLINE = theDefaultValuesLF.ReadElt\n        theString = theDefaultValuesLINE.AsString\n        theStringLength = theString.Count\n        PeriodIndex = theString.Indexof(\":\")\n        strLeftOfPeriod = theString.Left(PeriodIndex)\n        s
trRightOfPeriod = (theString.Middle((PeriodIndex+1),(theStringLength-PeriodIndex))).Trim\n        '\n        if (numIndex = 1) then numGB6_XMin = strRightOfPeriod.AsNumber\n        end\n        if (numIndex = 2) then numGB6_YMin = strRightOfPeriod.AsNumber\n        end\n        if (numIndex = 3) then numGB6_XMax = strRightOfPeriod.AsNumber\n        end\n        if (numIndex = 4) then numGB6_YMax = strRightOfPeriod.AsNumber\n        end\n      end\n    elseif (theString.Contains(\"[WelcomeMessage]\")) then\n      theDefau
ltValuesLINE = theDefaultValuesLF.ReadElt\n      theString = theDefaultValuesLINE.AsString\n      theStringLength = theString.Count\n      PeriodIndex = theString.Indexof(\":\")\n      strLeftOfPeriod = theString.Left(PeriodIndex)\n      strRightOfPeriod = (theString.Middle((PeriodIndex+1),(theStringLength-PeriodIndex))).Trim\n      if (strRightOfPeriod.AsNumber = 0) then\n        bolShowMessage = False\n      else\n        bolShowMessage = True\n      end\n    end\n    theDefaultValuesLINE = theDefaultValuesLF.ReadElt\n 
 end\nend\n\n'Definieren der Maximalwerte die XMin,YMin, XMax, XMax für GaussBoaga6 annehmen können.\n'Dann bilden eines theRectGB6 und eines theRectGB6Max und vergleichen. Falls theRectGB6\n'nicht innerhalb theRectGB6Max liegt (also größer ist) dann Warning und setzen der XMin,\n'YMin, XMax, YMax auf Werte von theRectGB6Max\nnumGB6_XMin_Max = 210000\nnumGB6_YMin_Max = -340000\nnumGB6_XMax_Max = 1175000\nnumGB6_YMax_Max = 657000\n'\ntheRectGB6Max = Rect.MakeXY(numGB6_XMin_Max, numGB6_YMin_Max, numGB6_XMax_Max, numGB6_Y
Max_Max)\ntheRectGB6 = Rect.MakeXY(numGB6_XMin, numGB6_YMin, numGB6_XMax, numGB6_YMax)\n'\nif (theRectGB6Max.Contains(theRectGB6).Not) then\n  MsgBox.Warning(\"Values in file \"+\"GB2UTM_Tools.ini\".Quote+\" are out ouf bounds!\"+NL+NL+\n                 \"Defaulting to following values:\"+NL+\n                 \"XMin:\"++numGB6_XMin_Max.AsString+\", YMin:\"++numGB6_YMin_Max.AsString+NL+\n                 \"XMax:\"++numGB6_XMax_Max.AsString+\", YMax:\"++numGB6_YMax_Max.AsString,               \n                 \"Warning\")\n  '\n  nu
mGB6_XMin = numGB6_XMin_Max\n  numGB6_YMin = numGB6_YMin_Max\n  numGB6_XMax = numGB6_XMax_Max\n  numGB6_YMax = numGB6_YMax_Max\nend\n\n'GaussBoaga7\nnumGB7_XMin = numGB6_XMin + 1000000\nnumGB7_YMin = numGB6_YMin + 5000000\nnumGB7_XMax = numGB6_XMax + 1000000\nnumGB7_YMax = numGB6_YMax + 5000000\n'UTM WGS84 ETRS89\nnumUTM_WGS84_ETRS89_XMin = numGB6_XMin\nnumUTM_WGS84_ETRS89_YMin = numGB7_YMin\nnumUTM_WGS84_ETRS89_XMax = numGB6_XMax\nnumUTM_WGS84_ETRS89_YMax = numGB7_YMax\n\ntheDefaultValuesList = List.Make\ntheDefaultValuesLi
st.Add(numGB6_XMin) '0\ntheDefaultValuesList.Add(numGB6_YMin) '1\ntheDefaultValuesList.Add(numGB6_XMax) '2\ntheDefaultValuesList.Add(numGB6_YMax) '3\ntheDefaultValuesList.Add(numGB7_XMin) '4\ntheDefaultValuesList.Add(numGB7_YMin) '5\ntheDefaultValuesList.Add(numGB7_XMax) '6\ntheDefaultValuesList.Add(numGB7_YMax) '7\ntheDefaultValuesList.Add(numUTM_WGS84_ETRS89_XMin) '8\ntheDefaultValuesList.Add(numUTM_WGS84_ETRS89_YMin) '9\ntheDefaultValuesList.Add(numUTM_WGS84_ETRS89_XMax) '10\ntheDefaultValuesList.Add(numUTM_WGS84_E
TRS89_YMax) '11\n'\ntheDefaultValuesList.Add(bolShowMessage) '12\n\n'MsgBox.Info(numGB6_XMin.AsString++numGB6_YMin.Asstring++numGB6_XMax.asstring++numGB6_YMax.asstring,\"\")\n'MsgBox.Info(numGB7_XMin.asstring++numGB7_YMin.asstring++numGB7_XMax.asstring++numGB7_YMax.asstring,\"\")\n'MsgBox.Info(numUTM_WGS84_ETRS89_XMin.asstring++numUTM_WGS84_ETRS89_YMin.asstring++numUTM_WGS84_ETRS89_XMax.asstring++numUTM_WGS84_ETRS89_YMax.asstring,\"\")\n\nreturn theDefaultValuesList\n"
)

(Script.21
	Name:	"GB2UTM.UninstallScript"
	SourceCode:	"'The self object for this script is the extension\n'Check if there's an active project\n'\nif (av.getProject = nil) then\n  return nil\nend\n\n'No need to unistall if project is closing\n'\nif (av.GetProject.IsClosing) then\n  return nil\nend\n\n'Remove menu choices in all View Documents, including Custom View Documents\n'\nlstViewDocs = av.GetProject.FindGUIsFor(View)\n'\nfor each theViewDoc in lstViewDocs\n  theViewMenuBar = theViewDoc.GetMenuBar\n  theViewMenu = theViewMenuBar.FindByLabel(\"View\")\n  '\n  'Remove the Choices 
in \"View\" menu on the View Menu Bar\n  if (theViewMenu <> nil) then\n    theViewMenu.Remove(self.Get(0))\n    theViewMenu.Remove(self.Get(1))\n    theViewMenu.Remove(self.Get(2))\n    theViewMenu.Remove(self.Get(3))\n  end\nend\n\n'Remove menu choices in all Layout Documents, including Custom Layout Documents\n'\nlstLayoutDocs = av.GetProject.FindGUIsFor(Layout)\n'\nfor each theLayoutDoc in lstLayoutDocs\n  theLayoutMenuBar = theLayoutDoc.GetMenuBar\n  theLayoutMenu = theLayoutMenuBar.FindByLabel(\"Layout\")\n  '\n  'Remove t
he Choices in \"Layout\" menu on the Layout Menu Bar\n  if (theLayoutMenu <> nil) then\n    theLayoutMenu.Remove(self.Get(4))\n    theLayoutMenu.Remove(self.Get(5))\n    theLayoutMenu.Remove(self.Get(6))\n    theLayoutMenu.Remove(self.Get(7))\n  end\nend\n"
)

(Script.22
	Name:	"GB2UTM.View.CheckThemes"
	SourceCode:	"'Name: GB2UTM.View.CheckThemes\n'\n'Titel: Checkt Themes der aktiven View\n'\n'Beschreibung: Checkt alle Themen der aktiven View und gibt Liste aus\n'              ob Themen in GB6, GB7 und somit zu konvertieren sind\n'              oder ob Themen bereits in UTM WGS84 ETRS89.\n'\n'Wird aufgerufen von: Menu in ViewDocument - View - Check Themes\n'\n'Self: -\n'\n'Gibt zurück: -\n'\n'Entstehungsgeschichte:\n'12.04.2005 Walter Gruber - Original\n\nif (av.GetActiveDoc.Is(View)) then\n  theView = av.GetActiveDoc\nelse\n  MsgBox.Warn
ing(\"This scripts works only with View Documents!\"+NL+NL+\"Exiting...\",\"Warning\")\n  exit\nend\n\n'Wenn View keine Themen enthält dann Ausstieg ohne Info\nif (theView.GetThemes.Count = 0) then\n  exit\nend\n\nlstSummary = av.Run(\"GB2UTM.Script.CheckThemes\", { True, False, theView, \"View\" })"
)

(Script.23
	Name:	"GB2UTM.View.ConvertView"
	SourceCode:	"'Name: GB2UTM.View.ConvertView\n'\n'Titel: Konvertiert eine View\n'\n'Beschreibung: Konvertiert den Extent einer View GaussBoaga 6-stellig\n'              bzw. GaussBoaga 7-stellig nach UTM WGS84 ETRS89.\n'              Auch sämtliche grafischen Objekte werden konvertiert.\n'\n'Wird aufgerufen von: \n'\n'Self: -\n'\n'Gibt zurück: -\n'\n'Entstehungsgeschichte:\n'12.04.2005 Walter Gruber - Original\n\nif (av.GetActiveDoc.Is(View)) then\n  theView = av.GetActiveDoc\nelse\n  MsgBox.Warning(\"This scripts works only with View Docume
nts!\"+NL+NL+\"Exiting...\",\"Warning\")\n  exit\nend\n\n'Wenn View keine Themen enthält dann Ausstieg ohne Info\nif (theView.GetThemes.Count = 0) then\n  exit\nend\n\n'Wenn View Themen enthält die in GB6 oder GB7 sind dann Info und Ausstieg\n'Wenn View Themen mit unbekannten Koordinatensystem enthält dann Info und Ausstieg\n'Wenn alle Themen einer View in UTM WGS84 ETRS89 dann weiter ohne Info\nlstSummary = av.Run(\"GB2UTM.Script.CheckThemes\", { False, True, theView, \"View\" })\nnumGB6_Counter = lstSummary.Get(0)\nnumGB7_Count
er = lstSummary.Get(1)\nnumUTM_WGS84_ETRS89_Counter = lstSummary.Get(2)\nnumUnknown_Counter = lstSummary.Get(3)\nbolExit = False\nif ((numGB6_Counter > 0) or (numGB7_Counter > 0)) then\n  MsgBox.Warning(\"View has Themes that are in Gauss Boaga 6 or Gauss Boaga 7!\"+NL+NL+\n                 \"Please use \"+\"GB2UTM - Check Themes\".Quote+\" to get a report of all\"+NL+\n                 \"that Themes and convert them to UTM WGS84 ETRS89 before running this Tool.\",\n                 \"Warning\")\n  bolExit = True\nend\nif (numUnk
nown_Counter > 0) then\n  if (bolExit) then\n    'Wenn auch GB6- oder GB7-Themen in View dann eine Art von Info\n    MsgBox.Warning(\"View has also Themes with Unknown Coordinate System!\"+NL+NL+\n                   \"Please use \"+\"GB2UTM - Check Themes\".Quote+\" to get a report of all\"+NL+\n                   \"that Themes and modify the XMin,YMin-XMax,YMax values in the ini-File \"+\n                   \"GB2UTM_Tools.ini\".Quote+\" as described in the manual.\",\n                   \"Warning\")\n  else\n    'Wenn ausschließli
ch Themen mit unbekanntem Koordinatensystem dann andere Art von Info\n    MsgBox.Warning(\"View has Themes with Unknown Coordinate System!\"+NL+\n                   \"Please use \"+\"GB2UTM - Check Themes\".Quote+\" to get a report of all\"+NL+\n                   \"that Themes and modify the XMin,YMin-XMax,YMax values in the ini-File \"+\n                   \"GB2UTM_Tools.ini\".Quote+\" as described in the manual before running this Tool.\",\n                   \"Warning\")\n  end\n  bolExit = True\nend\nif (bolExit) then\n  exit\ne
nd\n\n'Wenn View Extent und Graphics bereits in UTM WGS84 ETRS89 dann Info und Ausstieg\n'Graphics\nif (theView.GetGraphics.Count > 0) then\n  theRect = theView.GetGraphics.ReturnExtent\n  strGraphicsCoordSys = av.Run(\"GB2UTM.Script.CoordinateSystemChecker\", { theRect })\nelse\n  strGraphicsCoordSys = \"UTM_WGS84_ETRS89\"\nend\n'View Extent\ntheRect = theView.GetDisplay.ReturnVisExtent\nstrViewCoordSys = av.Run(\"GB2UTM.Script.CoordinateSystemChecker\", { theRect })\n'\nif ((strGraphicsCoordSys = \"UTM_WGS84_ETRS89\") and (str
ViewCoordSys = \"UTM_WGS84_ETRS89\")) then\n  MsgBox.Info(\"View Extent and Graphics are already in UTM WGS84 ETRS89!\"+NL+NL+\n              \"Exiting...\",\"Information\")\n  exit\nend\n'\n'Wenn View Extent mit unbekannten Koordinatensystem dann Info und Ausstieg\nif (strViewCoordSys = \"Unknown\") then\n  MsgBox.Warning(\"Coordinate system of current View Extent is unknown!\"+NL+NL+\n                 \"Please modify the XMin,YMin-XMax,YMax values in the ini-File \"+\n                 \"GB2UTM_Tools.ini\".Quote+\" as described in t
he manual and run \"+\n                 \"again this Tool.\",\"Warning\")\n  exit\nend\n\n'Are you sure?\n'Die Frage wird je nachdem, ob die View Graphics beinhaltet oder nicht, anders formuliert\nif (theView.GetGraphics.Count > 0) then\n  if (MsgBox.YesNo(\"Do you really want to convert current View Extent\"+NL+\n                   \"and all Graphics to UTM WGS84 ETRS89?\",\"Confirm\",true).Not) then\n    exit\n  end\nelseif (MsgBox.YesNo(\"Do you really want to convert current View Extent\"+NL+\n                     \"to UTM WGS84 
ETRS89?\",\"Confirm\",true).Not) then\n  exit\nend  \n\n'Konversion der View und Graphics\ntheView = av.Run(\"GB2UTM.Script.ConvertViewAndGraphics\", { theView, \"View\" })"
)

