LabelTextUtil
Canonical path: Utils.LabelTextUtil.LabelTextUtil
Implementation of the utility for the label text creation
Methods:
-
__init__
–initialize
-
add_attribute
–add an attribute to the label text
-
add_parameter
–add a parameter to the label text
-
add_parameter_name
–add a parameter name and value to the label text
-
create_label_default_text
–create the text
-
create_label_text
–create the label text
-
set_dimension_unit
–set the dimension
-
set_dimension_unit_by_value_type
–set the dimension unit by the value type
-
set_format
–set the format of the label text
-
set_format_by_value_type
–set the format by the value type
-
set_pre_text
–set the pre text
-
set_text_frame
–set the text frame of the label
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 a parameter name and value to the label text
Parameters:
-
parameter_name
(str
) –parameter name
-
value
(Any
) –value
create_label_default_text
create the text
Returns:
-
str
–default label text
set_dimension_unit
set_dimension_unit(dimension_unit: LabelTextDimensionUnit)
set_dimension_unit_by_value_type
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 the format by the value type
Parameters:
-
value_type
(ValueType
) –Value type
set_text_frame
set_text_frame(text_frame: LabelTextFrame)