diff --git a/Examples/SteelDesign/SteelDesignExcel.py b/Examples/SteelDesign/SteelDesignExcel.py index 1042b9d7..a9421387 100644 --- a/Examples/SteelDesign/SteelDesignExcel.py +++ b/Examples/SteelDesign/SteelDesignExcel.py @@ -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 @@ -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) @@ -377,8 +379,8 @@ 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 @@ -386,37 +388,37 @@ def main(): # 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 @@ -429,6 +431,7 @@ def main(): # Calculation print("Calculation started...") + Model.clientModel.service.generate_load_cases_and_combinations() Calculate_all() print("Done!") @@ -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))