Skip to main content

Get

Returns an array value by its index.

note

This method is not available for JS.

Syntax

def Get(self, key: int) -> CDocBuilderValue

Parameters

NameTypeDescription
keyintThe index of the array value.

Example

builder = docbuilder.CDocBuilder()
context = builder.GetContext()
globalObj = context.GetGlobal()
api = globalObj["Api"]
document = api.GetDocument()
charts = document.GetAllCharts()
chart = charts.Get(1)

Index operator

The operator[] postfix expression can also be used to get an array value by its index:

value[index]

Example

builder = docbuilder.CDocBuilder()
context = builder.GetContext()
globalObj = context.GetGlobal()
api = globalObj["Api"]
document = api.GetDocument()
charts = document.GetAllCharts()
chart = charts[1]