Sample RTML Generator for VBScript (NOT FOR C# OR VB.NET!)

' =======================================
' THIS SAMPLE IS FOR VISUAL BASIC SCRIPT!
' =======================================
'
Dim RTML, REQ, TGT, PIC, COR, FSO, FIL                      ' (for PrimalScript IntelliSense)

Set RTML = CreateObject("DC3.RTML23.RTML")
Set RTML.Contact = CreateObject("DC3.RTML23.Contact")
RTML.Contact.User = "Ray Jay Poteet"
RTML.Contact.Email = "rayjay@deliverance.com"
'
' An RTML Request (child of RTML document)
'
Set REQ =  CreateObject("DC3.RTML23.Request")
REQ.UserName = "Bob Denny"                                  ' SPECIFY THIS FIRST!
REQ.Project = "Sample Project"                              ' Proj for above user will be created if needed
REQ.ID = "Test Plan"                                        ' This becomes the Plan name for each Request
'
' In RTML, a Correction (child of Request) applies to -all- Pictures
' in the REQUEST!!. 
'
' zero      Bias subtract
' dark      Dark subtract
' flat      Flat-field correction
'
Set REQ.Correction = CreateObject("DC3.RTML23.Correction")
REQ.Correction.zero = True
REQ.Correction.flat = True
REQ.Correction.dark = True
'
' Now add this Request to the RTML document. You can add as many
' Requests to the RTML as you want. NOTE USE OF COM ACCESSOR.
'
RTML.RequestsC.Add REQ
'
' An RTML Target (child of Request)
'
Set TGT = CreateObject("DC3.RTML23.Target")
'
' You can specify coordinates, orbital elements (comet or 
' minor planet) or a major planet name (except Earth and Moon).
' The following will be up at 09-Jun-2004 2200 UTC
'
' Choose one of the following:
'
' Coordinates (child of Target):
Set TGT.TargetType.Coordinates = CreateObject("DC3.RTML23.Coordinates")
TGT.TargetType.Coordinates.RightAscension = 15 * 8.123      ' RA in DEGREES for RTML!
TGT.TargetType.Coordinates.Declination = +24.321
TGT.Name = "Test-1"                                         ' Required
'
' Elements (MPC 1-line MP or Comet):
''TGT.TargetType.OrbitalElements = "00010    5.43  0.15 K047E 273.78747  313.55726  283.64568    3.84229  0.1192435  0.17735951   3.1373748  0 MPC 35055  2261 104 1849-1999 0.53 M-v 38h Goffin     0000    (10) Hygiea              19990306"
''TGT.Name = "(00010) Hygiea"
'
' Major Planet (Except Earth and Moon)
''TGT.TargetType.Planet = "Mars"
''TGT.Name = TGT.Planet
'
'
' Targets can specify a repeat count and interval.
'
''TGT.count = 3
''TGT.Interval=0.5  ' HOURS!!!
'
' Now add this Target to the Request. You can repeat the above, 
' creating additional Targets, and add them to the Request.
' NOTE USE OF COM ACCESSOR.
'
REQ.TargetsC.Add TGT
'
' An RTML Picture (child of Target) You may set the count property to acquire
' multiple images within this Picture, and you may set the autostack property
' to True to cause the repeated images to be automatically aligned and stacked.
'
Set PIC = CreateObject("DC3.RTML23.Picture")
PIC.Name = "Test-1 Clear"                               ' Required
PIC.ExposureSpec.ExposureTime = 120
PIC.Binning = 2
PIC.Filter = "Clear"
'
' Now add this Picture to the Target. You can repeat the above,
' creating additional Pictures, and add them to the Target.
' NOTE USE OF COM ACCESSOR.
'
TGT.PicturesC.Add PIC
'
' OK, we have the RTML built. Extract the XML into a String
' formatted with line endings.
'   
XML = RTML.XML(True)
'
' File it out.
'
Set FSO = CreateObject("Scripting.FileSystemObject")
Set FIL = FSO.CreateTextFile("C:\Temp\TestRTML.xml")    ' **CHANGE FOR YOUR SYSTEM**
FIL.Write XML                                           ' Has embedded line endings
FIL.Close
'
' That's it!
'