Skip to main content

Get

Returns an array value by its index.

Please note, that for the .docbuilder file the CDocBuilderValue.Get method is not used.

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.Call("GetDocument")
charts = document.Call("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.Call("GetDocument")
charts = document.Call("GetAllCharts")
chart = charts[1]