Skip to content

Commit

Permalink
Merge pull request #403 from dlubal-software/Rebecca_bugfix_example
Browse files Browse the repository at this point in the history
Bugfix for SteelDesignExcel example
  • Loading branch information
heetrojivadiya authored Nov 18, 2024
2 parents f20b495 + 54a2085 commit 73b21e4
Showing 1 changed file with 32 additions and 28 deletions.
60 changes: 32 additions & 28 deletions Examples/SteelDesign/SteelDesignExcel.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
sys.path.append(dirName + r'/../..')

from RFEM.enums import *
from RFEM.initModel import Model, SetAddonStatus, insertSpaces, Calculate_all, client
from RFEM.initModel import Model, SetAddonStatus, insertSpaces, Calculate_all, connectToServer, connectionGlobals
from RFEM.BasicObjects.material import Material
from RFEM.BasicObjects.section import Section
from RFEM.BasicObjects.node import Node
Expand Down Expand Up @@ -131,13 +131,15 @@ def main():
bracingH = True

# Creating Model

connectToServer()
lst = None
lst = client.service.get_model_list()
lst = connectionGlobals.client.service.get_model_list()

if lst:
if 'SteelHallExcel' in lst[0]:
print('Closing old Model...!')
client.service.close_model(0, False)
connectionGlobals.client.service.close_model(0, False)
print('Creating new model...!')
Model(True, 'SteelHallExcel.rf6', delete_all= True)

Expand Down Expand Up @@ -377,46 +379,46 @@ def main():
# Creating Loads for LC2:Live Load
n, k, l = 0, 0, 0
for j in range(frame_number):
MemberLoad(n+1, 2, str(k+3), NodalLoadDirection.LOAD_DIRECTION_GLOBAL_Z_OR_USER_DEFINED_W_TRUE, 3500)
MemberLoad(n+2, 2, str(k+4), NodalLoadDirection.LOAD_DIRECTION_GLOBAL_Z_OR_USER_DEFINED_W_TRUE, 3500)
MemberLoad(n+1, 2, str(k+3), MemberLoadDirection.LOAD_DIRECTION_GLOBAL_Z_OR_USER_DEFINED_W_TRUE, 3500)
MemberLoad(n+2, 2, str(k+4), MemberLoadDirection.LOAD_DIRECTION_GLOBAL_Z_OR_USER_DEFINED_W_TRUE, 3500)
NodalLoad.Components(n+1, 2, str(l+8), [0,0,10000,0,0,0])
NodalLoad.Components(n+2, 2, str(l+9), [0,0,10000,0,0,0])
n, k, l = n+2, k+13, l+9

# Creating Loads for LC3:Snow Load
n, k = 0, 0
for j in range(frame_number):
MemberLoad(n+1, 3, str(k+3), NodalLoadDirection.LOAD_DIRECTION_GLOBAL_Z_OR_USER_DEFINED_W_PROJECTED, 1500)
MemberLoad(n+2, 3, str(k+4), NodalLoadDirection.LOAD_DIRECTION_GLOBAL_Z_OR_USER_DEFINED_W_PROJECTED, 1500)
MemberLoad(n+1, 3, str(k+3), MemberLoadDirection.LOAD_DIRECTION_GLOBAL_Z_OR_USER_DEFINED_W_TRUE, 1500)
MemberLoad(n+2, 3, str(k+4), MemberLoadDirection.LOAD_DIRECTION_GLOBAL_Z_OR_USER_DEFINED_W_TRUE, 1500)
n, k = n+2, k+13

# Creating Loads for LC4:Wind-Load_x
n, k = 0, 0
for j in range(frame_number):
MemberLoad(n+1, 4, str(k+1), NodalLoadDirection.LOAD_DIRECTION_GLOBAL_X_OR_USER_DEFINED_U_TRUE, 2000)
MemberLoad(n+2, 4, str(k+2), NodalLoadDirection.LOAD_DIRECTION_GLOBAL_X_OR_USER_DEFINED_U_TRUE, 2000)
MemberLoad(n+3, 4, str(k+5), NodalLoadDirection.LOAD_DIRECTION_GLOBAL_X_OR_USER_DEFINED_U_TRUE, 2000)
MemberLoad(n+4, 4, str(k+6), NodalLoadDirection.LOAD_DIRECTION_GLOBAL_X_OR_USER_DEFINED_U_TRUE, 2000)
MemberLoad(n+1, 4, str(k+1), MemberLoadDirection.LOAD_DIRECTION_GLOBAL_Z_OR_USER_DEFINED_W_TRUE, 2000)
MemberLoad(n+2, 4, str(k+2), MemberLoadDirection.LOAD_DIRECTION_GLOBAL_Z_OR_USER_DEFINED_W_TRUE, 2000)
MemberLoad(n+3, 4, str(k+5), MemberLoadDirection.LOAD_DIRECTION_GLOBAL_Z_OR_USER_DEFINED_W_TRUE, 2000)
MemberLoad(n+4, 4, str(k+6), MemberLoadDirection.LOAD_DIRECTION_GLOBAL_Z_OR_USER_DEFINED_W_TRUE, 2000)
n, k = n+4, k+13

k = 0
for j in range(frame_number-1):
MemberLoad(n+1, 4, str(k+9), NodalLoadDirection.LOAD_DIRECTION_GLOBAL_X_OR_USER_DEFINED_U_TRUE, 1500)
MemberLoad(n+2, 4, str(k+10), NodalLoadDirection.LOAD_DIRECTION_GLOBAL_X_OR_USER_DEFINED_U_TRUE, 1500)
MemberLoad(n+3, 4, str(k+11), NodalLoadDirection.LOAD_DIRECTION_GLOBAL_X_OR_USER_DEFINED_U_TRUE, 1500)
MemberLoad(n+4, 4, str(k+12), NodalLoadDirection.LOAD_DIRECTION_GLOBAL_X_OR_USER_DEFINED_U_TRUE, 1500)
MemberLoad(n+5, 4, str(k+13), NodalLoadDirection.LOAD_DIRECTION_GLOBAL_X_OR_USER_DEFINED_U_TRUE, 1500)
MemberLoad(n+1, 4, str(k+9), MemberLoadDirection.LOAD_DIRECTION_GLOBAL_X_OR_USER_DEFINED_U_TRUE, 1500)
MemberLoad(n+2, 4, str(k+10), MemberLoadDirection.LOAD_DIRECTION_GLOBAL_X_OR_USER_DEFINED_U_TRUE, 1500)
MemberLoad(n+3, 4, str(k+11), MemberLoadDirection.LOAD_DIRECTION_GLOBAL_X_OR_USER_DEFINED_U_TRUE, 1500)
MemberLoad(n+4, 4, str(k+12), MemberLoadDirection.LOAD_DIRECTION_GLOBAL_X_OR_USER_DEFINED_U_TRUE, 1500)
MemberLoad(n+5, 4, str(k+13), MemberLoadDirection.LOAD_DIRECTION_GLOBAL_X_OR_USER_DEFINED_U_TRUE, 1500)
n, k = n+5, k+13

# Creating Loads for LC5:Wind-Load_y
n, k = 0, 0
for j in range(frame_number):
MemberLoad(n+1, 5, str(k+1), NodalLoadDirection.LOAD_DIRECTION_GLOBAL_Y_OR_USER_DEFINED_V_TRUE, 1500)
MemberLoad(n+2, 5, str(k+2), NodalLoadDirection.LOAD_DIRECTION_GLOBAL_Y_OR_USER_DEFINED_V_TRUE, 1500)
MemberLoad(n+3, 5, str(k+3), NodalLoadDirection.LOAD_DIRECTION_GLOBAL_Y_OR_USER_DEFINED_V_TRUE, 2500)
MemberLoad(n+4, 5, str(k+4), NodalLoadDirection.LOAD_DIRECTION_GLOBAL_Y_OR_USER_DEFINED_V_TRUE, 2500)
MemberLoad(n+5, 5, str(k+5), NodalLoadDirection.LOAD_DIRECTION_GLOBAL_Y_OR_USER_DEFINED_V_TRUE, 1500)
MemberLoad(n+6, 5, str(k+6), NodalLoadDirection.LOAD_DIRECTION_GLOBAL_Y_OR_USER_DEFINED_V_TRUE, 1500)
MemberLoad(n+1, 5, str(k+1), MemberLoadDirection.LOAD_DIRECTION_GLOBAL_Y_OR_USER_DEFINED_V_TRUE, 1500)
MemberLoad(n+2, 5, str(k+2), MemberLoadDirection.LOAD_DIRECTION_GLOBAL_Y_OR_USER_DEFINED_V_TRUE, 1500)
MemberLoad(n+3, 5, str(k+3), MemberLoadDirection.LOAD_DIRECTION_GLOBAL_Y_OR_USER_DEFINED_V_TRUE, 2500)
MemberLoad(n+4, 5, str(k+4), MemberLoadDirection.LOAD_DIRECTION_GLOBAL_Y_OR_USER_DEFINED_V_TRUE, 2500)
MemberLoad(n+5, 5, str(k+5), MemberLoadDirection.LOAD_DIRECTION_GLOBAL_Y_OR_USER_DEFINED_V_TRUE, 1500)
MemberLoad(n+6, 5, str(k+6), MemberLoadDirection.LOAD_DIRECTION_GLOBAL_Y_OR_USER_DEFINED_V_TRUE, 1500)
n, k = n+6, k+13

# Creating Steel Design Configuration
Expand All @@ -429,6 +431,7 @@ def main():

# Calculation
print("Calculation started...")
Model.clientModel.service.generate_load_cases_and_combinations()
Calculate_all()
print("Done!")

Expand Down Expand Up @@ -464,12 +467,13 @@ def main():
nodeType = '-'
if (j+1) in nodes_no:
nodeType = 'Hinged'
nodesupforce_x = GetMaxValue(dispTab, 'support_forces_p_x')
nodesupforce_y = GetMaxValue(dispTab, 'support_forces_p_y')
nodesupforce_z = GetMaxValue(dispTab, 'support_forces_p_z')
nodemom_x = GetMaxValue(dispTab, 'support_moments_m_x')
nodemom_y = GetMaxValue(dispTab, 'support_moments_m_y')
nodemom_z = GetMaxValue(dispTab, 'support_moments_m_z')
supportForceTab = ResultTables.NodesSupportForces(CaseObjectType.E_OBJECT_TYPE_LOAD_COMBINATION, 7, j+1)
nodesupforce_x = GetMaxValue(supportForceTab, 'support_force_p_x')
nodesupforce_y = GetMaxValue(supportForceTab, 'support_force_p_y')
nodesupforce_z = GetMaxValue(supportForceTab, 'support_force_p_z')
nodemom_x = GetMaxValue(supportForceTab, 'support_moment_m_x')
nodemom_y = GetMaxValue(supportForceTab, 'support_moment_m_y')
nodemom_z = GetMaxValue(supportForceTab, 'support_moment_m_z')
nodeSupportForce_x.append(round(nodesupforce_x, 3))
nodeSupportForce_y.append(round(nodesupforce_y, 3))
nodeSupportForce_z.append(round(nodesupforce_z, 3))
Expand Down

0 comments on commit 73b21e4

Please sign in to comment.