Skip to main content

GetProperty

Returns a property of the CDocBuilderValue object.

note

This method is not available for JS.

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.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.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.GetDocument()
docPr = document["color"]