Skip to content

Commit e7221d4

Browse files
Update designSupport.py
1 parent 95229c4 commit e7221d4

1 file changed

Lines changed: 161 additions & 7 deletions

File tree

RFEM/TypesForMembers/designSupport.py

Lines changed: 161 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from RFEM.initModel import Model, clearAttributes, deleteEmptyAttributes, ConvertToDlString
2-
from RFEM.enums import DesignSupportOrientationZType
2+
from RFEM.enums import DesignSupportOrientationZType, DesignSupportOrientationYType
33

44
class DesignSupport():
55

@@ -151,11 +151,11 @@ def Concrete(no: int = 1,
151151
support_in_z (list): List of Parameters for Support in Z Axis
152152
for deactive support in z:
153153
support_in_z (bool): Deactivate support in Z (= False/None)
154-
for active support in z/y:
154+
for active support in z:
155155
support_in_z[0] (bool): Activate Support in Z (= True)
156156
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
157+
support_in_z[2] (bool): Enable/Disable Direct Support Z
158+
support_in_z[3] (bool): Enable/Disable Concrete Monolithic Connection Z
159159
for inner_support_z_enabled == True:
160160
support_in_z[4] (float): Concrete Ratio of Moment Redistribution Z (It must be in between 0.65 and 1.0)
161161
for inner_support_z_enabled == False:
@@ -220,7 +220,7 @@ def Concrete(no: int = 1,
220220
clientObject.support_depth_by_section_width_of_member_z_enabled = True
221221

222222
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.')
223+
raise ValueError('WARNING!: The suport in Z parameter needs to be length of 6 or 7. Kindly check list inputs for completeness and correctness.')
224224

225225
elif support_in_z == None or support_in_z == False:
226226
clientObject.activate_in_z = False
@@ -282,7 +282,7 @@ def Steel(no: int = 1,
282282
support_in_z (list/bool): List of Parameters for Support in Z Axis
283283
for deactive support in z:
284284
support_in_z (bool): Deactivate support in Z (= False/None)
285-
for active support in z/y:
285+
for active support in z:
286286
support_in_z[0] (bool): Activate Support in Z (= True)
287287
support_in_z[1] (bool): Consider Support in Deflection Design Z
288288
support_in_z[2] (enum): Design Support Orientation Z Type Enumeration
@@ -349,7 +349,7 @@ def Steel(no: int = 1,
349349
clientObject.support_depth_by_section_width_of_member_z_enabled = True
350350

351351
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.')
352+
raise ValueError('WARNING!: The suport in Z parameter needs to be length of 5 or 6. Kindly check list inputs for completeness and correctness.')
353353

354354
elif support_in_z == None or support_in_z == False:
355355
clientObject.activate_in_z = False
@@ -385,3 +385,157 @@ def Steel(no: int = 1,
385385

386386
# Add Design Support to client model
387387
model.clientModel.service.set_design_support(clientObject)
388+
389+
@staticmethod
390+
def Timber(no: int = 1,
391+
members: str = '1',
392+
member_sets: str = None,
393+
nodes: str = '1 2',
394+
support_in_z: list = [True, True, True, True, DesignSupportOrientationZType.DESIGN_SUPPORT_ORIENTATION_ZAXIS_POSITIVE, True, 1.25, 0.2, 0.25],
395+
support_in_y: list = [True, False, True, True, DesignSupportOrientationYType.DESIGN_SUPPORT_ORIENTATION_YAXIS_BOTH],
396+
name: str = None,
397+
comment: str = '',
398+
params: dict = None,
399+
model = Model):
400+
401+
'''
402+
Design Support Type Timber
403+
404+
Args:
405+
no (int): Design Support Tag
406+
members (str): Assigned Members
407+
member_sets (str): Assigned Member Sets
408+
nodes (str): Assigned Nodes
409+
support_in_z (list/bool): List of Parameters for Support in Z Axis
410+
support_in_y (list/bool): List of Parameters for Support in Y Axis
411+
for deactive support in z/y:
412+
support_in_z/y (bool): Deactivate support in Z/Y (= False/None)
413+
for active support in z/y:
414+
support_in_z/y[0] (bool): Activate Support in Z/Y (= True)
415+
support_in_z/y[1] (bool): Enable/Disable Direct Support in Z/Y
416+
support_in_z/y[2] (bool): Enable/Disable Inner Support in Z/Y
417+
support_in_z/y[3] (bool): Consider Support in Deflection Design Z/Y
418+
support_in_z/y[4] (enum): Design Support Orientation Z/Y Type Enumeration
419+
--> if direct support in z/y is enabled: (support_in_z/y[1] == True)
420+
support_in_z/y[5] (bool): Consider Support in Fire Design Z/Y
421+
support_in_z/y[6] (float): Timber Factor of Compression Z/Y (It must be in between 1.0 and 2.2)
422+
support_in_z/y[7] (float): Support Width Z/Y (in meter)
423+
for manual support depth:
424+
support_in_z/y[8] (float): Support Depth Z/Y (in meter)
425+
name (str, option): User Defined Design Support Name
426+
comment (str, optional): Comment
427+
params (dict, optional): Any WS Parameter relevant to the object and its value in form of a dictionary
428+
model (RFEM Class, optional): Model to be edited
429+
'''
430+
431+
# Client model | Design Support
432+
clientObject = model.clientModel.factory.create('ns0:design_support')
433+
434+
# Clears object atributes | Sets all atributes to None
435+
clearAttributes(clientObject)
436+
437+
# Design Support No.
438+
clientObject.no = no
439+
440+
# Design Support Type
441+
clientObject.type = 'DESIGN_SUPPORT_TYPE_TIMBER'
442+
443+
# Assigned Members (e.g. '5 6 7 12')
444+
if members:
445+
clientObject.assigned_to_members = ConvertToDlString(members)
446+
447+
# Assigned Member Sets (e.g. '5 6 7 12')
448+
if member_sets:
449+
clientObject.assigned_to_member_sets = ConvertToDlString(member_sets)
450+
451+
# Assigned Nodes (e.g. '5 6 7 12')
452+
clientObject.assigned_to_nodes = ConvertToDlString(nodes)
453+
454+
# Support in Z
455+
if isinstance(support_in_z, list) and support_in_z[0] == True:
456+
clientObject.activate_in_z = support_in_z[0]
457+
clientObject.direct_support_z_enabled = support_in_z[1]
458+
clientObject.inner_support_z_enabled = support_in_z[2]
459+
clientObject.consider_in_deflection_design_z = support_in_z[3]
460+
clientObject.design_support_orientation_z = support_in_z[4].name
461+
462+
if support_in_z[1] == True:
463+
clientObject.consider_in_fire_design_z = support_in_z[5]
464+
465+
if (1.0 <= support_in_z[6] <= 2.20):
466+
clientObject.timber_factor_of_compression_z = support_in_z[6]
467+
468+
else:
469+
raise ValueError('WARNING!: The timber factor of compression in Z parameter must be between 1.0 and 2.2. Kindly check list inputs for completeness and correctness.')
470+
471+
clientObject.support_width_z = support_in_z[7]
472+
473+
if len(support_in_z) == 9:
474+
clientObject.support_depth_by_section_width_of_member_z_enabled = False
475+
clientObject.support_depth_z = support_in_z[8]
476+
477+
elif len(support_in_z) == 8:
478+
clientObject.support_depth_by_section_width_of_member_z_enabled = True
479+
480+
else:
481+
raise ValueError('WARNING!: The suport in Z parameter needs to be length of 8 or 9. Kindly check list inputs for completeness and correctness.')
482+
483+
elif support_in_z == None or support_in_z == False:
484+
clientObject.activate_in_z = False
485+
486+
else:
487+
raise TypeError("WARNING! First parameter of support in Z list must be type bool. Kindly check list inputs completeness and correctness.")
488+
489+
# Support in Y
490+
if isinstance(support_in_y, list) and support_in_y[0] == True:
491+
clientObject.activate_in_y = support_in_y[0]
492+
clientObject.direct_support_y_enabled = support_in_y[1]
493+
clientObject.inner_support_y_enabled = support_in_y[2]
494+
clientObject.consider_in_deflection_design_y = support_in_y[3]
495+
clientObject.design_support_orientation_y = support_in_y[4].name
496+
497+
if support_in_y[1] == True:
498+
clientObject.consider_in_fire_design_y = support_in_y[5]
499+
500+
if (1.0 <= support_in_y[6] <= 2.20):
501+
clientObject.timber_factor_of_compression_y = support_in_y[6]
502+
503+
else:
504+
raise ValueError('WARNING!: The timber factor of compression in Y parameter must be between 1.0 and 2.2. Kindly check list inputs for completeness and correctness.')
505+
506+
clientObject.support_width_y = support_in_y[7]
507+
508+
if len(support_in_y) == 9:
509+
clientObject.support_depth_by_section_width_of_member_y_enabled = False
510+
clientObject.support_depth_y = support_in_y[8]
511+
512+
elif len(support_in_y) == 8:
513+
clientObject.support_depth_by_section_width_of_member_y_enabled = True
514+
515+
else:
516+
raise ValueError('WARNING!: The suport in Y parameter needs to be length of 8 or 9. Kindly check list inputs for completeness and correctness.')
517+
518+
elif support_in_y == None or support_in_y == False:
519+
clientObject.activate_in_y = False
520+
521+
else:
522+
raise TypeError("WARNING! First parameter of support in Y list must be type bool. Kindly check list inputs completeness and correctness.")
523+
524+
# User Defined Name
525+
if name:
526+
clientObject.user_defined_name_enabled = True
527+
clientObject.name = name
528+
529+
# Comment
530+
clientObject.comment = comment
531+
532+
# Adding optional parameters via dictionary
533+
if params:
534+
for key in params:
535+
clientObject[key] = params[key]
536+
537+
# Delete None attributes for improved performance
538+
deleteEmptyAttributes(clientObject)
539+
540+
# Add Design Support to client model
541+
model.clientModel.service.set_design_support(clientObject)

0 commit comments

Comments
 (0)