API example: Showing thicknesses within a range

You can use any standard function to interact with the user, such as VBScript's InputBox() function. This example displays the Thickness diagnostic with thicknesses between two user-specified values.

This script can be run as either a command or a macro. If parameters were not supplied on the command line when the script was run, you will be prompted to input parameters. The bold section below implements the user input prompts after checking for two command line argument values.

'@
'@ DESCRIPTION
'@ 
'@
'@ SYNTAX
'@ ShowThicknessInRange [Min] [Max]
'@
'@ PARAMETERS
'@ Min   Minimum Thickness value
'@ Max   Maximum Thickness value
'@
'@ DEPENDENCIES/LIMITATIONS
'@ none
'@
'@ History
'@ Created DRA 9/8/2006
'@@ 
Option Explicit
SetLocale("en-us")
Dim Synergy
Set Synergy = CreateObject("synergy.Synergy")
Synergy.SetUnits "METRIC"

Dim DiagnosisManager
Dim MinimumThickness, MaximumThickness
Dim Args

Set Args = Wscript.Arguments
If Args.Count <> 2 Then
        MinimumThickness = InputBox("Enter Minimum Thickness")
        MaximumThickness = InputBox("Enter Maximum Thickness")
Else
        MinimumThickness = Args(0)
        MaximumThickness = Args(1)
End If

Set DiagnosisManager = Synergy.DiagnosisManager()
DiagnosisManager.ShowThickness MinimumThickness, MaximumThickness, False

MsgBox "Script Complete"
WScript.Quit