Go to documentation repository
The GetObjectIdByParam method allows you to get the ID of an object, some parameter of which is equal to the specified value. If there are several such objects, the ID of the first found object is returned. If no such objects are found, 0 is returned.
Syntax for method invocation:
function GetObjectIdByParam (obj_type : String, obj_param : String, param_value : String)
Method arguments:
Example. Find cameras with a black-and-white video image and set the Color parameter to 1 for them.
if (Event.SourceType == "MACRO" && Event.SourceId== "1" && Event.Action == "RUN") { var id = GetObjectIdByParam("CAM","color","0"); //get the first object ID while (id){ //while exist the Camera objects from which black-and-white image is received SetObjectParam ("CAM", id, "color", "1"); //change the Color parameter for found object id = GetObjectIdByParam("CAM","color","0"); //get the next object ID } }