GetObjectName
Syntax
GetObjectName(index: number, isStatic?: boolean, window?: number): stringParameters
Parameter
Type
Description
Return Value
Description
Example
// Get name of first object
const firstName = this.api.GetObjectName(0)
console.log(`First object name: ${firstName}`)
// Get name of first static object
const firstStaticName = this.api.GetObjectName(0, true)
console.log(`First static object name: ${firstStaticName}`)
// List all objects
const count = this.api.GetObjectCount()
for (let i = 0; i < count; i++) {
const name = this.api.GetObjectName(i)
const type = this.api.GetObjectType(name)
console.log(`Object ${i}: Name=${name}, Type=${type}`)
}
// List all static objects
const staticCount = this.api.GetObjectCount(true)
for (let i = 0; i < staticCount; i++) {
const name = this.api.GetObjectName(i, true)
const type = this.api.GetObjectType(name, true)
console.log(`Static object ${i}: Name=${name}, Type=${type}`)
}
// List objects from MainChart (window = 0)
const mainChartCount = this.api.GetObjectCount(false, 0)
for (let i = 0; i < mainChartCount; i++) {
const name = this.api.GetObjectName(i, false, 0)
console.log(`MainChart object ${i}: ${name}`)
}Last updated