Skip to content

LabelTextUtil

Canonical path: Utils.LabelTextUtil.LabelTextUtil

Implementation of the utility for the label text creation

Methods:

__init__

__init__()

initialize

add_attribute

add_attribute(doc: DocumentAdapter, attribute_id: int, value: Any = '')

add an attribute to the label text

Parameters:

  • doc (DocumentAdapter) –

    document of the Allplan drawing files

  • attribute_id (int) –

    attribute ID

  • value (Any, default: '' ) –

    value

add_parameter

add_parameter(
    build_ele: BuildingElement | list[BuildingElement],
    parameter_name: str,
    parameter_value: Any | None = None,
)

add a parameter to the label text

Parameters:

  • build_ele (BuildingElement | list[BuildingElement]) –

    building element with the parameter properties

  • parameter_name (str) –

    parameter name

  • parameter_value (Any | None, default: None ) –

    parameter value, use from parameter_name if None

add_parameter_name

add_parameter_name(parameter_name: str, value: Any)

add a parameter name and value to the label text

Parameters:

  • parameter_name (str) –

    parameter name

  • value (Any) –

    value

create_label_default_text

create_label_default_text() -> str

create the text

Returns:

  • str

    default label text

create_label_text

create_label_text() -> str

create the label text

Returns:

  • str

    label text

set_dimension_unit

set_dimension_unit(dimension_unit: LabelTextDimensionUnit)

set the dimension

Parameters:

set_dimension_unit_by_value_type

set_dimension_unit_by_value_type(value_type: ValueType)

set the dimension unit by the value type

Parameters:

  • value_type (ValueType) –

    Value type

set_format

set_format(text_format: LabelTextFormat, digits: int, decimals: int = 0)

set the format of the label text

Parameters:

  • text_format (LabelTextFormat) –

    text format

  • digits (int) –

    digits

  • decimals (int, default: 0 ) –

    decimals

set_format_by_value_type

set_format_by_value_type(value_type: ValueType)

set the format by the value type

Parameters:

  • value_type (ValueType) –

    Value type

set_pre_text

set_pre_text(pre_text: str)

set the pre text

Parameters:

  • pre_text (str) –

    prefix text

set_text_frame

set_text_frame(text_frame: LabelTextFrame)

set the text frame of the label

Parameters: