|
| 1 | +import os |
| 2 | +import sys |
| 3 | +PROJECT_ROOT = os.path.abspath(os.path.join( |
| 4 | + os.path.dirname(__file__), |
| 5 | + os.pardir) |
| 6 | +) |
| 7 | +sys.path.append(PROJECT_ROOT) |
| 8 | + |
| 9 | +from RFEM.enums import AddOn, NodalSupportType |
| 10 | +from RFEM.initModel import Model, SetAddonStatus |
| 11 | +from RFEM.BasicObjects.material import Material |
| 12 | +from RFEM.BasicObjects.section import Section |
| 13 | +from RFEM.BasicObjects.node import Node |
| 14 | +from RFEM.BasicObjects.member import Member |
| 15 | +from RFEM.TypesForNodes.nodalSupport import NodalSupport |
| 16 | +from RFEM.AluminumDesign.aluminumSLSConfiguration import AluminumDesignSLSConfigurations |
| 17 | + |
| 18 | +if Model.clientModel is None: |
| 19 | + Model() |
| 20 | + |
| 21 | +def test_AluminumDesignServiceabilityConfigurations(): |
| 22 | + |
| 23 | + Model.clientModel.service.delete_all() |
| 24 | + Model.clientModel.service.begin_modification() |
| 25 | + |
| 26 | + SetAddonStatus(Model.clientModel, addOn=AddOn.aluminum_design_active, status=True) |
| 27 | + |
| 28 | + Material(1, 'EN AW-3004 H24 | EN 1999-1-1:2007') |
| 29 | + |
| 30 | + Section(1, 'IPE 200') |
| 31 | + |
| 32 | + Node(1, 0.0, 0.0, 0.0) |
| 33 | + Node(2, 5, 0.0, 0.0) |
| 34 | + |
| 35 | + Member(1, 1, 2, 0.0, 1, 1) |
| 36 | + |
| 37 | + NodalSupport(1, '1', NodalSupportType.FIXED) |
| 38 | + |
| 39 | + AluminumDesignSLSConfigurations(1, 'Test SLS') |
| 40 | + AluminumDesignSLSConfigurations(2, 'SLS2', '1') |
| 41 | + |
| 42 | + Model.clientModel.service.finish_modification() |
| 43 | + |
| 44 | + config1 = Model.clientModel.service.get_aluminum_design_sls_configuration(1) |
| 45 | + config2 = Model.clientModel.service.get_aluminum_design_sls_configuration(2) |
| 46 | + |
| 47 | + assert config1.name == "Test SLS" |
| 48 | + assert config2.assigned_to_members == '1' |
0 commit comments