Etabs Automation Building Models With Python
Etabs Automation Building Models With Python
Lima, Perú
March 2024
Abstract: This chapter explores the automation of structural modeling using the CSI Etabs API and Python, pre-
senting a step-by-step tutorial for creating the model of a 50-story structure. The tutorial covers the connection
to Etabs, configuration of the model, and the generation of grids, frame elements, columns, and slabs. The CSI
Etabs API, in conjunction with Python, emerges as a valuable resource for civil engineers, structural engineers,
programmers, students, and specialists seeking to enhance their capabilities in automated structural design.
Keywords: Parametric Building Model, CSI Etabs API, Python, Structural Engineering, Automation, Building
Modeling, Structural Elements.
1
Structural Engineering
LS Structure Engineering and Research Volume 1
2
Structural Engineering
LS Structure Engineering and Research Volume 1
• numy: The number of grid divisions along the y- • Set units: The SetPresentUnits function is uti-
axis. Similar to numx, this parameter controls the lized to establish the units for the analysis. The
layout of structural elements along the vertical variable TonfmC is set to 12, indicating that the
direction. It is also set to 3 in the example. units for the analysis are in tons, meters, and
degrees Celsius. Ensuring consistent and appro-
• Espaciamientox: The spacing between columns priate units is vital for accurate structural anal-
along the x-axis. This parameter influences the ysis. This step establishes the unit system used
distance between structural elements in the hor- throughout the modeling and analysis processes.
izontal direction. In the example, it is set to 3.5
meters.
1 Tonf_m_C =12
• Espaciamientoy: The spacing between columns 2 ret = SapModel . SetPresentUnits ( Tonf_m_C )
along the y-axis. Similar to Spacingx, this param-
Listing 10: Set units
eter determines the distance between elements in
the vertical direction. It is also set to 3.5 meters
in the example. 6 Frame elements creation and
1 Num_Pisos =50 frame section properties
2 Altura_piso1 =4
Here, the section properties for a frame element
3 Altura _p is o_ ti pi co =3
4 numx =3 (beam) are defined. In this case, a rectangular pro-
5 numy =3 file with specific dimensions is used.
6 Espaciamientox =3.5
7 Espaciamientoy =3.5
• Parameters passed to the function:
Listing 8: Defining variables for model parameters
– V: Indicates that the section properties
5 Create grids and set units are being set for vertical frame elements
It continue with the generation of grids, frame ele- (beams).
ments, and columns at the intersections of the grids. – 4000Psi: Specifies the material property of
Section properties are defined, and structural ele- the frame.
ments are created following a parametric pattern.
– 0.5: Depth of the rectangular section
• Create grids: The NewGridOnly function is called (beam) in model units.
to generate the structural grid. This function
– 0.25: Width of the rectangular section
takes various parameters to define the grid, such
(beam) in model units.
as the number of floors (NumPisos), the height of
typical floors (AlturaPisoTipico), the height of the
first floor (AlturaPiso1), the number of divisions • Frame section properties: The SetRectangle func-
along the x and y axes (numx and numy), and tion defines the shape and material properties of
the spacings between grid lines (Espaciamientox the frame section. The choice of section prop-
and Espaciamientoy).The grid organize the lay- erties, such as depth and width, influences the
out of structural elements within the model. It behavior of the frame element in the structural
defines the intersections where columns, beams, analysis.
and other components are positioned.
1 ret = SapModel . PropFrame . SetRectangle ( ’V ’ , ’
1 ret = SapModel . File . NewGridOnly ( Num_Pisos , 4000 Psi ’ , 0.5 , 0.25) # name # material # h #
Al tu ra _p is o_ tipico *3.28084 , Altura_piso1 b
*3.28084 , numx , numy , Espaciamientox
*3.28084 , Espaciamientoy *3.28084) Listing 11: Frame elements creation and define
Listing 9: Create grids rectangular frame section properties
3
Structural Engineering
LS Structure Engineering and Research Volume 1
4
Structural Engineering
LS Structure Engineering and Research Volume 1
5
Structural Engineering
LS Structure Engineering and Research Volume 1
References
[1] Vittorio Lora. (2023). “Python for
civil and structural engineers”:
https://python4civil.weebly.com/book-
resources.html