An automatic modeling and analysis method for tube trusses based on CAD and SAP2000
Through the RhinoGrasshopper and Python platforms, combined with CAD and SAP2000, the automated transmission of two-dimensional drawing information and structural calculation response is achieved, solving the problem of insufficient information transmission in traditional methods, and significantly improving the efficiency and accuracy of structural design verification.
Patent Information
- Application Number
- CN202410169392.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-06
- Publication Date
- 2024-11-08
- Estimated Expiration
- 2044-02-06
AI Technical Summary
During the structural design verification process, traditional methods manually import drawing information into the structural analysis software, resulting in insufficient information transmission and inability to implement structural calculations, resulting in the modeling and analysis process being blocked.
Through RhinoGrasshopper and Python platforms, combined with CAD and SAP2000, the automatic transmission of two-dimensional drawing information and structural calculation response is realized, and an automated modeling and analysis method is constructed, and the model information is directly imported into SAP2000 for calculation.
Automatic generation and analysis of structural calculation models is realized, which significantly improves modeling and analysis efficiency, improves efficiency by about 95%, and simplifies operational steps to facilitate model reconstruction and verification by engineers.
Smart Images

Figure CN118094899B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of building structures, and in particular relates to an automatic modeling and analysis method for a pipe truss associated with CAD and SAP2000. Background Art
[0002] With the deep integration and development of technologies such as 5G, AI, and big data with the construction industry, a new round of scientific and technological revolution and industrial transformation in the construction industry is being deepened. The digital transformation and development of the survey and design industry has become a general trend. Informatization is the foundation of digital and intelligent development. However, in the process of structural design verification, we often face the problem of transferring drawing information to structural information, and obtaining mechanical response information from structural information calculation. The traditional method is to manually turn the mold and then import it into other structural analysis software. It is time-consuming and labor-intensive, and runs counter to the development direction of digital and intelligent design. The use of design methods such as parametric and automated allows engineering designers to reconstruct, calculate, and optimize structural models from multiple dimensions and levels, thereby improving work efficiency.
[0003] For structural design, the core of informatization and digitalization lies in the parametric transfer and automated calculation of structural information. Parametric transfer of structural information includes the transfer of unstructured data to structured data and the transfer between different structured data. Automated calculation of structural information includes the automated call of various types of finite element analysis software and the lightweight embedding of existing analysis software.
[0004] However, although the existing technical methods have a certain foundation in automatically generating structural models based on two-dimensional drawings, there is a large lag in automated calculation, which hinders the entire modeling and analysis process. The main reasons are as follows:
[0005] (1) Existing automated modeling methods mainly focus on geometric model construction, which easily ignores the transmission and input of physical information such as material properties, section types, loads, and boundary conditions, resulting in insufficient model information and the inability to perform structural calculations;
[0006] (2) After the model is built, the existing methods need to import the geometric model into other structural analysis software, and then set the parameters required for model calculation to complete the solution calculation. Therefore, there is no direct connection between the two-dimensional drawing information and the structural calculation response. Summary of the invention
[0007] In order to make up for the shortcomings of the prior art, the present invention provides an automatic modeling and analysis method for tube trusses that associates CAD and SAP2000. With the help of RhinoGrasshopper and Python platform, a bridge is built between two-dimensional drawing information and structural calculation response, model information is transmitted losslessly, and automatic establishment and calculation of the model are realized.
[0008] In order to achieve the above object, the technical solution adopted by the present invention is:
[0009] An automatic modeling and analysis method for a pipe truss by associating CAD and SAP2000, characterized in that it comprises the following steps:
[0010] Step 1: Arrange the CAD drawing of the two-dimensional tube truss plane to obtain the arranged tube truss plane drawing;
[0011] Step 2: Load the organized pipe truss plane drawing into Rhino software. In the RhinoGrasshopper environment, use the Guid battery to select all the bar layer texts in the drawing; use the Panel battery to set the cross-section information reading format; use the Curve battery to select all the bar layer lines in the drawing; use the Point battery to select the intersection of the layer lines used as constraint supports in the drawing; use the Point battery to select the intersection of the layer lines on which concentrated loads are applied in the drawing; use the Number Slider battery to set the constant load value; use the Number Slider battery to set the live load value; use the Number Slider battery to set the constant load combination value coefficient; use the Number Slider battery to set the live load combination value coefficient; use the Panel battery to set the SAP2000 program call path; use the Panel battery to set the SAP2000 model save path; use the Panel battery to set the SAP2000 model name; use the Panel battery to set the steel material type; use the BooleanToggle battery to set the program start Boolean switch;
[0012] Step 3: In the Rhino Grasshopper environment, compile and develop CAD to SAP2000 to automatically model and analyze the battery pack;
[0013] Step 4: Open the SAP2000 structural calculation software. In the Grasshopper environment, click the Boolean Toggle battery in step 2. The program calls SAP2000 to complete the model establishment and calculation.
[0014] Step 5: In the Grasshopper environment, use the Panel battery to connect the CAD compiled and developed in step 3 to the output end of the SAP2000 automatic modeling and analysis battery group to display the maximum structural displacement under constant load, live load, and load combination and its corresponding node number.
[0015] Furthermore, in the step 1, the organized plan drawing of the tube truss retains the layer lines and cross-sectional dimension markings required to characterize the components.
[0016] Further, the CAD automatically models and analyzes the battery pack to SAP2000, and its input parameters include: section information, which is connected to the Guid battery of all the bar layer texts in the above step 2; section naming method, which is connected to the Panel battery of the section information reading format in the above step 2; bar curve, which is connected to the Curve battery of all the bar layer lines in the above step 2; constraint node, which is connected to the Point battery of the layer line intersection point used as the constraint support in the above step 2; load application node, which is connected to the Point battery of the layer line intersection point where the concentrated load is applied in the above step 2; constant load, which is connected to the Number battery of the constant load value in the above step 2. Slider battery; live load, connected to the NumberSlider battery of the live load value in the above step 2; constant load coefficient, connected to the NumberSlider battery of the constant load coefficient in the above step 2; live load coefficient, connected to the NumberSlider battery of the live load coefficient in the above step 2; SAP2000 program path, connected to the Panel battery of the SAP2000 program call path in the above step 2; file save path, connected to the Panel battery of the SAP2000 model save path in the above step 2; model name, connected to the Panel battery of the SAP2000 model name in the above step 2; steel properties, connected to the Panel battery of the steel material type in the above step 2; start button, connected to the Boolean Toggle battery of the program start Boolean switch in the above step 2.
[0017] Furthermore, in step 3, the step of CAD to SAP2000 automated modeling and analysis specifically includes:
[0018] Step 3.1: Use C# Script battery to extract parameter text and parameter plane of section information input parameters; use GhPythonScript battery and ClearTree battery to convert parameter text into section name list; use GhPythonScript battery, Construct Point battery, Clear Tree battery to extract coordinates of center point of parameter plane, and convert them into list of center points of plane where section name text is located;
[0019] Step 3.2: Apply the Curve Nearest Object battery, and determine the center point of the plane where the section text is located closest to each curve from the list of plane center points where the section name text is located in the above step 1 according to the order of the curve list in the bar curve input variable; input parameters according to the section naming method, use the GhPython Script battery to extract the list of all bar diameters and the list of all bar wall thicknesses, and form a Data battery for the list of all bar diameters and a Data battery for the list of all bar wall thicknesses;
[0020] Step 3.3: Apply the Rotate 3D battery and the Unity battery to transform all the bar curves in the bar curve input variable from the XY plane to the YZ plane, and obtain a list of all bar curves after rotation; apply the EndPoints battery and the Deconstruct battery to extract the coordinates of the starting and ending points of the curves in the list of all bar curves after rotation, and form a Data battery of the list of X coordinates of all bar starting points, a Data battery of the list of Y coordinates of all bar starting points, a Data battery of the list of Z coordinates of all bar starting points, a Data battery of the list of X coordinates of all bar end points, a Data battery of the list of Y coordinates of all bar end points, and a Data battery of the list of Z coordinates of all bar end points;
[0021] Step 3.4: Use the Rotate 3D battery and the Unity battery to transform all points in the constraint node input variable from the XY plane to the YZ plane, and obtain a list of all constraint nodes after rotation; use the Deconstruct battery to extract the Data battery of the X coordinates of all constraint nodes, the Data battery of the Y coordinates of all constraint nodes, and the Data battery of the Z coordinates of all constraint nodes in the list of all constraint nodes after rotation;
[0022] Step 3.5: Use the Rotate 3D cell and the Unity cell to transform all points in the input variable of the applied load node from the XY plane to the YZ plane, and obtain the list of all applied load nodes after rotation; use the Deconstruct cell to extract the Data cell of the X coordinates of all applied load nodes, the Data cell of the Y coordinates of all applied load nodes, and the Data cell of the Z coordinates of all applied load nodes in the list of all applied load nodes after rotation;
[0023] Step 3.6: Apply the GH_CPython battery, call the SAP2000 API modeling calculation through the Python language, complete the structural analysis, and obtain the GH_CPython battery that calls the SAP2000 API modeling calculation.
[0024] Furthermore, in step 3.6, the input parameters of the GH_CPython battery obtained by calling the SAP2000 API modeling calculation specifically include the following:
[0025] 1) Diam, connected to the Data cell of the list of all rod diameters in step 3.2 above;
[0026] 2) Thin, connected to the Data cell of the list of all bar wall thicknesses in step 3.2 above;
[0027] 3) Node_X_S, connected to the Data cell of the X coordinate list of all the rod start points in step 3.3 above;
[0028] 4) Node_Y_S, connected to the Data cell of the list of Y coordinates of all the starting points of the bars in step 3.3 above;
[0029] 5) Node_Z_S, connected to the Data cell of the Z coordinate list of all the rod start points in step 3.3 above;
[0030] 6) Node_X_E, connected to the Data cell of the X coordinate list of all the bar end points in step 3.3 above;
[0031] 7) Node_Y_E, connected to the Data cell of the Y coordinate list of all the bar end points in step 3.3 above;
[0032] 8) Node_Z_E, connected to the Data cell of the list of Z coordinates of all the end points of the bars in step 3.3 above;
[0033] 9) Node_Res_X, connected to the Data battery of all the constraint node X coordinates in step 3.4 above;
[0034] 10) Node_Res_Y, connected to the Data battery of all the constraint node Y coordinates in step 3.4 above;
[0035] 11) Node_Res_Z, connected to the Data battery of all the constrained node Z coordinates in step 3.4 above;
[0036] 12) Node_Load_X, connected to the Data battery of the X coordinates of all the load nodes applied in step 3.5 above;
[0037] 13) Node_Load_Y, connected to the Data battery of the Y coordinates of all the load nodes applied in step 3.5 above;
[0038] 14) Node_Load_Z, connected to the Data battery of the Z coordinates of all the load nodes applied in step 3.5 above;
[0039] 15) Load_Dead, connected to the dead load input parameter;
[0040] 16) Load_Live, connected to the live load input parameters;
[0041] 17) Dead_ComIndex, connected to the constant load factor input parameter;
[0042] 18) Live_ComIndex, connected to the live load factor input parameter;
[0043] 19) SAP_Path, connected to the SAP2000 program path input parameter;
[0044] 20) File_Path, connected to the file save path input parameter;
[0045] 21) Model_Name, connected to the model name input parameter;
[0046] 22) Model_Mat, connected to the steel material property input parameters;
[0047] 23) Run, connected to the start button input parameter.
[0048] Furthermore, in step 3.6, the steps of calling the SAP2000 API modeling calculation are as follows:
[0049] Step 3.6.1: In the GH_CPython battery environment, call the sys, comtypes.client, in32com.client, and os external libraries;
[0050] Step 3.6.2: Use os.path.exists to check whether the file save path File_Path exists. If it exists, skip it. If it does not exist, create a new path with File_Path. Use AttachToInstance to connect to the currently running SAP2000 program. If there is a running SAP2000 program, use comtypes.client.GetActiveObject("CSI.SAP2000.API.SapObject") to get the currently activated SAP2000 object and name it mySapObject. If it does not exist, an error message will be displayed.
[0051] Step 3.6.3: Use mySapObject.SapModel to create a SAP2000 model object named SapModel; use SapModel.InitializeNewModel to set the unit to N, mm; use SapModel.File.NewBlank to create a new blank model;
[0052] Step 3.6.4: Apply SapObject.SapModel.PropMaterial.SetMaterial to define a new material numbered 1 and named Model_Mat; SapObject.SapModel.PropMaterial.SetMPIsotropic sets the new material to an isotropic material with an elastic modulus of 206000 MPa and a Poisson's ratio of 0.2;
[0053] Step 3.6.5: Loop through the rod diameter list variable Diam and the rod wall thickness list variable Thin, and use SapModel.PropFrame.SetPipe to define the cross-section of the rod;
[0054] Step 3.6.6: Loop call the X coordinate list variable Node_X_S of the starting point of the bar, the Y coordinate list variable Node_Y_S of the starting point of the bar, the Z coordinate list variable Node_Z_S of the starting point of the bar, the X coordinate list variable Node_X_E of the end point of the bar, the Y coordinate list variable Node_Y_E of the end point of the bar, and the Z coordinate list variable Node_Z_E of the end point of the bar, and apply SapModel.FrameObj.AddByCoord to create the bar;
[0055] Step 3.6.7: Apply SapModel.FrameObj.SetReleases to release the rotational degrees of freedom at both ends of all members;
[0056] Step 3.6.8: Apply SapModel.FrameObj.GetPoints to obtain the starting point number of each member, apply SapModel.PointObj.GetCoordCartesian to obtain the spatial coordinates of the starting point number, and call the constraint node X coordinate variable Node_Res_X, constraint node Y coordinate variable Node_Res_Y, and constraint node Z coordinate variable Node_Res_Z cyclically to determine whether the spatial coordinates of the starting point number are consistent with the constraint node coordinates. If so, apply SapModel.PointObj.SetRestraint to constrain the translation of the point in the X, Y, and Z directions;
[0057] Step 3.6.9: Use SapModel.LoadPatterns.Add to add the dead load pattern and live load pattern; use SapModel.LoadCases.StaticLinear.SetCase to add the live load case; use SapModel.RespCombo.Add to create the load combination, use SapModel.RespCombo.SetCaseList to set the dead load combination value coefficient in the load combination to the dead load coefficient Dead_ComIndex, and use SapModel.RespCombo.SetCaseList to set the live load combination value coefficient in the load combination to the live load coefficient Live_ComIndex;
[0058] Step 3.6.10: Loop to obtain the Cartesian coordinates of the starting point and the end point of each member, and compare them with the X coordinate variable Node_Load_X, the Y coordinate variable Node_Load_Y, and the Z coordinate variable Node_Load_Z of the load-applying node. If the coordinates are consistent, apply SapModel.PointObj.SetLoadForce to apply a constant load of Load_Dead at this point along the negative direction of the Z axis, and apply SapModel.PointObj.SetLoadForce to apply a live load of Load_Live at this point along the negative direction of the Z axis;
[0059] Step 3.6.11: Use SapModel.File.Save to save the file; use SapModel.Analyze.SetActiveDOF to set the active degrees of freedom to the Y-axis degree of freedom, the Z-axis degree of freedom, and the degree of freedom around the X-axis; use SapModel.Analyze.RunAnalysis to start the analysis; use SapModel.PointObj.Count to determine the number of model nodes;
[0060] Step 3.6.12: Loop through each node and use SapModel.Results.Setup.SetCaseSelectedForOutput to select the load type of the output result as constant load; use SapModel.Results.JointDispl to extract the displacement of each node in the Z direction; compare the displacement of each node in the Z direction to determine the maximum displacement of the node under constant load and the corresponding node number;
[0061] Step 3.6.13): Loop through each node, apply SapModel.Results.Setup.SetCaseSelectedForOutput to select the load type of the output result as live load; apply SapModel.Results.JointDispl to extract the displacement of each node in the Z direction; compare the displacement of each node in the Z direction to determine the maximum displacement of the node under live load and the corresponding node number;
[0062] Step 3.6.14: Loop through each node and use SapModel.Results.Setup.SetCaseSelectedForOutput to select the load type of the output result as combined load; use SapModel.Results.JointDispl to extract the displacement of each node in the Z direction; compare the displacement of each node in the Z direction to determine the maximum displacement of the node under the combined load and the corresponding node number;
[0063] Step 3.6.15: Apply SapModel.View.RefreshView to update the SAP2000 program interface; define the output list variable output.
[0064] Furthermore, in the step 3.6.15, the maximum node displacement under constant load, the node number corresponding to the maximum displacement under constant load, the maximum node displacement under live load, the node number corresponding to the maximum displacement under live load, the maximum node displacement under load combination, and the node number corresponding to the maximum displacement under load combination are respectively derived through the output list variable output.
[0065] Beneficial effects of the present invention:
[0066] 1) The present invention realizes the automatic generation and analysis of structural calculation models based on two-dimensional drawing information;
[0067] 2) This invention significantly improves the efficiency of modeling and analysis, which is more than 95% higher than the manual method;
[0068] 3) The present invention has clear operation steps and simple usage, which is convenient for engineers to reconstruct and compare models. BRIEF DESCRIPTION OF THE DRAWINGS
[0069] Figure 1 It is the operation flow chart of the present invention;
[0070] Figure 2 The CAD of the present invention is used to automatically model and analyze the internal structure of the battery pack in SAP2000;
[0071] Figure 3 The calculation result of the steel truss is obtained based on the method of the present invention. DETAILED DESCRIPTION
[0072] The present invention is described in detail below in conjunction with specific implementation modes.
[0073] The present invention is used for automatic modeling and analysis of CAD two-dimensional drawings to SAP2000 three-dimensional structural models, such as Figure 1 As shown, the present invention comprises the following steps:
[0074] Step 1: Arrange the CAD drawing of the two-dimensional tube truss plane, retain the layer lines and cross-sectional dimension markings required to represent the components, and obtain the arranged tube truss plane drawing.
[0075] Step 2: Load the organized pipe truss plane drawing into the Rhino software, and create and set various parameter batteries in the RhinoGrasshopper environment. The obtained parameter battery is as follows:
[0076] 1) Use the Guid battery to select all the bar layer texts in the drawing;
[0077] 2) Use Panel battery to set the cross-section information reading format;
[0078] 3) Use Curve to select all the bar layer lines in the drawing;
[0079] 4) Use the Point tool to select the intersection of the layer lines in the drawing that serve as the constraint support;
[0080] 5) Use the Point cell to select the intersection of the layer lines where the concentrated load is applied in the drawing;
[0081] 6) Use the Number Slider battery to set the constant load value;
[0082] 7) Use the Number Slider cell to set the live load value;
[0083] 8) Use the Number Slider cell to set the constant load combination value coefficient;
[0084] 9) Use the Number Slider cell to set the live load combination value factor;
[0085] 10) Use Panel battery to set the SAP2000 program calling path;
[0086] 11) Use Panel battery to set the SAP2000 model saving path;
[0087] 12) Use Panel battery to set SAP2000 model name;
[0088] 13) Use Panel cell to set steel material type;
[0089] 14) Use the Boolean Toggle battery setup procedure to start the Boolean switch.
[0090] Step 3: In the Rhino Grasshopper environment, compile and develop CAD to SAP2000 to automatically model and analyze the battery pack ( Figure 2 ); The obtained CAD is used to automatically model and analyze the battery pack in SAP2000, and its input parameters include:
[0091] 1) Section information, connected to the Guid battery of all bar layer texts in the above step 2;
[0092] 2) Section naming method, which is connected to the Panel battery of the section information reading format in step 2 above;
[0093] 3) The bar curve is connected to the Curve cells of all bar layer lines in step 2 above;
[0094] 4) The constraint node is connected to the Point battery of the layer line intersection point used as the constraint support in the above step 2;
[0095] 5) The load application node is connected to the Point battery at the intersection of the layer lines where the concentrated load is applied in step 2 above;
[0096] 6) Constant load, connected to the Number Slider battery of the constant load value in step 2 above;
[0097] 7) Live load, connected to the Number Slider battery of the live load value in step 2 above;
[0098] 8) Constant load factor, connected to the NumberSlider battery of the constant load factor in step 2 above;
[0099] 9) Live load factor, connected to the NumberSlider battery of the live load factor in step 2 above;
[0100] 10) The SAP2000 program path is connected to the Panel battery of the SAP2000 program call path in step 2 above;
[0101] 11) The file save path is connected to the Panel battery of the SAP2000 model save path in step 2 above;
[0102] 12) Model name, connected to the Panel battery of the SAP2000 model name in step 2 above;
[0103] 13) Steel properties, connected to the Panel battery of the steel material type in step 2 above;
[0104] 14) Start button, connected to the Boolean Toggle battery of the program start Boolean switch in step 2 above.
[0105] The steps of CAD to SAP2000 automated modeling and analysis specifically include:
[0106] Step 3.1: Use C# Script battery to extract parameter text and parameter plane of section information input parameters; use GhPythonScript battery and ClearTree battery to convert parameter text into section name list; use GhPythonScript battery, Construct Point battery, Clear Tree battery to extract coordinates of center point of parameter plane, and convert them into list of center points of plane where section name text is located.
[0107] Step 3.2: Apply the Curve Nearest Object battery, and determine the plane center point of the section text closest to each curve from the list of plane center points of the section name text in the above step 1 in the order of the curve list in the bar curve input variable; input parameters according to the section naming method, use the GhPython Script battery to extract the list of all bar diameters and the list of all bar wall thicknesses, and form a Data battery for the list of all bar diameters and a Data battery for the list of all bar wall thicknesses.
[0108] Step 3.3: Use the Rotate 3D battery and the Unity battery to transform all the bar curves in the bar curve input variable from the XY plane to the YZ plane, and obtain a list of all bar curves after rotation; use the EndPoints battery and the Deconstruct battery to extract the coordinates of the start and end points of the curves in the list of all bar curves after rotation, and form a Data battery for the list of X coordinates of all bar start points, a Data battery for the list of Y coordinates of all bar start points, a Data battery for the list of Z coordinates of all bar start points, a Data battery for the list of X coordinates of all bar end points, a Data battery for the list of Y coordinates of all bar end points, and a Data battery for the list of Z coordinates of all bar end points.
[0109] Step 3.4: Use the Rotate 3D battery and the Unity battery to transform all points in the constraint node input variable from the XY plane to the YZ plane to obtain a list of all constraint nodes after rotation; use the Deconstruct battery to extract the Data battery of the X coordinates of all constraint nodes, the Data battery of the Y coordinates of all constraint nodes, and the Data battery of the Z coordinates of all constraint nodes in the list of all constraint nodes after rotation.
[0110] Step 3.5: Use the Rotate 3D cell and the Unity cell to transform all points in the input variable of the applied load node from the XY plane to the YZ plane to obtain a list of all applied load nodes after rotation; use the Deconstruct cell to extract the Data cell of the X coordinates of all applied load nodes, the Data cell of the Y coordinates of all applied load nodes, and the Data cell of the Z coordinates of all applied load nodes in the list of all applied load nodes after rotation.
[0111] Step 3.6: Apply the GH_CPython battery, call the SAP2000 API modeling calculation through the Python language, complete the structural analysis, and obtain the GH_CPython battery that calls the SAP2000 API modeling calculation. The input parameters of the obtained GH_CPython battery that calls the SAP2000 API modeling calculation include the following:
[0112] 1) Diam, connected to the Data cell of the list of all rod diameters in step 2 above;
[0113] 2) Thin, connected to the Data cell of the list of all bar wall thicknesses in step 2 above;
[0114] 3) Node_X_S, connected to the Data cell of the X coordinate list of all the rod start points in step 3 above;
[0115] 4) Node_Y_S, connected to the Data cell of the list of Y coordinates of all the starting points of the bars in step 3 above;
[0116] 5) Node_Z_S, connected to the Data cell of the Z coordinate list of all the rod start points in step 3 above;
[0117] 6) Node_X_E, connected to the Data cell of the X coordinate list of all the bar end points in step 3 above;
[0118] 7) Node_Y_E, connected to the Data cell of the Y coordinate list of all the bar end points in step 3 above;
[0119] 8) Node_Z_E, connected to the Data cell of the list of Z coordinates of all the end points of the bars in step 3 above;
[0120] 9) Node_Res_X, connected to the Data battery of all the constraint node X coordinates in step 4 above;
[0121] 10) Node_Res_Y, connected to the Data battery of all the constraint node Y coordinates in step 4 above;
[0122] 11) Node_Res_Z, connected to the Data battery of all the constrained node Z coordinates in step 4 above;
[0123] 12) Node_Load_X, connected to the Data battery of the X coordinates of all the load nodes applied in step 5 above;
[0124] 13) Node_Load_Y, connected to the Data battery of the Y coordinates of all the load nodes applied in step 5 above;
[0125] 14) Node_Load_Z, connected to the Data battery of the Z coordinates of all the load nodes applied in step 5 above;
[0126] 15) Load_Dead, connected to the dead load input parameter;
[0127] 16) Load_Live, connected to the live load input parameters;
[0128] 17) Dead_ComIndex, connected to the constant load factor input parameter;
[0129] 18) Live_ComIndex, connected to the live load factor input parameter;
[0130] 19) SAP_Path, connected to the SAP2000 program path input parameter;
[0131] 20) File_Path, connected to the file save path input parameter;
[0132] 21) Model_Name, connected to the model name input parameter;
[0133] 22) Model_Mat, connected to the steel material property input parameters;
[0134] 23) Run, connected to the start button input parameter.
[0135] The steps to call SAP2000 API modeling calculation are as follows:
[0136] Step 3.6.1: In the GH_CPython battery environment, call the sys, comtypes.client, in32com.client, and os external libraries;
[0137] Step 3.6.2: Use os.path.exists to determine whether the file save path File_Path exists. If it exists, skip it. If it does not exist, create a new path with File_Path. Use AttachToInstance to connect to the currently running SAP2000 program. If there is a running SAP2000 program, use comtypes.client.GetActiveObject("CSI.SAP2000.API.SapObject") to get the currently activated SAP2000 object and name it mySapObject. If it does not exist, an error message will be displayed.
[0138] Step 3.6.3: Use mySapObject.SapModel to create a SAP2000 model object named SapModel; use SapModel.InitializeNewModel to set the unit to N, mm; use SapModel.File.NewBlank to create a new blank model.
[0139] Step 3.6.4: Apply SapObject.SapModel.PropMaterial.SetMaterial to define a new material numbered 1 and named Model_Mat; SapObject.SapModel.PropMaterial.SetMPIsotropic sets the above new material to an isotropic material with an elastic modulus of 206000 MPa and a Poisson's ratio of 0.2.
[0140] Step 3.6.5: Loop through the rod diameter list variable Diam and the rod wall thickness list variable Thin, and use SapModel.PropFrame.SetPipe to define the cross-section of the rod.
[0141] Step 3.6.6: Loop through the X-coordinate list variable Node_X_S of the starting point of the member, the Y-coordinate list variable Node_Y_S of the starting point of the member, the Z-coordinate list variable Node_Z_S of the starting point of the member, the X-coordinate list variable Node_X_E of the end point of the member, the Y-coordinate list variable Node_Y_E of the end point of the member, and the Z-coordinate list variable Node_Z_E of the end point of the member, and apply SapModel.FrameObj.AddByCoord to create the member.
[0142] Step 3.6.7: Apply SapModel.FrameObj.SetReleases to release the rotational degrees of freedom at both ends of all members.
[0143] Step 3.6.8: Use SapModel.FrameObj.GetPoints to get the starting point number of each member, use SapModel.PointObj.GetCoordCartesian to get the spatial coordinates of the starting point number, and cyclically call the constraint node X coordinate variable Node_Res_X, the constraint node Y coordinate variable Node_Res_Y, and the constraint node Z coordinate variable Node_Res_Z to determine whether the spatial coordinates of the starting point number are consistent with the constraint node coordinates. If so, use SapModel.PointObj.SetRestraint to constrain the translation of the point in the X, Y, and Z directions.
[0144] Step 3.6.9: Use SapModel.LoadPatterns.Add to add the dead load pattern and live load pattern; use SapModel.LoadCases.StaticLinear.SetCase to add the live load condition; use SapModel.RespCombo.Add to create the load combination, use SapModel.RespCombo.SetCaseList to set the dead load combination value coefficient in the load combination to the dead load coefficient Dead_ComIndex, and use SapModel.RespCombo.SetCaseList to set the live load combination value coefficient in the load combination to the live load coefficient Live_ComIndex.
[0145] Step 3.6.10: Loop to obtain the Cartesian coordinates of the start and end points of each member, and compare them with the X coordinate variable Node_Load_X, the Y coordinate variable Node_Load_Y, and the Z coordinate variable Node_Load_Z of the load-applying node. If the coordinates are consistent, apply SapModel.PointObj.SetLoadForce to apply a constant load of Load_Dead at this point along the negative direction of the Z axis, and apply SapModel.PointObj.SetLoadForce to apply a live load of Load_Live at this point along the negative direction of the Z axis.
[0146] Step 3.6.11: Use SapModel.File.Save to save the file; use SapModel.Analyze.SetActiveDOF to set the active degrees of freedom to the Y-axis degree of freedom, the Z-axis degree of freedom, and the degree of freedom around the X-axis; use SapModel.Analyze.RunAnalysis to start the analysis; use SapModel.PointObj.Count to determine the number of model nodes.
[0147] Step 3.6.12: Loop through each node and use SapModel.Results.Setup.SetCaseSelectedForOutput to select the load type of the output result as constant load; use SapModel.Results.JointDispl to extract the displacement of each node in the Z direction; compare the displacement of each node in the Z direction to determine the maximum displacement of the node under constant load and the corresponding node number.
[0148] Step 3.6.13: Loop through each node and use SapModel.Results.Setup.SetCaseSelectedForOutput to select the load type of the output result as live load; use SapModel.Results.JointDispl to extract the displacement of each node in the Z direction; compare the displacement of each node in the Z direction to determine the maximum displacement of the node under live load and the corresponding node number.
[0149] Step 3.6.14: Loop through each node and use SapModel.Results.Setup.SetCaseSelectedForOutput to select the load type of the output result as combined load; use SapModel.Results.JointDispl to extract the displacement of each node in the Z direction; compare the displacement of each node in the Z direction to determine the maximum displacement of the node under the combined load and the corresponding node number.
[0150] Step 3.6.15: Apply SapModel.View.RefreshView to update the SAP2000 program interface; define the output list variable output, and export the maximum node displacement under constant load, the node number corresponding to the maximum displacement under constant load, the maximum node displacement under live load, the node number corresponding to the maximum displacement under live load, the maximum node displacement under load combination, and the node number corresponding to the maximum displacement under load combination.
[0151] The specific embodiments are as follows:
[0152] The steel structure roof of a station building is taken as an example to verify the method of the present invention. The roof adopts a tubular truss structure, and the truss members are all round tubes, with a maximum cross-section of φ402×20, a minimum cross-section of φ76×6, and a material of Q355C. The entire roof truss is composed of 12 main trusses along the north-south direction. The method of the present invention is applied to analyze and calculate the 12 main trusses of the roof truss, considering the effects of a constant load of 100 kN and a live load of 80 kN, and the combined value coefficients of the constant and live loads are 1.3 and 1.4, respectively. The calculation results are as follows Figure 3 As shown. It takes about 30 minutes for a professional designer to complete the model establishment and calculation of a truss through the CAD model, while it only takes 1 to 2 minutes using the plug-in calculation, which improves the efficiency by more than 95%. In addition to the significant improvement in calculation efficiency, the parameterized material property definition, load size adjustment, and constraint node setting in the method of the present invention all enhance the flexibility of model analysis. At the same time, through simple data result visualization processing in Grasshopper, the maximum displacement and corresponding nodes of the structure under constant load, live load, and constant and live load combination are intuitively displayed, which helps engineers to efficiently judge the weak parts of the structure or large deformation areas.
[0153] The content of the present invention is not limited to the embodiments listed, and any equivalent changes made to the technical solution of the present invention by ordinary technicians in this field after reading the description of the present invention are covered by the claims of the present invention.
Claims
1. An automatic modeling and analysis method for tube trusses based on CAD and SAP2000. Features: The steps include: Step 1: Arrange the CAD drawing of the two-dimensional tube truss plane to obtain the arranged tube truss plane drawing; Step 2: Load the organized pipe truss plane drawing into Rhino software. In the Rhino Grasshopper environment, use the Guid battery to select all the bar layer texts in the drawing; use the Panel battery to set the cross-section information reading format; use the Curve battery to select all the bar layer lines in the drawing; use the Point battery to select the intersection of the layer lines used as constraint supports in the drawing; use the Point battery to select the intersection of the layer lines on which concentrated loads are applied in the drawing; use the NumberSlider battery to set the constant load value; use the NumberSlider battery to set the live load value; use the NumberSlider battery to set the constant load combination value coefficient; use the NumberSlider battery to set the live load combination value coefficient; use the Panel battery to set the SAP2000 program call path; use the Panel battery to set the SAP2000 model save path; use the Panel battery to set the SAP2000 model name; use the Panel battery to set the steel material type; use the Boolean Toggle battery to set the program start Boolean switch; Step 3: In the Rhino Grasshopper environment, compile and develop CAD to SAP2000 to automatically model and analyze the battery pack; Step 4: Open the SAP2000 structural calculation software. In the Grasshopper environment, click the BooleanToggle battery in step 2. The program calls SAP2000 to complete the model establishment and calculation. Step 5: In the Grasshopper environment, use the Panel battery to connect the CAD compiled and developed in step 3 to the output end of the SAP2000 automatic modeling and analysis battery group to display the maximum structural displacement under constant load, live load, and load combination and its corresponding node number.
2. According to claim 1, a method for automatically modeling and analyzing a pipe truss by associating CAD and SAP2000, Features: In the step 1, the organized pipe truss plane drawing retains the layer lines and cross-sectional dimension markings required to represent the components.
3. The automatic modeling and analysis method for tube trusses associating CAD and SAP2000 according to claim 1, Features: The CAD automatically models and analyzes the battery pack to SAP2000, and its input parameters include: section information, which is connected to the Guid cell of all the bar layer text in the above step 2; section naming method, which is connected to the Panel cell of the section information reading format in the above step 2; bar curve, which is connected to the Curve cell of all the bar layer lines in the above step 2; constraint node, which is connected to the Point cell of the layer line intersection point used as the constraint support in the above step 2; load application node, which is connected to the Point cell of the layer line intersection point where the concentrated load is applied in the above step 2; constant load, which is connected to the Number Slider cell of the constant load value in the above step 2; live load, which is connected to the Number Slider cell of the live load value in the above step 2. Slider battery; constant load coefficient, connected to the NumberSlider battery of the constant load coefficient in the above step 2; live load coefficient, connected to the NumberSlider battery of the live load coefficient in the above step 2; SAP2000 program path, connected to the Panel battery of the SAP2000 program call path in the above step 2; file save path, connected to the Panel battery of the SAP2000 model save path in the above step 2; model name, connected to the Panel battery of the SAP2000 model name in the above step 2; steel properties, connected to the Panel battery of the steel material type in the above step 2; start button, connected to the Boolean Toggle battery of the program start Boolean switch in the above step 2.
4. The automatic modeling and analysis method for tube trusses associating CAD and SAP2000 according to claim 3, Features: In step 3, the step of CAD to SAP2000 automatic modeling and analysis specifically includes: Step 3.1: Use C# Script battery to extract parameter text and parameter plane of section information input parameters; use GhPythonScript battery and ClearTree battery to convert parameter text into section name list; use GhPythonScript battery, Construct Point battery, Clear Tree battery to extract coordinates of center point of parameter plane, and convert them into list of center points of plane where section name text is located; Step 3.2: Apply the Curve Nearest Object battery, and determine the center point of the plane where the section text is located closest to each curve from the list of plane center points where the section name text is located in the above step 1 according to the order of the curve list in the bar curve input variable; input parameters according to the section naming method, use the GhPython Script battery to extract the list of all bar diameters and the list of all bar wall thicknesses, and form a Data battery for the list of all bar diameters and a Data battery for the list of all bar wall thicknesses; Step 3.3: Apply the Rotate 3D battery and the Unity battery to transform all the bar curves in the bar curve input variable from the XY plane to the YZ plane, and obtain a list of all bar curves after rotation; apply the EndPoints battery and the Deconstruct battery to extract the coordinates of the starting and ending points of the curves in the list of all bar curves after rotation, and form a Data battery of the list of X coordinates of all bar starting points, a Data battery of the list of Y coordinates of all bar starting points, a Data battery of the list of Z coordinates of all bar starting points, a Data battery of the list of X coordinates of all bar end points, a Data battery of the list of Y coordinates of all bar end points, and a Data battery of the list of Z coordinates of all bar end points; Step 3.4: Use the Rotate 3D battery and the Unity battery to transform all points in the constraint node input variable from the XY plane to the YZ plane, and obtain a list of all constraint nodes after rotation; use the Deconstruct battery to extract the Data battery of the X coordinates of all constraint nodes, the Data battery of the Y coordinates of all constraint nodes, and the Data battery of the Z coordinates of all constraint nodes in the list of all constraint nodes after rotation; Step 3.5: Use the Rotate 3D cell and the Unity cell to transform all points in the input variable of the applied load node from the XY plane to the YZ plane, and obtain the list of all applied load nodes after rotation; use the Deconstruct cell to extract the Data cell of the X coordinates of all applied load nodes, the Data cell of the Y coordinates of all applied load nodes, and the Data cell of the Z coordinates of all applied load nodes in the list of all applied load nodes after rotation; Step 3.6: Apply the GH_CPython battery, call the SAP2000 API modeling calculation through the Python language, complete the structural analysis, and obtain the GH_CPython battery that calls the SAP2000 API modeling calculation.
5. The automatic modeling and analysis method for tube trusses associating CAD and SAP2000 according to claim 4, Features: In step 3.6, the input parameters of the GH_CPython battery that calls the SAP2000 API modeling calculation include the following: 1) Diam, connected to the Data cell of the list of all rod diameters in step 3.2 above; 2) Thin, connected to the Data cell of the list of all bar wall thicknesses in step 3.2 above; 3) Node_X_S, connected to the Data cell of the X coordinate list of all the rod start points in step 3.3 above; 4) Node_Y_S, connected to the Data cell of the list of Y coordinates of all the starting points of the bars in step 3.3 above; 5) Node_Z_S, connected to the Data cell of the Z coordinate list of all the rod start points in step 3.3 above; 6) Node_X_E, connected to the Data cell of the X coordinate list of all the bar end points in step 3.3 above; 7) Node_Y_E, connected to the Data cell of the list of Y coordinates of all the end points of the bars in step 3.3 above; 8) Node_Z_E, connected to the Data cell of the list of Z coordinates of all the end points of the bars in step 3.3 above; 9) Node_Res_X, connected to the Data battery of all the constraint node X coordinates in step 3.4 above; 10) Node_Res_Y, connected to the Data battery of all the constraint node Y coordinates in step 3.4 above; 11) Node_Res_Z, connected to the Data battery of all the constrained node Z coordinates in step 3.4 above; 12) Node_Load_X, connected to the Data battery of the X coordinates of all the load nodes applied in step 3.5 above; 13) Node_Load_Y, connected to the Data battery of the Y coordinates of all the load nodes applied in step 3.5 above; 14) Node_Load_Z, connected to the Data battery of the Z coordinates of all the load nodes applied in step 3.5 above; 15) Load_Dead, connected to the dead load input parameter; 16) Load_Live, connected to the live load input parameters; 17) Dead_ComIndex, connected to the constant load factor input parameter; 18) Live_ComIndex, connected to the live load factor input parameter; 19) SAP_Path, connected to the SAP2000 program path input parameter; 20) File_Path, connected to the file save path input parameter; 21) Model_Name, connected to the model name input parameter; 22) Model_Mat, connected to the steel material property input parameters; 23) Run, connected to the start button input parameter.
6. The automatic modeling and analysis method for tube trusses associating CAD and SAP2000 according to claim 5, Features: In step 3.6, the steps of calling SAP2000 API modeling calculation are as follows: Step 3.6.1: In the GH_CPython battery environment, call the sys, comtypes.client, in32com.client, and os external libraries; Step 3.6.2: Use os.path.exists to check whether the file save path File_Path exists. If it exists, skip it. If it does not exist, create a new path with File_Path. Use AttachToInstance to connect to the currently running SAP2000 program. If there is a running SAP2000 program, use comtypes.client.GetActiveObject("CSI.SAP2000.API.SapObject") to get the currently activated SAP2000 object and name it mySapObject. If it does not exist, an error message will be displayed. Step 3.6.3: Use mySapObject.SapModel to create a SAP2000 model object named SapModel; use SapModel.InitializeNewModel to set the unit to N, mm; use SapModel.File.NewBlank to create a new blank model; Step 3.6.4: Apply SapObject.SapModel.PropMaterial.SetMaterial to define a new material numbered 1 and named Model_Mat; SapObject.SapModel.PropMaterial.SetMPIsotropic sets the new material to an isotropic material with an elastic modulus of 206000 MPa and a Poisson's ratio of 0.2; Step 3.6.5: Loop through the rod diameter list variable Diam and the rod wall thickness list variable Thin, and use SapModel.PropFrame.SetPipe to define the cross-section of the rod; Step 3.6.6: Loop call the X coordinate list variable Node_X_S of the starting point of the bar, the Y coordinate list variable Node_Y_S of the starting point of the bar, the Z coordinate list variable Node_Z_S of the starting point of the bar, the X coordinate list variable Node_X_E of the end point of the bar, the Y coordinate list variable Node_Y_E of the end point of the bar, and the Z coordinate list variable Node_Z_E of the end point of the bar, and apply SapModel.FrameObj.AddByCoord to create the bar; Step 3.6.7: Apply SapModel.FrameObj.SetReleases to release the rotational degrees of freedom at both ends of all members; Step 3.6.8: Apply SapModel.FrameObj.GetPoints to obtain the starting point number of each member, apply SapModel.PointObj.GetCoordCartesian to obtain the spatial coordinates of the starting point number, and call the constraint node X coordinate variable Node_Res_X, constraint node Y coordinate variable Node_Res_Y, and constraint node Z coordinate variable Node_Res_Z cyclically to determine whether the spatial coordinates of the starting point number are consistent with the constraint node coordinates. If so, apply SapModel.PointObj.SetRestraint to constrain the translation of the point in the X, Y, and Z directions; Step 3.6.9: Use SapModel.LoadPatterns.Add to add the dead load pattern and live load pattern; use SapModel.LoadCases.StaticLinear.SetCase to add the live load case; use SapModel.RespCombo.Add to create the load combination, use SapModel.RespCombo.SetCaseList to set the dead load combination value coefficient in the load combination to the dead load coefficient Dead_ComIndex, and use SapModel.RespCombo.SetCaseList to set the live load combination value coefficient in the load combination to the live load coefficient Live_ComIndex; Step 3.6.10: Loop to obtain the Cartesian coordinates of the starting point and the end point of each member, and compare them with the X coordinate variable Node_Load_X, the Y coordinate variable Node_Load_Y, and the Z coordinate variable Node_Load_Z of the load-applying node. If the coordinates are consistent, apply SapModel.PointObj.SetLoadForce to apply a constant load of Load_Dead at this point along the negative direction of the Z axis, and apply SapModel.PointObj.SetLoadForce to apply a live load of Load_Live at this point along the negative direction of the Z axis; Step 3.6.11: Use SapModel.File.Save to save the file; use SapModel.Analyze.SetActiveDOF to set the active degrees of freedom to the Y-axis degree of freedom, the Z-axis degree of freedom, and the degree of freedom around the X-axis; use SapModel.Analyze.RunAnalysis to start the analysis; use SapModel.PointObj.Count to determine the number of model nodes; Step 3.6.12: Loop through each node and use SapModel.Results.Setup.SetCaseSelectedForOutput to select the load type of the output result as constant load; use SapModel.Results.JointDispl to extract the displacement of each node in the Z direction; compare the displacement of each node in the Z direction to determine the maximum displacement of the node under constant load and the corresponding node number; Step 3.6.13): Loop through each node, apply SapModel.Results.Setup.SetCaseSelectedForOutput to select the load type of the output result as live load; apply SapModel.Results.JointDispl to extract the displacement of each node in the Z direction; compare the displacement of each node in the Z direction to determine the maximum displacement of the node under live load and the corresponding node number; Step 3.6.14: Loop through each node and use SapModel.Results.Setup.SetCaseSelectedForOutput to select the load type of the output result as combined load; use SapModel.Results.JointDispl to extract the displacement of each node in the Z direction; compare the displacement of each node in the Z direction to determine the maximum displacement of the node under the combined load and the corresponding node number; Step 3.6.15: Apply SapModel.View.RefreshView to update the SAP2000 program interface; define the output list variable output.
7. The automatic modeling and analysis method for tube trusses associating CAD and SAP2000 according to claim 6, Features: In the step 3.6.15, the maximum node displacement under constant load, the node number corresponding to the maximum displacement under constant load, the maximum node displacement under live load, the node number corresponding to the maximum displacement under live load, the maximum node displacement under load combination, and the node number corresponding to the maximum displacement under load combination are respectively derived through the output list variable output.
