VisualScriptService
Canonical path: VisualScriptService.VisualScriptService
implementation of the VisualScript service
Methods:
-
__init__–Initialize the script
-
close_all–close the VS script
-
create_pythonpart–create the PythonPart
-
execute_load_favorite–load the favorite data
-
execute_save_favorite–save the favorite data
-
get_preview_elements–get the preview elements created by the script
-
modify_element_property–Modify property of element
-
on_cancel_function–Check for input function cancel in case of ESC
-
on_control_event–Handles on control event
-
reset_param_values–reset the parameter values
__init__
__init__(
coord_input: CoordinateInput,
script_path: str,
global_str_table_service: StringTableService,
build_ele_list: list[BuildingElement],
control_props_list: list[BuildingElementControlProperties],
default_values: list[DefaultValue],
)
Initialize the script
Parameters:
-
coord_input(CoordinateInput) –API object for the coordinate input, element selection, ... in the Allplan view
-
script_path(str) –script path
-
global_str_table_service(StringTableService) –global string table service
-
build_ele_list(list[BuildingElement]) –list with the building elements
-
control_props_list(list[BuildingElementControlProperties]) –control properties list
-
default_values(list[DefaultValue]) –default values
Raises:
-
ValueError–raised in case of wrong script
create_pythonpart
execute_load_favorite
load the favorite data
Parameters:
-
file_name(str) –file name
execute_save_favorite
save the favorite data
Parameters:
-
file_name(str) –file name
get_preview_elements
get the preview elements created by the script
Returns:
-
list[Any]–preview elements of the script
modify_element_property
Modify property of element
Parameters:
-
page(int) –page index of the modified property
-
name(str) –the name of the property.
-
value(Any) –new value for property.
on_cancel_function
Check for input function cancel in case of ESC
Returns:
-
bool–True/False for success.
on_control_event
Handles on control event
Parameters:
-
event_id(int) –event id of the clicked button control