Skip to content

Commit 95229c4

Browse files
Update designSupport.py
1 parent 9536a0f commit 95229c4

1 file changed

Lines changed: 275 additions & 6 deletions

File tree

RFEM/TypesForMembers/designSupport.py

Lines changed: 275 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,17 @@ def __init__(self,
2323
members (str): Assigned Members
2424
member_sets (str): Assigned Member Sets
2525
nodes (str): Assigned Nodes
26-
support_in_z (list): List of Parameters for Support in Z Axis
27-
support_in_y (list): List of Parameters for Support in Y Axis
28-
for support_depth_by_section_width_of_member_z/y_enabled = True:
29-
support_in_z/y = [activate support in z/y (bool), consider support in deflection design z/y (bool), design support orientation z/y type (enum), support width z/y (float)]
30-
for support_depth_by_section_width_of_member_z/y_enabled = False:
31-
support_in_z/y = [activate support in z/y (bool), consider support in deflection design z/y (bool), design support orientation z/y type (enum), support width z/y (float), support depth z/y (float)]
26+
support_in_z (list/bool): List of Parameters for Support in Z Axis
27+
support_in_y (list/bool): List of Parameters for Support in Y Axis
28+
for deactive support in z/y:
29+
support_in_z/y (bool): Deactivate support in Z/Y (= False/None)
30+
for active support in z/y:
31+
support_in_z/y[0] (bool): Activate Support in Z/Y (= True)
32+
support_in_z/y[1] (bool): Consider Support in Deflection Design Z/Y
33+
support_in_z/y[2] (enum): Design Support Orientation Z/Y Type Enumeration
34+
support_in_z/y[3] (float): Support Width Z/Y (in meter)
35+
for manual support depth:
36+
support_in_z/y[4] (float): Support Depth Z/Y (in meter)
3237
name (str, option): User Defined Design Support Name
3338
comment (str, optional): Comment
3439
params (dict, optional): Any WS Parameter relevant to the object and its value in form of a dictionary
@@ -64,11 +69,14 @@ def __init__(self,
6469
clientObject.consider_in_deflection_design_z = support_in_z[1]
6570
clientObject.design_support_orientation_z = support_in_z[2].name
6671
clientObject.support_width_z = support_in_z[3]
72+
6773
if len(support_in_z) == 5:
6874
clientObject.support_depth_by_section_width_of_member_z_enabled = False
6975
clientObject.support_depth_z = support_in_z[4]
76+
7077
elif len(support_in_z) == 4:
7178
clientObject.support_depth_by_section_width_of_member_z_enabled = True
79+
7280
else:
7381
raise ValueError('WARNING!: The suport in Z parameter needs to be length of 4 or 5. Kindly check list inputs for completeness and correctness.')
7482

@@ -84,11 +92,14 @@ def __init__(self,
8492
clientObject.consider_in_deflection_design_y = support_in_y[1]
8593
clientObject.design_support_orientation_y = support_in_y[2].name
8694
clientObject.support_width_y = support_in_y[3]
95+
8796
if len(support_in_y) == 5:
8897
clientObject.support_depth_by_section_width_of_member_y_enabled = False
8998
clientObject.support_depth_y = support_in_y[4]
99+
90100
elif len(support_in_y) == 4:
91101
clientObject.support_depth_by_section_width_of_member_y_enabled = True
102+
92103
else:
93104
raise ValueError('WARNING!: The suport in Y parameter needs to be length of 4 or 5. Kindly check list inputs for completeness and correctness.')
94105

@@ -116,3 +127,261 @@ def __init__(self,
116127

117128
# Add Design Support to client model
118129
model.clientModel.service.set_design_support(clientObject)
130+
131+
@staticmethod
132+
def Concrete(no: int = 1,
133+
members: str = '1',
134+
member_sets: str = None,
135+
nodes: str = '1 2',
136+
support_in_z: list = [True, True, True, True, 1.0, 0.1],
137+
support_in_y: bool = True,
138+
name: str = None,
139+
comment: str = '',
140+
params: dict = None,
141+
model = Model):
142+
143+
'''
144+
Design Support Type Concrete
145+
146+
Args:
147+
no (int): Design Support Tag
148+
members (str): Assigned Members
149+
member_sets (str): Assigned Member Sets
150+
nodes (str): Assigned Nodes
151+
support_in_z (list): List of Parameters for Support in Z Axis
152+
for deactive support in z:
153+
support_in_z (bool): Deactivate support in Z (= False/None)
154+
for active support in z/y:
155+
support_in_z[0] (bool): Activate Support in Z (= True)
156+
support_in_z[1] (bool): Consider Support in Deflection Design Z
157+
support_in_z[2] (bool): Active/Deactive Direct Support Z
158+
support_in_z[3] (bool): Active/Deactive Concrete Monolithic Connection Z
159+
for inner_support_z_enabled == True:
160+
support_in_z[4] (float): Concrete Ratio of Moment Redistribution Z (It must be in between 0.65 and 1.0)
161+
for inner_support_z_enabled == False:
162+
support_in_z[4] (bool): Deactivate Inner Support in Z (= False)
163+
support_in_z[5] (float): Support Width Z (in meter)
164+
for manual support depth:
165+
support_in_z[6] (float): Support Depth Z (in meter)
166+
support_in_y (bool): Consider Support in Y Axis for Deflection Design (= True/False)
167+
name (str, option): User Defined Design Support Name
168+
comment (str, optional): Comment
169+
params (dict, optional): Any WS Parameter relevant to the object and its value in form of a dictionary
170+
model (RFEM Class, optional): Model to be edited
171+
'''
172+
173+
# Client model | Design Support
174+
clientObject = model.clientModel.factory.create('ns0:design_support')
175+
176+
# Clears object atributes | Sets all atributes to None
177+
clearAttributes(clientObject)
178+
179+
# Design Support No.
180+
clientObject.no = no
181+
182+
# Design Support Type
183+
clientObject.type = 'DESIGN_SUPPORT_TYPE_CONCRETE'
184+
185+
# Assigned Members (e.g. '5 6 7 12')
186+
if members:
187+
clientObject.assigned_to_members = ConvertToDlString(members)
188+
189+
# Assigned Member Sets (e.g. '5 6 7 12')
190+
if member_sets:
191+
clientObject.assigned_to_member_sets = ConvertToDlString(member_sets)
192+
193+
# Assigned Nodes (e.g. '5 6 7 12')
194+
clientObject.assigned_to_nodes = ConvertToDlString(nodes)
195+
196+
# Support in Z
197+
if isinstance(support_in_z, list) and support_in_z[0] == True:
198+
clientObject.activate_in_z = support_in_z[0]
199+
clientObject.consider_in_deflection_design_z = support_in_z[1]
200+
clientObject.direct_support_z_enabled = support_in_z[2]
201+
clientObject.concrete_monolithic_connection_z_enabled = support_in_z[3]
202+
203+
if isinstance(support_in_z[4], bool) and support_in_z[4] == False:
204+
clientObject.inner_support_z_enabled = False
205+
206+
elif isinstance(support_in_z[4], (float, int)) and (0.65 <= support_in_z[4] <= 1):
207+
clientObject.inner_support_z_enabled = True
208+
clientObject.concrete_ratio_of_moment_redistribution_z = support_in_z[4]
209+
210+
else:
211+
raise ValueError('WARNING!: The concrete ratio of moment redistribution in Z parameter must be between 0.65 and 1.0. Kindly check list inputs for completeness and correctness.')
212+
213+
clientObject.support_width_z = support_in_z[5]
214+
215+
if len(support_in_z) == 7:
216+
clientObject.support_depth_by_section_width_of_member_z_enabled = False
217+
clientObject.support_depth_z = support_in_z[6]
218+
219+
elif len(support_in_z) == 6:
220+
clientObject.support_depth_by_section_width_of_member_z_enabled = True
221+
222+
else:
223+
raise ValueError('WARNING!: The suport in Z parameter needs to be length of 4 or 5. Kindly check list inputs for completeness and correctness.')
224+
225+
elif support_in_z == None or support_in_z == False:
226+
clientObject.activate_in_z = False
227+
228+
else:
229+
raise TypeError("WARNING! First parameter of list must be type bool. Kindly check list inputs completeness and correctness.")
230+
231+
# Support in Y
232+
if isinstance(support_in_y, bool) and support_in_y == True:
233+
clientObject.activate_in_y = True
234+
clientObject.consider_in_deflection_design_y = True
235+
236+
elif support_in_y == None or support_in_y == False:
237+
clientObject.activate_in_y = False
238+
clientObject.consider_in_deflection_design_y = False
239+
240+
else:
241+
raise TypeError("WARNING! Parameter must be type bool. Kindly check input completeness and correctness.")
242+
243+
# User Defined Name
244+
if name:
245+
clientObject.user_defined_name_enabled = True
246+
clientObject.name = name
247+
248+
# Comment
249+
clientObject.comment = comment
250+
251+
# Adding optional parameters via dictionary
252+
if params:
253+
for key in params:
254+
clientObject[key] = params[key]
255+
256+
# Delete None attributes for improved performance
257+
deleteEmptyAttributes(clientObject)
258+
259+
# Add Design Support to client model
260+
model.clientModel.service.set_design_support(clientObject)
261+
262+
@staticmethod
263+
def Steel(no: int = 1,
264+
members: str = '1',
265+
member_sets: str = None,
266+
nodes: str = '1 2',
267+
support_in_z: list = [True, True, DesignSupportOrientationZType.DESIGN_SUPPORT_ORIENTATION_ZAXIS_POSITIVE, 0.01, 0.2, 0.25],
268+
support_in_y: list = None,
269+
name: str = None,
270+
comment: str = '',
271+
params: dict = None,
272+
model = Model):
273+
274+
'''
275+
Design Support Type Steel
276+
277+
Args:
278+
no (int): Design Support Tag
279+
members (str): Assigned Members
280+
member_sets (str): Assigned Member Sets
281+
nodes (str): Assigned Nodes
282+
support_in_z (list/bool): List of Parameters for Support in Z Axis
283+
for deactive support in z:
284+
support_in_z (bool): Deactivate support in Z (= False/None)
285+
for active support in z/y:
286+
support_in_z[0] (bool): Activate Support in Z (= True)
287+
support_in_z[1] (bool): Consider Support in Deflection Design Z
288+
support_in_z[2] (enum): Design Support Orientation Z Type Enumeration
289+
for end_support_z_enabled == True:
290+
support_in_z[3] (float): Overhanging Length for Support Z (in meter)
291+
for end_support_z_enabled == False:
292+
support_in_z[3] (bool): Deactivate End Support in Z (= False)
293+
support_in_z[4] (float): Support Width Z (in meter)
294+
for manual support depth:
295+
support_in_z[5] (float): Support Depth Z (in meter)
296+
support_in_y (bool): Consider Support in Y Axis for Deflection Design (= True/False)
297+
name (str, option): User Defined Design Support Name
298+
comment (str, optional): Comment
299+
params (dict, optional): Any WS Parameter relevant to the object and its value in form of a dictionary
300+
model (RFEM Class, optional): Model to be edited
301+
'''
302+
303+
# Client model | Design Support
304+
clientObject = model.clientModel.factory.create('ns0:design_support')
305+
306+
# Clears object atributes | Sets all atributes to None
307+
clearAttributes(clientObject)
308+
309+
# Design Support No.
310+
clientObject.no = no
311+
312+
# Design Support Type
313+
clientObject.type = 'DESIGN_SUPPORT_TYPE_STEEL'
314+
315+
# Assigned Members (e.g. '5 6 7 12')
316+
if members:
317+
clientObject.assigned_to_members = ConvertToDlString(members)
318+
319+
# Assigned Member Sets (e.g. '5 6 7 12')
320+
if member_sets:
321+
clientObject.assigned_to_member_sets = ConvertToDlString(member_sets)
322+
323+
# Assigned Nodes (e.g. '5 6 7 12')
324+
clientObject.assigned_to_nodes = ConvertToDlString(nodes)
325+
326+
# Support in Z
327+
if isinstance(support_in_z, list) and support_in_z[0] == True:
328+
clientObject.activate_in_z = support_in_z[0]
329+
clientObject.consider_in_deflection_design_z = support_in_z[1]
330+
clientObject.design_support_orientation_z = support_in_z[2].name
331+
332+
if isinstance(support_in_z[3], bool) and support_in_z[3] == False:
333+
clientObject.end_support_z_enabled = False
334+
335+
elif isinstance(support_in_z[3], (float, int)):
336+
clientObject.end_support_z_enabled = True
337+
clientObject.overhang_length_z = support_in_z[3]
338+
339+
else:
340+
raise ValueError('WARNING!: Invalid list of parameters. Kindly check list inputs for completeness and correctness.')
341+
342+
clientObject.support_width_z = support_in_z[4]
343+
344+
if len(support_in_z) == 6:
345+
clientObject.support_depth_by_section_width_of_member_z_enabled = False
346+
clientObject.support_depth_z = support_in_z[5]
347+
348+
elif len(support_in_z) == 5:
349+
clientObject.support_depth_by_section_width_of_member_z_enabled = True
350+
351+
else:
352+
raise ValueError('WARNING!: The suport in Z parameter needs to be length of 4 or 5. Kindly check list inputs for completeness and correctness.')
353+
354+
elif support_in_z == None or support_in_z == False:
355+
clientObject.activate_in_z = False
356+
357+
else:
358+
raise TypeError("WARNING! First parameter of list must be type bool. Kindly check list inputs completeness and correctness.")
359+
360+
# Support in Y
361+
if isinstance(support_in_y, bool) and support_in_y == True:
362+
clientObject.consider_in_deflection_design_y = True
363+
364+
elif support_in_y == None or support_in_y == False:
365+
clientObject.consider_in_deflection_design_y = False
366+
367+
else:
368+
raise TypeError("WARNING! Parameter must be type bool. Kindly check input completeness and correctness.")
369+
370+
# User Defined Name
371+
if name:
372+
clientObject.user_defined_name_enabled = True
373+
clientObject.name = name
374+
375+
# Comment
376+
clientObject.comment = comment
377+
378+
# Adding optional parameters via dictionary
379+
if params:
380+
for key in params:
381+
clientObject[key] = params[key]
382+
383+
# Delete None attributes for improved performance
384+
deleteEmptyAttributes(clientObject)
385+
386+
# Add Design Support to client model
387+
model.clientModel.service.set_design_support(clientObject)

0 commit comments

Comments
 (0)