Skip to main content

SetProperty

Sets a property to the CDocBuilderValue object.

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

Syntax

def SetProperty(self, name: str, value: CDocBuilderValue) -> None

Parameters

NameTypeDescription
namestrThe name of the CDocBuilderValue object property.
valueCDocBuilderValueThe value of the CDocBuilderValue object property.

Example

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

Alternative ways to set a property

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

1. Using the Set method

def Set(self, name: str, value: CDocBuilderValue) -> None

2. Using the index operator

document["property_name"] = value