Supporting modules for viiaPackage

The tools in the following modules are used in the viiaPackage for running the application, they are not available for users (are not meant to be directly used by them). These function support other parts of the viiaPackage.

Functions to connect to MYVIIA

viiapackage.database.viia_myviia._viia_get_from_myviia(url: str, token: str, stream: bool = False)[source]

Function to create GET request to retrieve data from MYVIIA tool.

viiapackage.database.viia_myviia._viia_post_to_myviia(url: str, token: str, data: dict)[source]

Function to create POST request to enter new data record to MYVIIA tool.

viiapackage.database.viia_myviia.myviia_check_modules(func)[source]

This function checks if all required 3rd party modules are installed properly when collecting data from MYVIIA webtool.

viiapackage.database.viia_myviia.myviia_login() str[source]

This function connects to the MYVIIA database, provides authentication and returns a bearer token to acccess the database for additional requests. Note that the token lifecycle is limited.

Note

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

Input:
  • No input required.

Output:
  • If successful authentication is performed, the token is returned as string.

  • Error is raised if any problem occurs.

viiapackage.database.viia_myviia.myviia_token(func)[source]

This function checks if token is provided or that it should be collected with login.

Functions for send data to MYVIIA

Separate tools in VIIA

This section contains functions for separate tools that can be used for the VIIA project.

Tools to model roofs in VIIA

viiapackage.tools.viia_create_roof._viia_create_general_roof(project: ViiaProject, layer: Union[Layer, str], wall_points: List, material_equivalent_plate: str, geometry_equivalent_plate: Union[int, float], ridge: Union['Line', 'Polyline'], material_ridge: Optional[str] = None, geometry_ridge: Optional[str] = None, material_wall_plate: Optional[str] = None, geometry_wall_plate: Optional[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): String describing the name of the material of the equivalent roof plates, following VIIA naming convention.

  • geometry_equivalent_plate (str): Thickness of the equivalent plate.

  • ridge (obj): Object reference of the line which represents 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 the roof (sheeting, optionally ridge beam, wall plates). A list with all the newly created shapes is returned.

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.

Interactive modelling tool

VIIA tool for NLKA assessment

Server email and server maintenance

Start tool

VIIA frequency tool

REST API tools for JIRA

Modules in layers folder

This module contains functions for layers.

Functionality for layers

viiapackage.layers.viia_layer.viia_check_layers(project: ViiaProject) True[source]

This function checks if the layers comply. It checks if the required layers are present, and if no layers are missing between others.

Input:
  • No input required.

Output:
  • Returns True if the layers in the model comply.

  • Raises error if any layer is missing.

viiapackage.layers.viia_layer.viia_create_layer(project: ViiaProject, name: str, shapes: Optional[List] = None) Layer[source]

Function to create a layer in the class ‘Layer’ and add it to the project. The VIIA naming convention is applied. Only layers with names ‘F’, ‘N0’, ‘N1’ etc. and ‘B1’, ‘B2’ etc. are allowed.

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

  • name (str): Name of the layer.

  • shapes (list): List of shapes that belong the layer that is created. Default None.

Output:
  • Returns the object created in the ‘Layer’ class.

  • The Layer is added to the project collections.

viiapackage.layers.viia_layer.viia_get_highest_layer(project: ViiaProject, layer1: Layer, layer2: Layer, name: bool = False) Union[Layer, str][source]

This function determines the highest layer of the two layers received, following VIIA naming convention.

Input:
  • name (bool): Optional input to get the name of that layer. Default value False, returning the layer object.

Output:
  • Returns the highest layer or name of the requested layer objects.

viiapackage.layers.viia_layer.viia_get_layers(project: ViiaProject, names: bool = False) Union[List[Layer], List[str]][source]

This function gets the layers from the project and orders them following the VIIA naming convention. Layers start with the foundation (layer ‘F’), basements in reverse order (the deepest one has the highest number), (layer ‘B2’, ‘B1’), and the normal building layers starting with the ground floor (layer ‘N0’, ‘N1’ etc.).

Input:
  • names (bool): Optional input to get the names of the layers in the list. Default value False, returning a list with the layer objects ordered.

Output:
  • Returns list of layers ordered for VIIA from bottom up as list of layer objects or layer names.

viiapackage.layers.viia_layer.viia_get_top_layer(project: ViiaProject, name: bool = False) Union[Layer, str][source]

This function determines the top layer of the structure, following VIIA naming convention.

Input:
  • name (bool): Optional input to get the name of the layer. Default value False, returning the layer object.

Output:
  • Returns the top layer of the building as layer object or the name of that layer as string.