
which then points to the beginning of the word DEFINE in line 555



Imports MediaCy.Addins.SCalibration Imports MediaCy.Addins.SCalibration.Commands
Public Function NewMacro() As SimpleScript
NewMacro = New SimpleScript
Dim var1 = "Ricetec-Pollen-Neubauer-Grid", spcal1
Dim var2 = "OCVR WETTING 01", spcal2
Dim var3 = "OCVR WETTING 01(2)", spcal3, doc1
With Measure.Calibration.SpatialCommands.Define(NewMacro)
.Run(var1, spcal1)
End With
With Measure.Calibration.SpatialCommands.SetActive(NewMacro)
.Comment = "Ricetec-Pollen-Neubauer-Grid: 2.278 x 2.278 µm"
.FilterInput = True
.Run(spcal1)
End With
With Application.Gadgets.SpatialCalibration(NewMacro)
.CheckState = MediaCy.IQL.Application.McCommand.mcCheckState.Checked
.Run()
End With
With Measure.Calibration.SpatialCommands.Define(NewMacro)
.Run(var2, spcal2)
End With
With Measure.Calibration.SpatialCommands.Define(NewMacro)
.Run(var3, spcal3)
End With
With Measure.Calibration.SpatialCommands.Modify(NewMacro)
.Name = "OCVR WETTING 01(2)"
.Run(spcal3)
End With
With Measure.Calibration.SpatialCommands.SetActive(NewMacro)
.Comment = "OCVR WETTING 01(2): 0.005 x 0.005 in"
.FilterInput = True
.Run(spcal3)
End With
With Measure.Calibration.SpatialCommands.Modify(NewMacro)
.Name = "OCVR WETTING 01(2)"
.Run(spcal3)
End With
With Application.DocumentCommands.Active(NewMacro)
.Run(doc1)
End With
With Measure.Calibration.SpatialCommands.Apply(NewMacro)
.Comment = "OCVR WETTING 01(2): 0.005 x 0.005 in"
.Run(doc1, spcal3)
End With
With Application.Gadgets.SpatialCalibration(NewMacro)
.CheckState = MediaCy.IQL.Application.McCommand.mcCheckState.Unchecked
.Run()
End With
End Function

Public Sub ApplySelectedSpatialCalibrationFunction ()
'Declare local variables
Dim var1 = comboBox_SpatialCalibration.SelectedItem, spcal1
Debug.Print comboBox_SpatialCalibration.SelectedItem
'Connect with the appropriate spatial calibration
With Measure.Calibration.SpatialCommands.Define(Nothing)
.Run(var1, spcal1)
End With
'Activate the appropriate spatial calibration
With Measure.Calibration.SpatialCommands.SetActive(Nothing)
.FilterInput = True
.Run(spcal1)
End With
'Set the active calibration To be the SYSTEM CALIBRATION
With Measure.Calibration.SpatialCommands.SetSystem(Nothing)
.Run(spcal1)
End With
'If there are any images open
If ( ThisApplication.Documents.Values.Count > 0 ) _
Then
'Apply the ACTIVE CALIBRATION to the ACTIVE IMAGE
With Measure.Calibration.SpatialCommands.Apply(Nothing)
.Run(ThisApplication.ActiveDocument, spcal1)
End With
End If
End Sub