Scripting Functional Attributes

The tables listed below contain descriptions of attributes that ODTK does not expose in the Object Properties window. The attributes are grouped by the scope under which they are defined. Each description provides both a functional prototype indicating the types of each input and output argument and a sample VBS or JavaScript code exercising each function. You can use these attributes to run and control various ODTK tasks.

See the section "Working with attributes" below for general insights on scripting attributes.

Attribute scope functions

Click the links below to see the table for a specific type of attribute scope function.

Each section of the example VBS or JavaScript code shown in the functional attributes tables was run in the Scripting Tool, which predefines "ODTK" as the personality and "sc" as the current scenario.

Working with attributes

Return types

Functions mainly return two types: CAgAttr or bool. The CAgAttr can either contain a string or an automation object, which means in VBScript it will have a return type of vbString(8) or vbObject(9). When functions return a bool, these are, in VBScript, of type vbBoolean(11). To check the return type for any function in VBScript, use the VarType function. For example:

Copy
MyCheck = VarType(result)
msgbox MyCheck

Assigning return values in VBScript

When the return type is vbBoolean or vbString, you can assign the result to a variable, such as in the following example, using DeleteObj.

Copy
result = ODTK.DeleteObj(ODTK.Scenario(0).Satellite(0))
Dim MyCheck

However, if the return type is a vbObject, you must use the set command to assign the result to a variable, as in the CreateObj example below.

Copy
Set scenObj = ODTK.CreateObj(ODTK, "Scenario", "Scen1") Set satObj1 = ODTK.CreateObj(scenObj, "Satellite", "Sat1")