3.3.2. The Process of Tool Development
The basic logic of interface design must place the interface under the control of the user and reduce the user’s memory load. Since PC balcony components are composed of modules, each module was designed as an embedded sub-interface to maintain the overall consistency of the interface when designing the interface. WinForms (Windows Form) is a widely used development tool that is based on the .Net form application. It consists of two parts: front interface design and background code. The user input data can be obtained through the background code. The design of the main interface of the modeling tool and the sub-interface of the corresponding module are shown in
Figure 7.
- 2.
Establishment of a solid model of the PC balcony
It is necessary to determine the elevation at which the balcony will be located before creating the balcony elements. The reference coordinate point for generating the balcony component should be selected in the corresponding plane view interface, and the coordinates of this point should be obtained. The model’s origin was defined as the location point, which was transformed into origin coordinates using the Element.Location() function in the API. This created the origin Location (0, 0, 0), allowing the re-establishment of the Cartesian coordinate system and relocation calculations for the balcony component’s modules. Taking the beam balcony as an example, the plan view of its geometric model is shown in
Figure 8. The slab dimensions are denoted as
L1 for length and
W1 for width, while the widths of the top edge beam and the left- and right-side overhanging beams are, respectively, marked
TW,
LW, and
RW. Additionally, the balcony’s Z-direction offset height is defined as d
1 and the depth of its embedment is
T1. In
Table 3, the computed positioning points and lengths of the remaining modules are presented.
The function method used to create the geometric solid model of the modules in the balcony component was Creat.NewFamilyInstance (XYZ, FamilySymbol, StructuralType), and this method corresponded to three parameters, which were the positioning point of the instance model, the type of the model, and the structural type. The anchor point of each module could be obtained through the aforementioned calculation, enabling the generation of a single-module model using code-driven parameter data. Using the function List<ElementId>, all module models were aggregated to form a complete geometry model of the balcony.
- 3.
Establishment of rebars model of the PC balcony
As the rebar model differs from the concrete model, the rebar is classified as a component attached to the concrete interior. The prefabricated components of the reinforcement layout have the characteristics of uniformity, standardization, and repeatability. The establishment of rebar parameter logic and the setting of various parameters are essential in Revit to accommodate different anchorage forms. Reinforcement modeling in data-driven methods relies on coordinate calculation to generate positioning curves and form reinforcement models. Taking the edge girder as an example, this section introduces the program algorithm for generating the reinforcement model.
Program algorithm calculations involved using the aforementioned known geometric point location coordinates of the capping beam. The geometric point location coordinates TopBeamLocation (0, W1, d1) calculated before were transformed into the reference coordinate point of the module steel bar: Location O (Xtop, Ytop, Ztop) established the coordinate system, as shown in the figure. The CreateBound () function was used to create the positioning curve of the rebar. In accordance with the creation of the positioning line, it was then used to generate the longitudinal rebar models.
The thickness of the protective layer of the reinforcement was denoted as
Protect layer thickness (abbreviated to
Prot in the formula), the diameter of the stirrup was
Stir dia, the diameter of the longitudinal reinforcement was
Longi dia, the anchorage length of the reinforcement was 15 times the diameter of the reinforcement, and the local arrangement and composition of the reinforcement are shown in
Figure 9.
From
Figure 9, it can be seen that the
Y-axis value of the rebar is fixed, so the following calculation mainly calculates the
X-axis value and the
Z-axis value of the rebar positioning point. The curves of the rebar
Ne are represented in
Figure 9 by the position of the coordinates of the locating points a~h. The value in the Y-axis direction of the rebar can therefore be calculated as follows:
The coordinates of the locating points of the reinforcement a~h are then calculated as follows:
Location a (
Xa,
YNe,
Za):
Location b (
Xb,
YNe,
Zb):
Location c (
Xc,
YNe,
Zc):
Location d (
Xd,
YNe,
Zd):
Location e (
Xe,
YNe,
Ze):
As the data for the avoidance curves at both ends of the beam are the same, the coordinates of points f, g, and h can be derived by referring to the calculation of points a, b, and c. Similarly, the positioning coordinates of the rebar Bo can be deduced, and the detailed formulae are not listed here. After generating the geometric shape of the rebar, it is necessary to calculate the arrangement of the rebar within the concrete and several common cross-sectional arrangements of rebar are shown in
Figure 10. In the figure,
a is the value of the center of the reinforcement from the concrete boundary and
b is the spacing of the reinforcement rows. The double-layer reinforcement form defines c
1 as the vertical distance between the upper reinforcement and the top surface, while c
2 represents the vertical distance between the lower reinforcement and the top surface.
A cross section of the center of the closing beam is shown in
Figure 11. Since the specific coordinates of
rebar 3 in the edge beam have already been calculated before (and the value in the
X-axis direction is the length of the reinforcement, which has no relation to the spacing arrangement of the longitudinal reinforcement), only the positioning value in the
Y-axis direction and the fixed position in the
Z-axis direction are calculated in the alignment positioning calculation process next.
The length and width of the beam section are
TH and
TW, respectively, and the coordinates of the origin are
Xtop,
Ytop, and
Ztop. The position coordinates of rebars 1–8 were then identified. First, the coordinates of the rows of rebar 3 in
Figure 11 can be calculated as follows:
Rebar 3 Location (
Xd,
Y3,
Z3):
If the number of bars in the same row is greater than or equal to 3, the ElemengtTransformUtils.CopyElement() method in the Revit API may be used to copy the corresponding bars. By reading the number of top bars in the rebar dataset (
top count) and the copy spacing of the bars (
Copy space), the following calculation can be performed:
Using rebar 3 as a reference, the copy distance and positioning points of rebars 1 and 2 on the diagram may be found. Similarly, the end-point coordinates and copy distances of rebars 4, 5, and 6 can be calculated as described before, and the rebars can be modeled by copying. The number of longitudinal bars at the waist from the rebar dataset (
web count) and the form of rebar rows for the web longitudinal bars can be determined based on the number of bars. The number of web bar rows is calculated as follows:
The spacing of the rebar (
Rebar space) can then be calculated:
Using
Figure 11 as an example, at this point, the number of web bars is 2; this means that bars 7–8 are in the same row, from which the positioning point of bar 8 can be calculated:
The method of calculating the position of the other web rebar was essentially the same as that described before. After generating the stirrup and tiepiece, the balcony module may have a rotation angle, so it was necessary to use the List<ElementId> function to collect the IDs of the generated rebar and add the model of the rebar with the corresponding IDs to the balcony module generated in the previous section. Finally, the rotation was performed using the ElementTransformUtils.RotateElements() method. The generation path of the stirrup was as follows. First, the coordinates of the four corners of the stirrup were obtained and the curve shape was drawn through the four corners. The coordinates of these four corners were calculated using the cross-section size of the beam and the thickness of the protective layer. The protective layer of the reinforcement (
Rebar cover), the diameter of the reinforcing bar (
Stir dia), and the coordinates of the upper-right corner of the rebar in the Y-direction and in the Z-direction can be calculated based on the aforementioned rebar coordinate system, as follows:
Because the currently acquired coordinates of the origin are the coordinates of the left side of the beam, the coordinates in the x-direction are the coordinates in the longitudinal direction of the beam, and the coordinate position
Xstir can be calculated as follows:
The stirrup layout in the X-direction, the center row spacing (
Stirrup space), the number of stirrups (
N1), and the beams at both ends of the existence of stirrup encryption area (
Encr area) were calculated; the encryption area’s stirrup spacing is generally half the spacing of the intermediate section, and the number of stirrups in this area (
N2) were then found. These two values were then added together to obtain the total number of stirrups,
Nstir. Using the For Loop function, the stirrup model was copied to the appropriate position according to the spacing and number of rebar, and the model was added to the set of components as follows:
The main role of the tiepiece is to fix the web longitudinal rebar and the longitudinal rebar, the number of tiepieces, and the positioning of the whole based on the number of longitudinal rebars and the web longitudinal rebar. The number of rows of beams (Ni) and the number of stirrups (Nstir) were known for beam reinforcement. The parity of Ni values was first calculated. When Ni is an odd number, the tiepiece is a single row and the spacing is twice the spacing of the stirrup. When Ni is an even number, the tiepiece for the upper and lower rows of staggered rows is a single row with twice the spacing of the stirrups, staggered adjacent to the spacing of the tie piece, and the spacing of the stirrups is the same.
The balcony modules may have rotation angles, so it is necessary to use the List<ElementId> function to collect the IDs of the generated rebars. Next, the rebar models corresponding to these IDs were added to the previously generated balcony module. Finally, the ElementTransformUtils.RotateElements() method was used for rotation.
Using the modeling approach outlined before, algorithms and codes were integrated and encapsulated, creating an .addin file on the Revit software platform. This realized the development of a specialized software tool for modeling PC balcony components. Through user interface input, this tool enabled the automatic generation of steel-bar-reinforced PC balcony components at specified positions based on provided data.