Skip to content

VisualScriptService

Canonical path: VisualScriptService.VisualScriptService

implementation of the VisualScript service

__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:

Raises:

  • ValueError

    raised in case of wrong script

close_all

close_all()

close the VS script

create_pythonpart

create_pythonpart(
    placement_matrix: Matrix3D, local_placement_matrix: Matrix3D
) -> list[Any]

create the PythonPart

Parameters:

  • placement_matrix (Matrix3D) –

    placement matrix of the PythonPart (model placement)

  • local_placement_matrix (Matrix3D) –

    local placement matrix of the PythonPart, used for the local geometry transformation

Returns:

  • list[Any]

    created PythonPart elements

execute_load_favorite

execute_load_favorite(file_name: str)

load the favorite data

Parameters:

  • file_name (str) –

    file name

execute_save_favorite

execute_save_favorite(file_name: str)

save the favorite data

Parameters:

  • file_name (str) –

    file name

get_preview_elements

get_preview_elements() -> list[Any]

get the preview elements created by the script

Returns:

  • list[Any]

    preview elements of the script

modify_element_property

modify_element_property(page: int, name: str, value: Any)

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

on_cancel_function() -> bool

Check for input function cancel in case of ESC

Returns:

  • bool

    True/False for success.

on_control_event

on_control_event(event_id: int)

Handles on control event

Parameters:

  • event_id (int) –

    event id of the clicked button control

reset_param_values

reset_param_values()

reset the parameter values

Placeholder