Skip to content

Commit fe9a1a0

Browse files
added AluminumDesign ULS/SLS
1 parent 154a4e9 commit fe9a1a0

File tree

3 files changed

+135
-0
lines changed

3 files changed

+135
-0
lines changed

RFEM/AluminumDesign/__init__.py

Whitespace-only changes.
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
from RFEM.initModel import Model, clearAttributes, deleteEmptyAttributes, ConvertToDlString
2+
3+
class AluminumDesignSLSConfigurations():
4+
5+
def __init__(self,
6+
no: int = 1,
7+
name: str = 'SLS1',
8+
members_no: str = 'All',
9+
member_sets_no: str = 'All',
10+
comment: str = '',
11+
params: dict = None,
12+
model = Model):
13+
14+
"""
15+
Args:
16+
no (int): Aluminum Design Serviceability Limit State Configuration Tag
17+
name (str): User Defined Configuration Name
18+
members_no (str): Assign Configuration to Selected Members
19+
member_sets_no (str): Assign Configuration to Selected Member Sets
20+
comment (str, optional): Comment
21+
params (dict, optional): Any WS Parameter relevant to the object and its value in form of a dictionary
22+
model (RFEM Class, optional): Model to be edited
23+
"""
24+
25+
# Client Model | Aluminum Design Serviceability Limit State Configurations
26+
clientObject = model.clientModel.factory.create('ns0:aluminum_design_sls_configuration')
27+
28+
# Clears object atributes | Sets all atributes to None
29+
clearAttributes(clientObject)
30+
31+
# ULS Configuration No.
32+
clientObject.no = no
33+
34+
# User Defined Name
35+
if name:
36+
clientObject.user_defined_name_enabled = True
37+
clientObject.name = name
38+
39+
# Assigned Members
40+
if members_no == 'All':
41+
clientObject.assigned_to_all_members = True
42+
43+
else:
44+
clientObject.assigned_to_all_members = False
45+
clientObject.assigned_to_members = ConvertToDlString(members_no)
46+
47+
# Assigned Member Sets
48+
if member_sets_no == 'All':
49+
clientObject.assigned_to_all_member_sets = True
50+
51+
else:
52+
clientObject.assigned_to_all_member_sets = False
53+
clientObject.assigned_to_member_sets = ConvertToDlString(member_sets_no)
54+
55+
# Comment
56+
clientObject.comment = comment
57+
58+
# Adding optional parameters via dictionary
59+
if params:
60+
for key in params:
61+
clientObject[key] = params[key]
62+
63+
# Delete None attributes for improved performance
64+
deleteEmptyAttributes(clientObject)
65+
66+
# Add Global Parameters to Client Model
67+
model.clientModel.service.set_aluminum_design_sls_configuration(clientObject)
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
from RFEM.initModel import Model, clearAttributes, deleteEmptyAttributes, ConvertToDlString
2+
3+
class AluminumDesignULSConfigurations():
4+
5+
def __init__(self,
6+
no: int = 1,
7+
name: str = 'ULS1',
8+
members_no: str = 'All',
9+
member_sets_no: str = 'All',
10+
comment: str = '',
11+
params: dict = None,
12+
model = Model):
13+
14+
"""
15+
Args:
16+
no (int): Aluminum Design Ultimate Limit State Configuration Tag
17+
name (str): User Defined Configuration Name
18+
members_no (str): Assign Configuration to Selected Members
19+
member_sets_no (str): Assign Configuration to Selected Member Sets
20+
comment (str, optional): Comment
21+
params (dict, optional): Any WS Parameter relevant to the object and its value in form of a dictionary
22+
model (RFEM Class, optional): Model to be edited
23+
"""
24+
25+
# Client Model | Aluminum Design Ultimate Limit State Configurations
26+
clientObject = model.clientModel.factory.create('ns0:aluminum_design_uls_configuration')
27+
28+
# Clears object atributes | Sets all atributes to None
29+
clearAttributes(clientObject)
30+
31+
# ULS Configuration No.
32+
clientObject.no = no
33+
34+
# User Defined Name
35+
if name:
36+
clientObject.user_defined_name_enabled = True
37+
clientObject.name = name
38+
39+
# Assigned Members
40+
if members_no == 'All':
41+
clientObject.assigned_to_all_members = True
42+
43+
else:
44+
clientObject.assigned_to_all_members = False
45+
clientObject.assigned_to_members = ConvertToDlString(members_no)
46+
47+
# Assigned Member Sets
48+
if member_sets_no == 'All':
49+
clientObject.assigned_to_all_member_sets = True
50+
51+
else:
52+
clientObject.assigned_to_all_member_sets = False
53+
clientObject.assigned_to_member_sets = ConvertToDlString(member_sets_no)
54+
55+
# Comment
56+
clientObject.comment = comment
57+
58+
# Adding optional parameters via dictionary
59+
if params:
60+
for key in params:
61+
clientObject[key] = params[key]
62+
63+
# Delete None attributes for improved performance
64+
deleteEmptyAttributes(clientObject)
65+
66+
# Add Global Parameters to Client Model
67+
model.clientModel.service.set_aluminum_design_uls_configuration(clientObject)
68+

0 commit comments

Comments
 (0)