forked from dlubal-software/RFEM_Python_Client
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbaseSettings.py
More file actions
54 lines (43 loc) · 2.46 KB
/
Copy pathbaseSettings.py
File metadata and controls
54 lines (43 loc) · 2.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
from RFEM.initModel import Model, clearAtributes
from RFEM.enums import GlobalAxesOrientationType, LocalAxesOrientationType
class BaseSettings():
def __init__(self,
gravitational_acceleration: int = 10,
global_axes_orientation = GlobalAxesOrientationType.E_GLOBAL_AXES_ORIENTATION_ZDOWN,
local_axes_orientation = LocalAxesOrientationType.E_LOCAL_AXES_ORIENTATION_ZDOWN,
tolerances = [0.0005, 0.0005, 0.0005, 0.0005],
member_representatives: bool = False,
member_set_representatives: bool = False):
"""
Args:
gravitational_acceleration (int): Gravitational Acceleration (m/sn2)
global_axes_orientation (enum): Global Axes Orientation Enumeration
local_axes_orientation (Enum): Local Axes Orientation Enumeration
tolerances (list): Tolerances
member_representatives (bool): Member Representatives
member_set_representatives (bool): Member Set Representatives
tolerances = [tolerance_for_nodes, tolerance_for_lines, tolerance_for_surfaces_and_planes, tolerance_for_directions]
"""
# Client model | Load Case
clientObject = Model.clientModel.factory.create('ns0:model_settings_and_options_type')
# Clears object atributes | Sets all atributes to None
clearAtributes(clientObject)
# Gravitational Acceleration
clientObject.gravitational_acceleration = gravitational_acceleration
# Global Axes Orientation
clientObject.global_axes_orientation = global_axes_orientation.name
# Local Axes Orientation
clientObject.local_axes_orientation = local_axes_orientation.name
# Tolerances
if len(tolerances) != 4:
raise Exception("WARNING:Expected size of the array. Kindly check the list correctness.")
clientObject.tolerance_for_nodes = tolerances[0]
clientObject.tolerance_for_lines = tolerances[1]
clientObject.tolerance_for_surfaces_and_planes = tolerances[2]
clientObject.tolerance_for_directions = tolerances[3]
# Member Representatives
clientObject.member_representatives_active = member_representatives
# Member Set Representatives
clientObject.member_set_representatives_active = member_set_representatives
# Add Base Data Settings to client model
Model.clientModel.service.set_model_settings_and_options(clientObject)