Skip to content

Visual Script Service

Class full path: VisualScriptService.VisualScriptService

implementation of the VisualScript service

Functions

__init__(coord_input, script_path, global_str_table_service, build_ele_list, control_props_list, default_values)

Initialize the script

Parameters:

Name Type Description Default
coord_input CoordinateInput

coordinate input

required
script_path str

script path

required
global_str_table_service StringTableService

global string table service

required
build_ele_list List[BuildingElement]

building element list

required
control_props_list List[BuildingElementControlProperties]

control properties list

required
default_values List[DefaultValue]

default values

required

close_all()

close the VS script

create_pythonpart(placement_matrix, local_placement_matrix)

create the PythonPart

Parameters:

Name Type Description Default
placement_matrix Matrix3D

placement matrix of the PythonPart (model placement)

required
local_placement_matrix Matrix3D

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

required

Returns:

Type Description
List[Any]

created PythonPart elements

execute_load_favorite(file_name)

load the favorite data

execute_save_favorite(file_name)

save the favorite data

get_preview_elements()

get the preview elements created by the script

Returns:

Type Description
List[Any]

preview elements of the script

modify_element_property(page, name, value)

Modify property of element

Parameters:

Name Type Description Default
page int

the page of the property

required
name str

the name of the property.

required
value Any

new value for property.

required

on_cancel_function()

Check for input function cancel in case of ESC

Returns:

Type Description
bool

True/False for success.

on_control_event(event_id)

Handles on control event

Parameters:

Name Type Description Default
event_id int

event id of control.

required