General¶
A standard PythonPart is used when the workflow in the xxx.py file can be managed entirely via the input in the property palette. No additional user input such as object selection, point input, … are possible in a standard PythonPart.
The source code for the PythonPart is located in the py file and must contain at least the following two functions:
check_allplan_version is called to check, whether the script is running with the current Allplan version
def check_allplan_version(_build_ele: BuildingElement,
_version: float) -> bool:
"""
Check the current Allplan version
Args:
_build_ele: the building element.
_version: the current Allplan version
Returns:
True/False if version is supported by this script
"""
# Support all versions
return True
create_element is called to execute the element creation
def create_element(_build_ele: BuildingElement,
_doc: AllplanElementAdapter.DocumentAdapter) -> CreateElementResult:
"""
Execute the element creation
Args:
build_ele: the building element.
doc: input document
Returns:
created element result
"""
...
return CreateElementResult(...)