getObject()

Searches for an object by name
getObject(name:string)

Parameters

Name Type Действие Значение по умолчанию
name string he name of the object to find

Description

Used in the method onUpdate. If the object is not found it returns null.

Example

// We search for a graphical object named GraphName
let objectName = "MyArrowObject",
    object = this.getObject(objectName);
// If the object is not found, then create it
if (!object) {
     object = this.createObject(GObject.Type.Arrow, objectName)
                  .setArrowCode(ArrowSymbols.Bullet)
                  .setColor(Color.Red);
}