-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathtest_aluminumMemberLocalSectionReduction.py
63 lines (51 loc) · 3.32 KB
/
test_aluminumMemberLocalSectionReduction.py
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
55
56
57
58
59
60
61
62
63
import os
import sys
PROJECT_ROOT = os.path.abspath(os.path.join(
os.path.dirname(__file__),
os.pardir)
)
sys.path.append(PROJECT_ROOT)
from RFEM.enums import AluminumMemberLocalSectionReductionType, FastenerDefinitionType, MultipleOffsetDefinitionType
from RFEM.initModel import Model, AddOn, SetAddonStatus
from RFEM.TypesForAluminumDesign.aluminumMemberLocalSectionReduction import AluminumMemberLocalSectionReduction
if Model.clientModel is None:
Model()
def test_AluminumMemberLocalSectionReduction():
Model.clientModel.service.delete_all()
Model.clientModel.service.begin_modification()
SetAddonStatus(Model.clientModel, AddOn.aluminum_design_active, True)
AluminumMemberLocalSectionReduction(1, "", "",
[
[AluminumMemberLocalSectionReductionType.REDUCTION_COMPONENT_TYPE_DESIGN_PARAMETERS, 1, False, FastenerDefinitionType.DEFINITION_TYPE_ABSOLUTE, 0.2, 0, MultipleOffsetDefinitionType.OFFSET_DEFINITION_TYPE_ABSOLUTE, 0.0]
],
"")
AluminumMemberLocalSectionReduction(2, "", "",
[
[AluminumMemberLocalSectionReductionType.REDUCTION_COMPONENT_TYPE_DESIGN_PARAMETERS, 1.2, True, FastenerDefinitionType.DEFINITION_TYPE_ABSOLUTE, 0.1, 2, MultipleOffsetDefinitionType.OFFSET_DEFINITION_TYPE_ABSOLUTE, 2],
[AluminumMemberLocalSectionReductionType.REDUCTION_COMPONENT_TYPE_DESIGN_PARAMETERS, 2.0, True, FastenerDefinitionType.DEFINITION_TYPE_RELATIVE, 0.20, 3, MultipleOffsetDefinitionType.OFFSET_DEFINITION_TYPE_RELATIVE, 0.1]
],
"")
AluminumMemberLocalSectionReduction(3, "", "",
[
[AluminumMemberLocalSectionReductionType.REDUCTION_COMPONENT_TYPE_DESIGN_PARAMETERS, 1.5, False, FastenerDefinitionType.DEFINITION_TYPE_RELATIVE, 0.15, 0, MultipleOffsetDefinitionType.OFFSET_DEFINITION_TYPE_ABSOLUTE, 0.0],
[AluminumMemberLocalSectionReductionType.REDUCTION_COMPONENT_TYPE_DESIGN_PARAMETERS, 1.8, True, FastenerDefinitionType.DEFINITION_TYPE_RELATIVE, 0.25, 4, MultipleOffsetDefinitionType.OFFSET_DEFINITION_TYPE_ABSOLUTE, 0.3]
], ""
)
Model.clientModel.service.finish_modification()
smlr_1 = Model.clientModel.service.get_aluminum_member_local_section_reduction(1)
assert smlr_1.components[0][0].row['position'] == 1
assert smlr_1.components[0][0].row['multiple'] == False
assert smlr_1.components[0][0].row['fastener_definition_type'] == 'DEFINITION_TYPE_ABSOLUTE'
assert smlr_1.components[0][0].row['reduction_area'] == 0.2
smlr_2 = Model.clientModel.service.get_aluminum_member_local_section_reduction(2)
assert smlr_2.components[0][0].row['position'] == 1.2
assert smlr_2.components[0][0].row['multiple'] == True
assert smlr_2.components[0][1].row['fastener_definition_type'] == 'DEFINITION_TYPE_RELATIVE'
assert smlr_2.components[0][1].row['reduction_area_factor'] == 0.20
assert smlr_2.components[0][0].row['multiple_offset'] == 2
smlr_3 = Model.clientModel.service.get_aluminum_member_local_section_reduction(3)
assert smlr_3.components[0][1].row['position'] == 1.8
assert smlr_3.components[0][0].row['multiple'] == False
assert smlr_3.components[0][1].row['multiple'] == True
assert smlr_3.components[0][1].row['multiple_offset_definition_type'] == 'OFFSET_DEFINITION_TYPE_ABSOLUTE'
assert smlr_3.components[0][1].row['multiple_offset'] == 0.3