Skip to main content

GetProperty

Returns a property of the CDocBuilderValue object.

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

Syntax

def GetProperty(self, name: str) -> CDocBuilderValue

Parameters

NameTypeDescription
namestrThe name of the CDocBuilderValue object property.

Example

builder = docbuilder.CDocBuilder()
context = builder.GetContext()
globalObj = context.GetGlobal()
api = globalObj["Api"]
document = api.Call("GetDocument")
docPr = document.GetProperty("color")

Alternative ways to get a property

There are two more ways to get a property of the CDocBuilderValue object:

1. Using the Get method

def Get(self, name: str) -> CDocBuilderValue

Example

builder = docbuilder.CDocBuilder()
context = builder.GetContext()
globalObj = context.GetGlobal()
api = globalObj["Api"]
document = api.Call("GetDocument")
docPr = document.Get("color")

2. Using the index operator

value["property_name"]

Example

builder = docbuilder.CDocBuilder()
context = builder.GetContext()
globalObj = context.GetGlobal()
api = globalObj["Api"]
document = api.Call("GetDocument")
docPr = document["color"]