Source code for viiapackage.connections.unite_detail

### ===================================================================================================================
###   UniteDetail class
### ===================================================================================================================
# Copyright ©VIIA 2024

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

# General imports
from typing import List, Dict

# References for functions and classes in the rhdhv_fem package
from rhdhv_fem.connections import Unite

# References for functions and classes in the viiaPackage
from viiapackage.connections.details import Detail


### ===================================================================================================================
###   2. Class NoConnectionDetail
### ===================================================================================================================

[docs]class UniteDetail(Detail): """ This is the class with information from the UPR regarding the detail numbers for unite details."""
[docs] def __init__( self, detail_nr: str, geometry_type: str): """ Input: - detail_nr (str): Name of the requested detail, see the Basis of Design (UPR). - geometry_type (str): The type of geometry for the no-connection detail. Select from 'point' or 'line'. """ # __init__ method of Detail class is carried out Detail.__init__(self, detail_nr=detail_nr, geometry_type=geometry_type)
@property def name(self): """ Method of 'InterfaceDetail' to return the VIIA name for the unite connection detail.""" return 'UNITE'
[docs] def create(self, project: 'ViiaProject', connecting_shapes: List[Dict[str, any]]) -> List[Unite]: """ Method of 'UniteDetail' class to create the unite detail. Input: - project (obj): VIIA project object containing collections of fem objects and project variables. - connecting_shapes (list): List of dictionaries with the connecting shapes (see 'Unite' class in rhdhv_fem repository documentation). Output: - Returns list of instances of Unite class created and added to project. """ connections = [] for connecting in connecting_shapes: # Creation of the object connections.append(project.create_unite( name=self.generate_name( project=project, source=connecting['source_connecting_shape'], target=connecting['target_connecting_shape']), connecting_shapes=connecting)) return connections
### =================================================================================================================== ### 3. End of script ### ===================================================================================================================