### ===================================================================================================================
### viia_find_linear_building_elements
### ===================================================================================================================
# Copyright ©VIIA 2024
### ===================================================================================================================
### 1. Import modules
### ===================================================================================================================
# General imports
from __future__ import annotations
from typing import TYPE_CHECKING
from rhdhv_fem.shapes.lines.main_line_reinforcement import MainLineReinforcement
from rhdhv_fem.shapes.surfaces.main_surface_reinforcement import MainSurfaceReinforcement
# References for functions and classes in the viiaPackage
if TYPE_CHECKING:
from viiapackage.viiaStatus import ViiaProject
### ===================================================================================================================
### 2. Function to get the linear-modelled building elements
### ===================================================================================================================
[docs]def viia_find_linear_building_elements(project: ViiaProject):
""" This function is used to find linear building elements."""
linear_building_elem_1d = []
linear_building_nod_1d = []
linear_building_elem_2d = []
linear_building_nod_2d = []
for shape_object in project.collections.lines:
if shape_object.material.is_linear and 'LATEI' not in shape_object.name \
and not isinstance(shape_object, MainLineReinforcement):
linear_building_elem_1d.extend(shape_object.mesh.mesh_elements)
linear_building_nod_1d.extend(shape_object.mesh.get_meshnodes())
for shape_object in project.collections.surfaces:
if shape_object.material.is_linear and shape_object.layer.name != 'F' \
and not isinstance(shape_object, MainSurfaceReinforcement):
linear_building_elem_2d.extend(shape_object.mesh.mesh_elements)
linear_building_nod_2d.extend(shape_object.mesh.get_meshnodes())
return linear_building_elem_1d, linear_building_nod_1d, linear_building_elem_2d, linear_building_nod_2d
### ===================================================================================================================
### 3. End of script
### ===================================================================================================================