Documentation for Intellect 4.9.8. Documentation for other versions of Intellect is available too.

Skip to end of metadata
Go to start of metadata

The SetObjectParam method sets the values of object parameters.

Method call syntax

function  SetObjectParam(objtype: String,  id: String,  param : String, value : String)

Method arguments:

  1. objtype - required argument. The type of the object whose parameters are to be set. It takes the following values:  Type – String, range – existing object types.
  2. id - required argument. Identification number of the object of the type set in the objtype parameter. It takes the following values:  Type – String, range – existing object identification numbers of the specified type.
  3. param - required argument. The parameter of the object. It takes the following values:  Type – String, range – available parameters of the object.
  4. value - required argument. The value to be set for the parameter specified in the param argument. It takes the following values:  Type – String, range – depends on the parameter.

Usage examples

Example. When Macro 1 starts, check if Cameras 1 to 4 are set to broadcast color video. If a camera is set for black-and-white video broadcast, then switch it to the color mode (setting the true (“1”) value to the “Color” parameter – (“color”)).

if (Event.SourceType == "MACRO" && Event.SourceId == "1"  && Event.Action == "RUN")
{
  var i;
  for(i=1; i<=4; i=i+1)
  {
    if (GetObjectParam("CAM", i , "color") == "0")
    {
      SetObjectParam("CAM", i, "color", "1");
    }
  }
}


Note

If the object is active when the script is started (i.e. the setting panel of this object is open), then object parameters can not be changed by the SetObjectParam method. For instance, if the setting panel for the Camera 1 object is open and the aforecited script is started, the operation mode of Camera 1 will not be changed for the color one.