Source code for viiapackage.pictures.model_pictures.helper_functions.get_model_picture_name

### ===================================================================================================================
###  FUNCTION: Get VIIA model picture name
### ===================================================================================================================
# Copyright ©VIIA 2024

### ===================================================================================================================
###   1. Import modules
### ===================================================================================================================

# References for functions and classes in the rhdhv_fem package
from rhdhv_fem.groups import Layer


### ===================================================================================================================
###   2. Function to get the VIIA names for model pictures
### ===================================================================================================================

[docs]def viia_get_model_picture_name(layer: Layer, element: str) -> str: """ Function to get the model picture name for the model picture. Input: - layer (obj): The layer object where the name of the layer is decided.. - element (str): The scope of the model picture, this will be appended directly after the layer to make the picture name. Output: - Returns the name of the model picture according VIIA naming convention. """ if not isinstance(layer, Layer): raise TypeError( f"ERROR: The input for layer should be a layer object instead of {type(layer)}. Please check the inputs.") if not isinstance(element, str): raise TypeError( f"ERROR: The input for element should be a string instead of {type(element)}. Please check the inputs.") if layer.name[0] == 'N' or layer.name[0] == 'B': picture_name = f'{layer.name}-{element}' elif layer.name[0] == 'F': picture_name = f'FUNDERINGS{element}' else: raise ValueError(f"ERROR: Layer name {layer.name} is not recognised for the model picture.") return picture_name
### =================================================================================================================== ### 3. End of script ### ===================================================================================================================