Module tools

This module contains the tools that are available for specific tasks within the VIIA project.

Interactive modelling Tool

viiapackage.tools.interactive_modelling.viia_interactive_modelling.viia_start_interactive_modelling(project: ViiaProject, level: Union[Level, float, str], geometry_material_combinations: List[List[Union[int, float, str]]], layer: Union[Layer, str], grid_lines: Union[Grid, List[Union[Gridline, GridlineGroup, Grid]]] = None, shape_type: str = 'wall', top_level: Optional[Union[Level, float, str]] = None, reference_shapes: List[Union[Shapes, Layer]] = None, create_new_shapes: bool = True, show_pop_up: bool = False, prevent_grid_output: bool = False)[source]
Input:
  • project (obj): Project object containing collections and of fem objects and project variables.

  • level (obj): Level object that indicates the level of the new to model shapes. Alternatively the z_coordinate or name of an existing level can be given.

  • layer (obj): Layer object that indicates the layer of the new to model shapes.

  • grid_lines (obj): Grid associate objects near the area where new shapes will be modelled. The intersections of the gridlines will be available as clickable points. Default value is None. If None is provided, the first Grid of the project will be used.

  • geometry_material_combinations (list of lists of two inputs): List of the geometry and material combination that are used for the new shapes. First input of the inner list should be the geometry, Second input should be the material.

  • shape_type (str): The type of new shapes that can be created. Available are: ‘wall’, ‘floor’, ‘beam’, ‘column’.

  • top_level (obj): Level that indicates the top of the wall. Required only when shape_type is ‘wall’ or ‘column’, for other shape_type input the top_level is not used. Alternatively the -_coordinate or name of an existing level can be given.

  • reference_shapes (list of obj): Indicates which references shapes should be shown in the plot to help modelling. When no input is given the shapes from the layer below the layer of the new shapes will be used.

  • create_new_shapes (bool): Switch to indicate if the new shapes should be made directly.

  • show_pop_up (bool): Switch to show a pop-up when creating the shapes

  • prevent_grid_output (bool): If possible the output will be provided for the grid system. With this switch grid based output can be prevented. Default is False.

Output:
  • The lines to create the shapes in the model script will be printed in the python console.

  • New shapes will be created when create_new_shapes is set to through

  • Returned are a list of text lines with commands to create the new shapes, and the object references of the new shapes

MYVIIA Dashboard Tool

viiapackage.tools.myviia_dashboard.myviia_dashboard.myviia_dashboard()[source]

This function will initialise and create the MYVIIA dashboard tool in the browser.

Input:
  • No input required.

Output:
  • The dashboard is shown in the browser.

viiapackage.tools.myviia_dashboard.helper_functions.create_3d_plotly_fig(project: ViiaProject, obj_part: str, load_bearing: bool = False, calculate_volume: bool = False)[source]

Function to create the 3D plotly figure of the model with requested info.

Input:
  • project (obj): VIIA project object containing collections of fem objects and project variables.

  • obj_part (str): Name of the object-part in MYVIIA.

  • load_bearing (bool): Select to create the image for the load-bearing walls. Default value is False.

  • calculate_volume (bool): Select to create the image for the volume of the model. Default value is False.

Output:
  • Returns the 3D plotly Figure object.

viiapackage.tools.myviia_dashboard.helper_functions.create_overview(project: ViiaProject, container)[source]

Function to create an overview about the project in the sidebar.

Input:
  • project (obj): VIIA project object containing collections of fem objects and project variables.

  • container (obj): Streamlit sidebar container.

Output:
  • Overview is created in the sidebar.

viiapackage.tools.myviia_dashboard.helper_functions.determine_folder_name(signal_name: str) str[source]

Function determines the folder name based on the name of the signal.

Input:
  • signal_name (str): The name of the signal to evaluate.

Output:
  • Returns the corresponding folder name. Returns ‘A12’ if the signal name ends with ‘v001’, ‘A15’ if it ends with ‘vXXX’ with XXX>1, and ‘Unusual folder name’ otherwise.

viiapackage.tools.myviia_dashboard.helper_functions.first_non_zero_from_bottom_dict(data: list, keys: List[str]) dict[source]

Function to retrieve the first non-zero value from the bottom of a list of dictionaries for specified keys.

Input:
  • data (list): The list of dictionaries containing various attributes.

  • keys (list): The list of keys to check for non-zero values.

Output:
  • Returns s dictionary with the first non-zero values for each specified key.

viiapackage.tools.myviia_dashboard.helper_functions.get_max_from_specific_columns(df, columns: List[str]) dict[source]

Function to get the maximum value from specific columns in the DataFrame.

Input:
  • df (pd.DataFrame): The DataFrame from which to get the maximum values.

  • columns (list of str): A list of column names to get the maximum values from.

Output:
  • Returns dictionary with the maximum values for each specified column.

viiapackage.tools.myviia_dashboard.helper_functions.highlight_max(s) List[str][source]

Highlight the maximum value in a Pandas Series.

PInput:
  • s (pd.Series): The Pandas Series to evaluate.

Output:
  • Returns a list of strings representing the background color for each element in the Series. The maximum value (excluding the first element) will have a background color of yellow.

viiapackage.tools.myviia_dashboard.helper_functions.initialise(obj_nr: str, obj_part: str)[source]

Function initialise the session by adding info to the session state of streamlit for later use.

Input:
  • obj_nr (str): Name of the object.

  • obj_part (str): In case of multiple parts (separate TVA reports will be delivered), select the correct part for this analysis. On MYVIIA you can see which object parts are available. If the object is not split in separate parts, this input is not required.

Output:
  • The streamlit session state is initialised.

viiapackage.tools.myviia_dashboard.helper_functions.round_values(df)[source]

Function to round numerical values in the DataFrame to the first decimal place and remove any trailing zeros.

Input:
  • df (pd.DataFrame): The pandas DataFrame with numerical values to be rounded.

Output:
  • Returns the pandas DataFrame with rounded numerical values without trailing zeros.

NLKA Assessment Tool

viiapackage.tools.nlka_assessment.viia_nlka.viia_nlka_tool(project: ViiaProject)[source]

This function is developed for the NLKA assessment that is part of the VIIA project workflow. The assessment is performed in a seperate tool for which a graphical interface is provided. The tool should run in a python-editor (like PyCharm) and can’t be used in DIANA.

Note

The function requires the FPDF 3rd party module.

class viiapackage.tools.nlka_assessment.viia_nlka_element.NLKA_Element(project: ViiaProject, name: str, height: float, thickness: float, height_of_center_of_gravity: float, height_of_building: float, overburden_load: float, density: float, pga: float, frequency: float, e_top: int, e_bottom: int, angle: float, cantilever: bool = False, spectrum_data: Optional[Dict] = None, npr_version: str = 'NPR9998:2018', importance_factor: Optional[float] = 1.0)[source]

Bases: object

This is the class used for creating NLKA element and doing the assessment. This class includes functions to initiate the NLKA assessment, calculate the seismic demand and capacity, unity check, plot the results, etc.

amplification_factor()[source]

This is the function to calculate the amplification factor, refer to the formula H.3 in NPR9998:2018.

..note:: The Amplification factor should be between 1 and 5.5.

Input:
  • No input is needed.

Output:
  • Amplification factor.

amplification_factor_new_npr_h5a()[source]

This is the function to calculate the amplification factor, refer to the formula H.5a in NPR9998:2018+C1+A1:2020.

..note:: The Amplification factor should not be larger than 5.5.

Input:
  • No input is needed.

Output:
  • Amplification factor.

amplification_factor_new_npr_h5b()[source]

This is the function to calculate the amplification factor, refer to the formula H.5b in NPR9998:2018+C1+A1:2020.

Input:
  • No input is needed.

Output:
  • Amplification factor.

decide_on_return_period()[source]

Function to decide which return period the user selected, if the pga matches none of them, the return period of 2475 will be selected.

property fundamental_period_of_element

This is the function to calculate the fundamental period of the element, refer to the formula H.4 and H.5 in NPR9998:2018.

Input:
  • No input is needed.

Output:
  • Fundamental period of the element, in [s].

property nominal_slenderness

This is the function to calculate slenderness X’, refer to the report ‘Interpretation, evaluation and application of appendix H of NPR 9998:2018’.

Input:
  • No input is needed.

Output:
  • The slenderness X’.

plot_NPR_curves_envelope(input_dict: Dict)[source]

This is the function to plot the results of the element, together with the charts referring to the chapter H.5 in NPR9998:2018.

Input:
  • input_dict (Dict): Dictionary contains the data needed for the plot of the NPR curves.

Output:
  • The results of the element, together with the chart is saved in the output folder.

plot_NPR_curves_with_result(ar_dict: Dict)[source]

This is the function to plot the results of the element, together with the charts referring to the chapter H.5 in NPR9998:2018.

Input:
  • ar_dict: dictionary contains the data needed for the plot of the NPR curves

Output:
  • The results of the element, together with the chart is saved in the output folder.

plot_result_cantilever()[source]

This is the function to plot the results of the cantilever element, together with the charts referring to the chapter H.5 in NPR9998:2018.

Input:
  • No input is needed.

Output:
  • The results of the element, together with the chart is saved in the output folder.

plot_result_one_way_spanning()[source]

This is the function to plot the results of the one way spannaning element, together with the charts referring to the chapter H.5 in NPR9998:2018.

Input:
  • No input is needed.

Output:
  • The results of the element, together with the chart is saved in the output folder.

property seismic_demand

This is the function to calculate design seismic coefficient, refer to the formula H.3 in NPR9998:2018.

Input:
  • No input is needed.

Output:
  • The design seismic coefficient of the element.

property seismic_demand_new_npr_h5a

This is the function to calculate design seismic coefficient, refer to the formula H.5a in

NPR9998:2018+C1+A1:2020.

Input:
  • No input is needed.

Output:
  • The design seismic coefficient of the element.

property seismic_demand_new_npr_h5b

This is the function to calculate design seismic coefficient, refer to the formula H.5b in NPR9998:2018+C1+A1:2020.

Input:
  • No input is needed.

Output:
  • The design seismic coefficient of the element.

seismic_resistence_cantilever()[source]

This is the function to calculate seismic resistance of cantilever element, refer to the report ‘Interpretation, evaluation and application of appendix H of NPR 9998:2018’

Input:
  • No input is needed.

Output:
  • The seismic resistance of the element.

seismic_resistence_one_way_spanning()[source]

This is the function to calculate seismic resistance of one way spanning element, refer to the report ‘Interpretation, evaluation and application of appendix H of NPR 9998:2018’

Input:
  • No input is needed.

Output:
  • The seismic resistance of the element.

unity_check(select_5a: bool = False)[source]

Unity check based on the applied NPR.

unity_check_new_npr_h5a()[source]

This is the function to calculate unity check for the NLKA element by H.5a from NPR9998:2018+C1+A1:2020.

Input:
  • No input is needed.

Output:
  • The unity check for the NLKA element.

unity_check_new_npr_h5b()[source]

This is the function to calculate unity check for the NLKA element H.5b from NPR9998:2018+C1+A1:2020.

Input:
  • No input is needed.

Output:
  • The unity check for the NLKA element.

unity_check_old_npr()[source]

This is the function to calculate unity check for the NLKA element.

Input:
  • No input is needed.

Output:
  • The unity check for the NLKA element.

property weight

Calculate the weight of the wall by per meter, in [kN].

class viiapackage.tools.nlka_assessment.viia_nlka_graphs.NLKAGraph(e_top: int, e_bottom: int, return_period: int = 2475)[source]

Bases: object

This is the class used for gathering and determining some key parameters in the NLKA assessment of wall elements. The parameters are the seismic spectrum of the specific location and the inclination angle theta.

decide_on_spectrum()[source]

Method of NLKAGraph to decide on the spectrum to use based upon the return period the user selected, if the pga matches none of them, the return period of 2475 years will be selected.

decide_on_theta()[source]

Method of NLKAGraph to decide on the inclination angle theta, the interstorey drift, to use in the assessment based upon the boundary conditions of the wall. Refer to Figure H.2 in NPR9998:2020.

insert_spectrum_to_dictionary()[source]

Method of NLKAGraph to collect the spectrum data for the return periods of 475, 975, 2475 years from the model to a dictionary.

test_spectrum()[source]

Function used to test the functionality of the viia_nlka_graph function when no specific object is given and therefore no location with corresponding seismic parameters exists. A random location is chosen for the test (Loppersum)

viiapackage.tools.nlka_assessment.viia_nlka_graphs.additional_plot_styles(label: List[str], colours: List[str], linestyles: List[str], z_over_height: Optional[List[float]] = None, building_period: Optional[List[float]] = None) Tuple[str, str][source]

Determine which colours and line styles are assigned to the curves. The color will be based upon the label of the z_over_height and the line style upon the building_period.

Input:
  • label (list): List with the z over height ratio and the building period as strings.

  • colours (list): List with the colours according to the VIIA style for plots.

  • linestyles (list): List with different line styles possible for plots.

  • z_over_height (list): List of ratios between the height of the center of gravity of the element to the top of the foundation and the height of the building to the top of the roof. Default value: None.

  • building_period (list): List of fundamental periods of the building in [s]. Default value: None

Output:
  • The colour of the curve based upon the value of the z over height ratio and the line style of the curve based upon the value of the building period.

viiapackage.tools.nlka_assessment.viia_nlka_graphs.check_nlka_wall_material(material_name: str) bool[source]

Check if the given material is according to standard materials for an NLKA assessment.

Input:
  • material_name (str): The name of the material as defined by the user input

Output:
  • Boolean that determines if the material_name is according to the expected options or if it’s deviating

viiapackage.tools.nlka_assessment.viia_nlka_graphs.initial_data_dictionaries(data: Dict, height: List[float], z_over_height: float, building_period: float) Dict[str, Dict[float, List[float]]][source]

Function to structure the data in a dictionary such that the resulting maximum allowed heights that have overlap are linked together by setting these heights as a string of numbers as key in the dictionary with a sub-dictionary as value containing z_over_height as key and the building period as value.

An example for an initial dictionary entry is:

{
‘1.3 1.9 2.3 2.7 3.0 3.2 3.4 3.7 3.9 4.0 4.2’:

{0.1: [0.3, 0.5, 0.6], 0.3: [0.3, 0.5], 0.5: [0.3], 0.7: [0.3], 0.9: [0.3]}

}

Input:
  • data (dict): Dictionary that is extended with all the results for the maximum heights and the respective z over height ratios and building periods

  • height (list): List with the maximum heights in [m]

  • z_over_height (float): The ratio between the height of the center of gravity of the element to the top of the foundation and the height of the building to the top of the roof

  • building_period (float): The fundamental period of the building in [s]

Output:
  • Dictionary with the maximum heights as keys to be able to capture overlap in graphs for different parameter combinations of the labels z_over_height and building_period.

viiapackage.tools.nlka_assessment.viia_nlka_graphs.reformat_data_dictionary(data: Dict) Dict[str, List[List[str]]][source]

Function to transform the initial data dictionary such that all contiguous combinations of the labels (z_over height and building_period) are linked together and are written as a string representing either a range or a single number. The values of the initial dictionary are updated with the new data structure.

An example for a reformatted data dictionary entry is (using example initial_data_dictionaries() above):

{
‘1.3 1.9 2.3 2.7 3.0 3.2 3.4 3.7 3.9 4.0 4.2’:

[[‘0.1’, ‘0.3-0.6’], [‘0.3’, ‘0.3-0.5’], [‘0.5-0.9’, ‘0.3’]]

}

The three lists in the dictionary value represent three different parameter combinations that all result in the same maximum height curve. The format of the new value makes it directly accessible as a legend entry in a graph or as data in a json file

Input:
  • data (dict): Dictionary containing all the data in the initial format, where the values are seperate dictionaries with the z over height ratio as keys and the building periods as values

Output:
  • Reformatted dictionary where the values are transformed from dictionaries to lists containing sub-lists with the contiguous combinations of labels for that particular graph entry

viiapackage.tools.nlka_assessment.viia_nlka_graphs.string_to_list(string: str) List[float][source]

Converts a string with an array of values into a list with those same values as floats

Input:
  • string (str): Array of values in string format

Output:
  • List of values that are equal to the values found in the array in string format

viiapackage.tools.nlka_assessment.viia_nlka_graphs.viia_nlka_graph_data(project: ViiaProject, e_top: int, e_bottom: int, thickness: float, material_name: str = 'MW-KLEI<1945', max_overburden: int = 10, return_period: int = 2475, z_over_height: Optional[List[float]] = None, building_period: Optional[List[float]] = None, height_cut_off: float = 8.0, data_output: bool = True, graph_output: bool = True, nlka_folder: Path = None)[source]

Function to retrieve the maximum height of walls based upon NLKA assessment and store the data in a json file that can be used to create a graph displaying the maximum height versus the overburden load

Input:
  • project (obj): VIIA project object containing collections of fem objects and project variables.

  • e_top (int): The number denotes the eccentricity at the top of the wall element, please refer to Table H.1 in NPR9998:2018.

  • e_bottom (int): The number denotes the eccentricity at the bottom of the wall element, please refer to Table H.1 in NPR9998:2018.

  • thickness (float): The thickness of the wall element in [m].

  • material_name (str): The name of the material of the wall element. Some options are: MW-KLEI<1945, MW-KLEI>1945, MW-KZS>1960, MW-KZS>1985 and MW-AAC (aerated concrete). Default value: MW-KLEI<1945.

  • max_overburden (int): The maximum overburden load acting on the wall element in [kN/m]. This parameter will determine the range of the overburden load for the graph data starting from 0. Default value: 10.

  • return period (int): Decide which return period to use for the seismic parameters, in [years]. Selet from 475, 975 or 2475 years. Default value is 2475 years.

  • z_over_height (list): List of ratios between the height of the center of gravity of the element to the top of the foundation and the height of the building to the top of the roof. Default value is None, in which case the default list is used: [0.1, 0.3, 0.5, 0.7, 0.9].

  • building_period (list): List of fundamental periods of the building in [s]. Default value is None, in which case the default list is used: [0.3, 0.5, 0.6].

  • height_cut_off (float): The value of the height where the graphs will be ‘cut-off’ in [m]. This value is chosen to remove curves from the graph that have relevance to the result. Default value: 8.0

  • data_output (bool): This is True if you want to create a json-file containing the data to create the graphs. Default value True.

  • graph_output (bool): This is True if you want to create the graph through matplotlib and save it in your cwd. Default value True.

  • nlka_folder (Path): Location where to save the data and graphs that are created. Default value is None, the default location will be used.

Output:
  • JSON file containing the necessary data to create a graph with the maximum allowed wall heights.

  • The NLKA maximum allowed wall heights graph created with matplotlib is returned as PNG file in a separate folder.

viiapackage.tools.nlka_assessment.viia_nlka_graphs.write_json_output_data(data: Dict, overburden: List) List[Dict[str, Union[List[float], List[int], List[Dict[str, str]]]]][source]

Function to create the necessary data format for the json output file.

Input:
  • data (dict): Dictionary containing all the maximum heights and legend labels in the original format that is not yet fit for the required format in a json file.

  • overburden (list): List with the values of the overburden loads used to get the maximum heights on.

Output:
  • List containing dictionaries with all output entries needed to create the NLKA graphs.

class viiapackage.tools.nlka_assessment.viia_nlka_report.NLKA_Report(project: ViiaProject, orientation: str = 'P', unit: str = 'mm', report_format: str = 'A4')[source]

Bases: FPDF

add_title(title)[source]

Add title to the pdf document.

create_pdf(name)[source]

Create the pdf in the folder of the NSCE element.

create_table_parameters(parameters: List, spacing=1.5)[source]

Add the parameters into table in the pdf.

create_table_results(parameters: List, spacing=1.5)[source]

Add the results into table in the pdf.

viiapackage.tools.nlka_assessment.viia_nlka_report.viia_create_nlka_report(project: ViiaProject, orientation='P', unit='mm', report_format='A4')[source]

Function to create the report for NLKA assessment.

Reference Approach Tool

viiapackage.tools.reference_approach_tool.viia_reference_approach_tool.viia_reference_approach_tool()[source]

This function will initialise and create the VIIA REFERENCE APPROACH TOOL in the browser.

Input:
  • No input required.

Output:
  • The reference approach tool is shown in the browser.

Server Email Tool

viiapackage.tools.server_email.viia_send_server_email.viia_collect_contents_server_email(project: ViiaProject, out_file: Path, viia_object_number: str, analysis_name: Optional[str] = None) Dict[str, str][source]

Function to collect the data from the convergence graph function for adding to the server email.

Input:
  • project (obj): VIIA project object containing collections of fem objects and project variables.

  • out_file (Path): Path of the DIANA out-file with the information for the convergence behaviour.

  • viia_object_number (str): Number of the VIIA object, for example ‘1137A’.

  • analysis_name (str): Optional input for the name of the analysis. If provided it will be added to the title of the graph.

Output:
  • Returns dictionary with information for the server email, which can be used to insert in the template.

viiapackage.tools.server_email.viia_send_server_email.viia_send_server_email(viia_object_number: str, folder_path: Union[str, Path], recipient_email: str, analysis_name: Optional[str] = None, total_steps: Optional[Union[str, int]] = 'Not specified', object_part: str = 'Not specified', version_nr: int = 0, analysis_nr: str = 'A?', signal: str = 'S?') bool[source]

This function creates the contents and sends the email from server, when the analysis has finished. For the contents of the email the output file in the provided folder is read and extracts the analysis information.

Input:
  • viia_object_number (str): The object number used in the VIIA project, for example ‘1485V’.

  • folder_path (str or Path): The path object of the folder containing the output file as string or as instance of Path.

  • recipient_email (str): Email-address to which the email should be sent.

  • analysis_name (str): Optional input for the name of the analysis. If provided it will be added to the title of the graph.

  • total_steps (int): Optional input for the total number of steps in the analysis. Default is None.

  • object_part (str): In case of multiple object parts, select the correct part for this analysis. On MYVIIA you can see which object parts are available. Default value is ‘Gehele object’, which is the name to be used if the object is not split in separate parts on MYVIIA. There can be multiple object-parts for reruns, multiple inspections and objects that are split for analyses (front house vs barn). Default is ‘Not specified’.

  • version_nr (int): The version number of the analysis. Default is 0.

  • analysis_nr (str): The analysis number of the analysis. Default is ‘A?’.

  • signal (str): The signal of the analysis. Default is ‘S?’.

Output:
  • If possible an email will be sent to the recipient_email about the termination of the analysis.

  • If the email is sent True will be returned, otherwise False.

Start Tool

viiapackage.tools.start_tool.viia_start.viia_start_tool()[source]

This function is developed to assist with the starting process for the VIIA-object. The tool should be executed in a python-editor (like PyCharm) and can’t be used in DIANA.

viiapackage.tools.start_tool.viia_start_files.viia_copy_and_update_main_script_template(folder: Path, object_nr: str, initials: str, analysis_type: str = 'NLTH', object_part: str = None, foundation_type: str = 'shallow') Optional[Path][source]

This function copies the main script template to the workfolder and prepares it for use, by filling it with known information.

Input:
  • folder (Path): Location where to save the file, the workfolder.

  • object_nr (str): VIIA object number.

  • initials (str): Initials of the structural engineer.

  • object_part (str): Name of the object-part (use name of the object-part in MYVIIA). In case of no object-parts input should be None, which is the default value. This links to the ‘Gehele object’ in MYVIIA.

  • foundation_type (str): Type of foundation, select from ‘shallow’, ‘piles’ or ‘mixed’. This information is used to prepare the mainscript for the specific situation.

Output:
  • Returns the file path when it is created properly.

viiapackage.tools.start_tool.viia_start_files.viia_copy_and_update_model_script_template(folder: Path, object_nr: str, initials: str, object_part: str = None) Optional[Path][source]

This function copies the model script template to the workfolder and prepares it for use, by filling it with known information.

Input:
  • folder (Path): Location where to save the file, the workfolder.

  • object_nr (str): VIIA object number.

  • initials (str): Initials of the structural engineer.

  • object_part (str): Name of the object-part (use name of the object-part in MYVIIA). In case of no object-parts input should be None, which is the default value. This links to the ‘Gehele object’ in MYVIIA.

Output:
  • Returns the file path when it is created properly.

viiapackage.tools.start_tool.viia_start_files.viia_copy_and_update_myviia_dashboard_tool_template(folder: Path) Optional[Path][source]

This function copies the MYVIIA engineering database tool template to the working folder and prepares it for use.

Input:
  • folder (Path): Location where to save the file, the workfolder.

Output:
  • Returns the file path when it is created properly.

viiapackage.tools.start_tool.viia_start_files.viia_copy_and_update_report_script_template(folder: Path, object_nr: str, initials: str, analysis_type: str = 'NLTH', object_part: str = None) Optional[Path][source]

This function copies the report script template to the working folder and prepares it for use, by filling it with known information.

Input:
  • folder (Path): Location where to save the file, the workfolder.

  • object_nr (str): VIIA object number.

  • initials (str): Initials of the structural engineer.

  • object_part (str): Name of the object-part (use name of the object-part in MYVIIA). In case of no object-parts input should be None, which is the default value. This links to the ‘Gehele object’ in MYVIIA.

Output:
  • Returns the file path when it is created properly.

viiapackage.tools.start_tool.viia_start_files.viia_copy_and_update_result_script_template(folder: Path, object_nr: str, initials: str, analysis_type: str = 'NLTH', object_part: str = None, abaqus: bool = False) Optional[Path][source]

This function copies the result script template to the workfolder and prepares it for use, by filling it with the known information.

Input:
  • folder (Path): Location where to save the file, the workfolder.

  • object_nr (str): VIIA object number.

  • initials (str): Initials of the structural engineer.

  • object_part (str): Name of the object-part (use name of the object-part in MYVIIA). In case of no object-parts input should be None, which is the default value. This links to the ‘Gehele object’ in MYVIIA.

  • abaqus (bool): Select if the result script for ABAQUS software is required.

Output:
  • Returns the file path when it is created properly.

viiapackage.tools.start_tool.viia_start_files.viia_create_bod_shortcut(bod_version: str, bod_folder_link: str, folder: Path = None)[source]

Creates a shortcut to the required Basis of Design document (UPR document).

Input:
  • bod_version (str): Version of the Basis of Design as a string.

  • bod_folder_link (obj): Basis of Design folder link as a string.

  • folder (obj): Folder where the shortcut should be placed.

Output:
  • Returns the file object of the shortcut.

viiapackage.tools.start_tool.viia_start_files.viia_create_box_shortcut(object_nr: str, box_folder_link: Path, folder: Path = None)[source]

Creates a shortcut to the box folder of the object.

Input:
  • object_nr (str): VIIA object number as a string.

  • box_folder_link (obj): Box folder as a path object.

  • folder (obj): Folder where the shortcut should be placed as path.

Output:
  • Returns file object of the shortcut.

viiapackage.tools.start_tool.viia_start_files.viia_create_protocol_shortcut(folder: Path = None)[source]

Creates a shortcut to the online protocol in the provided (work)folder.

Input:
  • folder (obj): Folder where the shortcut should be placed.

Output:
  • Returns the file object of the shortcut.

viiapackage.tools.start_tool.viia_start_files.viia_create_user_config(folder: Path, email: str, password: str) str[source]

This function creates the user-config file that is used for the connection to the MYVIIA database.

Note

Credentials should be stored in the user-config file. Do not save credentials in scripts.

Input:
  • folder (Path): Location where to save the file.

  • email (str): Username in MYVIIA tool, VIIA email. Optional input, if None provided the credentials in the user-config file will be used.

  • password (str): Password for MYVIIA tool. Optional input, if None provided the credentials in the user-config file will be used.

Output:
  • A message is returned if action was successful.

viiapackage.tools.start_tool.viia_start_files.viia_download_cheat_sheet(folder: Path = None)[source]

Download cheat sheet from the protocol in the provided (work)folder.

Input:
  • folder (obj): Folder where the cheat sheet should be placed.

Output:
  • Returns the file object of the cheat sheet.

class viiapackage.tools.start_tool.viia_start_gui.StartGUI(main_window)[source]

Bases: Ui_MainWindow

This is the first window user enters, in the start tool and collects the user credentials and stores the in the user-config file that is created.

slot_for_ok_button()[source]

The action slot for the ok button

static start()[source]

Static method to initiate and run the GUI.

start_select_gui(token: str)[source]

Static method to initiate and run the select window for the start tool.

class viiapackage.tools.start_tool.viia_start_gui.StartSelectGUI(window, token)[source]

Bases: Ui_SelectWindow

This is the second window user enters, in the start tool and collects the required object and object-part and creates the model script, main script and result script. General info is entered in the scripts.

combobox_to_select_conditions()[source]

This is the slot for combobox behavior factor.

objecten_combo_box(viia_objects)[source]

This is the slot for combobox VIIA objects.

objectparts_combo_box(viia_object_id: int = None)[source]

This is the slot for combobox object-parts, based on the selection of the VIIA object.

set_all_objects()[source]

Show list of all objects from MYVIIA.

set_assigned_objects()[source]

Show the list of assigned objects only.

slot_for_ok_button()[source]

The action slot for the ok button

Other Tools

viiapackage.tools.viia_check_out_of_plane.boundary_two(tw)[source]

This function finds the eccentricities eb, ep, and beta for cantilever walls.

viiapackage.tools.viia_check_out_of_plane.determine_s_ad(wall_type, hw, ht, fnt, w, agd, t1)[source]

This function calculates the seismic demand Sad (in g) according to the wall type, i.e. type 1 for vertically spanning and type 2 for cantilever walls.

viiapackage.tools.viia_check_out_of_plane.seismic_resistance_one(wb, wt, yb, yt, hw, fnt, eb, et, e0, ep, psi, w, tnom, g, beta)[source]

This function calculates the seismic out-of-plane resistance of vertically spanning masonry walls.

viiapackage.tools.viia_check_out_of_plane.seismic_resistance_two(w, hw, y, fnt, eb, ep, g, tnom, beta)[source]

This function calculates the seismic out-of-plane resistance of cantilever masonry walls.

viiapackage.tools.viia_check_out_of_plane.viia_check_out_of_plane(wall_type: float, wall_height: float, total_height: float, wall_thickness: float, wall_weight: float, overburden_load: float, inclination_angle: float, peak_ground_acceleration: float, fundamental_period: float)[source]

Function to find the seismic out-of plane resistance and seismic demand of masonry walls

Input:
  • wall_type (float): Type of the wall studied, either vertically spanning, i.e. type 1 or cantilever wall, i.e. type 2.

  • wall_height (float): Height of the wall considered, in [m].

  • total_height (float): Total height of the building considered, in [m].

  • wall_thickness (float): The thickness of the wall considered, in [m].

  • wall_weight (float): Self weight of the masonry wall, in [kg/m3].

  • overburden_load (float): The overburden load on the wall, in [kN/m].

  • inclination_angle (float): The rotation angle of the wall, in [deg].

  • peak_ground_acceleration (float): Maximum ground acceleration at the location of the building, in [m/s2].

  • fundamental_period (float): Fundamental period of vibration of the building, in [s].

Output:
  • Returns the seismic out-of-plane resistance and seismic demand of masonry walls is calculated.

viiapackage.tools.viia_check_out_of_plane.weight_distribution_one(w, hw)[source]

This function finds the weight for the lower half of the wall, the weight of the upper half of the wall and the y distances where these weights act for vertically spanning walls

Input:
  • w : masonry wall weight

  • hw: height of the wall considered

Output:
  • wb: weight of the lower half of the wall

  • wt: weight of the upper half of the wall

  • yb: distance y where the weight of the lower wall acts

  • yt: distance y where the weight of the upper wall acts

viiapackage.tools.viia_check_out_of_plane.weight_distribution_two(hw)[source]

This function finds the y distance where the weight acts for cantilever walls.

viiapackage.tools.viia_create_roof.viia_create_gable_roof(project: ViiaProject, layer: Union[Layer, str], wall_points: List, material_equivalent_plate: str, geometry_equivalent_plate: Union[int, float], height_ridge: Union[int, float], material_ridge: str = 'LIN-HOUT', geometry_ridge: str = None, material_wall_plate: str = 'LIN-HOUT', geometry_wall_plate: str = None) List[Shapes][source]

Function to create basic roof structure based on two wall plates and height of ridge.

Note

The material of the collar tie can be modelled implicitly, or explicit. Select the appopriate material.

Input:
  • project (obj): VIIA project object containing collections of fem objects and project variables.

  • layer (str or Layer): Name of the layer as a string, or the Layer object itself, to which the newly created roof should be added.

  • wall_points (list with lists with lists of 3 floats): A list which contains two lists with both two coordinates. The coordinates represent the start and endpoint of the wall plate.

  • material_equivalent_plate (str): Name of the material following VIIA naming convention.

  • geometry_equivalent_plate (int, float): Thickness of the equivalent plate.

  • material_ridge (str): Name of the material of the ridge following VIIA naming convention. Default value: ‘LIN-HOUT’.

  • geometry_ridge (str): Name of the geometry of the ridge following VIIA naming convention. Default value: None.

  • material_wall_plate (str): Name of the material of the wall plates following VIIA naming convention. Default value: ‘LIN-HOUT’.

  • geometry_wall_plate (str): Name of the geometry of the wall plates following VIIA naming convention. Default value: None.

Output:
  • Creation of the shapes for gable roof (sheeting, optionally ridge beam, wall plates). A list with all the newly created shapes is returned.

viiapackage.tools.viia_create_roof.viia_create_hip_roof(project: ViiaProject, layer: Union[Layer, str], wall_points: List, material_equivalent_plate: str, geometry_equivalent_plate: Union[int, float], ridge: Union[List[List[Union[int, float]]], 'Line'], material_ridge: str = 'LIN-HOUT', geometry_ridge: str = None, material_wall_plate: str = 'LIN-HOUT', geometry_wall_plate: str = None) List[Shapes][source]

Function to create basic roof structure based on two wall plates and height of ridge.

Input:
  • project (obj): VIIA project object containing collections of fem objects and project variables.

  • layer (str or Layer): Name of the layer as a string, or the Layer object itself, to which the newly created roof should be added.

  • wall_points (list with lists with lists of 3 floats): A list which contains two lists with both two coordinates. The coordinates represent the start and endpoint of the wall plate

  • material_equivalent_plate (str): Name of the material following VIIA naming convention.

  • geometry_equivalent_plate (int, float): Thickness of the equivalent plate.

  • ridge (obj): Object reference of the line which represenst the ridge. Alternative (list with 2 lists of 3 floats): List with 2 coordinates of line, which represents the ridge.

  • material_ridge (str): Name of the material of the ridge following VIIA naming convention. Default value: ‘LIN-HOUT’.

  • geometry_ridge (str): Name of the geometry of the ridge following VIIA naming convention. Default value: None.

  • material_wall_plate (str): Name of the material of the wall plates following VIIA naming convention. Default value: ‘LIN-HOUT’.

  • geometry_wall_plate (str): Name of the geometry of the wall plates following VIIA naming convention. Default value: None.

Output:
  • Creation of the shapes for hip roof (sheeting, optionally ridge beam, wall plates). A list of all newly created objects is returned.

viiapackage.tools.viia_create_scia_model_for_ifc_export.viia_create_scia_model_for_ifc_export(json: Path = None, diana_dat_file: Path = None, items_to_remove: Optional[List[str]] = None)[source]

Create a scia xml file that can be used to export an IFC model in SCIA Engineering.

Input:
  • json (obj): Path of a json file with the model. Default is None.

  • diana_dat_file (obj): Path of a diana dat file with the model. Default is None.

  • items_to_remove (list of str): List with name of items that should be removed to be able to create the model in SCIA. Can be used if the automatic update of the model is not sufficient.

Output:
  • A xml will be created with the model that can be exported as IFC.

viiapackage.tools.viia_create_server_result_json.viia_create_server_result_json(viia_object_number: str, folder_path: Union[str, Path], output_folder_path: Union[str, Path] = None) Path[source]

This function loads in a model json present in an analysis folder, collects and reads the correct tb files and generates a result json with the processed results.

Input:
  • viia_object_number (str): The object number used in the VIIA project, for example ‘1485V’.

  • folder_path (str or Path): The path object of the folder containing the analysis files as string or as instance of Path.

  • output_folder_path (str or Path): The path object of the folder where the output should be stored, as string or as instance of Path. By default, folder_path is used.

Output:
  • If possible, a result json is generated and the corresponding file path is returned

viiapackage.tools.viia_frequency_tool.viia_frequency_calculation(length: Union[float, int], width: Union[float, int], boundary_condition: Dict[str, str], thickness: Union[float, int], density: Union[int, float], youngs_modulus: Union[int, float], poissons_ratio: Union[float, int], openings: List[Dict] = None, show: bool = False) float[source]

Calculation of first out-of-plane natural frequency of a plate (wall) with or without openings.

Note

The natural frequency can be calculated for a maximum of three openings in a wall. Further expansion will be added later.

Input:
  • length (float): Length of the plate or wall, in [m].

  • width (float): Width of the plate or height of the wall, in [m].

  • boundary_condition (dict): Boundary condition of all the four sides of the wall written in a dictonary format. The available names for the supports are:- ‘simply supported’, ‘fixed’ and ‘free’. The required keys for the dictionary are ‘left’, ‘right’, ‘bottom’ and ‘top’.

  • thickness (float): Thickness of the plate, in [m].

  • density (int/float): Density of the plate, in [kg/m3].

  • youngs_modulus (int/float): Young’s modulus of the material of the plate, in [Pa] or [N/m2].

  • poissons_ratio (float): Poisson’s ratio of the plate, in [-].

  • openings (list of dict): Information of the location of opening. The dictionary contains the value for ‘left_of_opening’, ‘right_of_opening’, ‘top_of_opening’ and ‘bottom_of_opening’ for each opening. The values for ‘left_of_opening’ and ‘right_of_opening’ should be from the left edge of the wall. The values for ‘bottom_of_opening’ and ‘top_of_opening’ should be from the bottom edge of the wall. All dimensions in [m].

  • show (bool): Select to show the picture of the mesh. Default value is False. If True, the image of the plate and mesh show in matplotlib.

Output:
  • Returns the first natural frequency of the plate or wall in Hertz.

viiapackage.tools.viia_get_file.viia_get_file(project: ViiaProject, path: Path, starts_with: Optional[str] = None, in_name: Optional[str] = None, not_in_name: Optional[str] = None, suffix: Optional[str] = None) Optional[Path][source]

Function to find project files in a specified path, based on file name or extension.

Input:
  • project (obj): Project object containing collections and of fem objects and project variables.

  • path (Path): Path in which the function should check for the file.

  • starts_with (str): String with which the file name should start in order to be eligible.

  • in_name (str): File name should contain this string to be eligible.

  • not_in_name (str): File name should not contain this string to be eligible.

  • suffix (str): String describing the suffix/file-extension which the file should contain in order to be eligible.

Output:
  • File in path that satisfies the inputted search criteria.

viiapackage.tools.viia_jira.viia_create_object_jira(project: ViiaProject, jira_board: str, object_nr: Optional[str] = None, analysis_type: Optional[str] = None, object_size: Optional[str] = None, assignee_email: Optional[str] = None)[source]

This function connects with JIRA REST API in order to create object tasks on VIIA JIRA boards. JIRA credentials in the user_config are required for this function The following entry is expected in the user_config connection_dict:

{'jira': {
    'email': 'employee.lastname@rhdhv.com',
    'token': 'abc123XYZ'}}

The API token can be created on the JIRA website in the ‘Security’ tab of account settings: https://id.atlassian.com/manage-profile/security/api-tokens

Input:
  • project (obj): ViiaProject to retrieve project data from

  • jira_board (str): Referring to the board of the corresponding production team. Choose from ‘DIANA1’, ‘DIANA2’, ‘DIANA3’, ‘DIANA4’, ‘DIANA5’ and ‘DIANA6’.

  • object_nr (str): VIIA object number.

  • analysis_type (str): Select the analysis type for the object, for example ‘NLTH’.

  • object_size (str): Select from ‘Small’, ‘Medium’ and ‘Large’.

  • Optional: assignee_email (str): Email-adress with which the desired assignee is registered at the JIRA board.

Output:
  • An epic and all user stories for the object will be created in the requested JIRA board, including components and story points, and assignee if selected.

viiapackage.tools.viia_update_server.add_pip_message(run_output)[source]

Collects the pip info and return it as a string

viiapackage.tools.viia_update_server.get_package_version(package: str, interpreter: str, extra_index_url: Optional[str] = None)[source]

Gets the current and latest version of a package

viiapackage.tools.viia_update_server.viia_install_server_requirements(recipient_email: str)[source]

Installs the requirements-servers.txt

viiapackage.tools.viia_update_server.viia_update_server_venv(recipient_email: str)[source]

Updates the venv on the server and will send an email when needed.

Can be executed with a batch file with the following lines:

set emailaddress=reinier.ringers@rhdhv.com,jurriaan.floor@rhdhv.com “E:VIIAserver_venvScriptspython.exe” -c “from viiapackage.tools import viia_update_server_venv ; viia_update_server_venv(recipient_email=r’%emailaddress%’)” TIMEOUT 600

Input:
  • recipient_email (str): The email address to where the email should be sent. Can be multiple divided by a

comma.

Output:
  • Pip install will be updated if possible. Email will be sent if needed.

viiapackage.tools.viia_update_version_in_scripts.viia_update_version_in_script(project: ViiaProject, old_version: str, new_version: str, script: Union[str, Path]) bool[source]

Updates the viiapackage version in a script

Input:
  • project (obj): Project object containing collections of fem objects and project variables.

  • old_version (str): The old version of the viiapackage.

  • new_version (str): The new/current version of the viiapackage.

  • script (str): The path of the script that should be updated from the old to the new version

Output:
  • A bool to indicate the status of the update.

viiapackage.tools.viia_update_version_in_scripts.viia_update_version_in_scripts(project: ViiaProject, old_version: str, new_version: str)[source]

Updates the viiapackage version in relevant scripts

Input:
  • project (obj): Project object containing collections of fem objects and project variables.

  • old_version (str): The old version of the viiapackage.

  • new_version (str): The new/current version of the viiapackage.

Output:
  • A dict with bools to indicate the status of the update.