Create a preview¶
In a standard PythonPart it’s possible to create geometry objects that are only previewed. These objects must be inserted in a Python list and added to the preview_elements property of the CreateElementResult object like
def create_element(build_ele: BuildingElement,
doc : AllplanElementAdapter.DocumentAdapter) -> CreateElementResult:
"""
Creation of element
Args:
build_ele: the building element.
doc: input document
Returns:
Object with the result data of the element creation
"""
return CreateElementResult(..., preview_elements = preview_objects, ...)
The preview objects are only drawn during the creation of the PythonPart and can be used to analyze problems during the creation.
In addition to the preview elements, Preview symbols can also be drawn.