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