Dynamic Blocks in RFEM 6 (via JavaScript)

Technical Article on the Topic Structural Analysis Using Dlubal Software

  • Knowledge Base

Technical Article

Structures in RFEM 6 can be saved as blocks and reused in other RFEM files. The advantage of dynamic blocks with respect to non-dynamic blocks is that they allow interactive modifications of the structural parameters as a result of modified input variables. One example is the possibility to add structural elements by changing only the number of bays as an input variable. This article will demonstrate the aforementioned possibility for dynamic blocks that are created by scripting.

The JavaScript File

In theory, a web service can be created with any programming language. In this article, the programming environment is JavaScript. As a matter of fact, scripting can be used to define the topology of the structure, the load cases, and the loads. To create script files, it is enough to have an editor such as the one used in this article (Notepad ++).

In the JavaScript file provided in this example, the input parameters are defined with the input_data() function. These parameters can be assigned in different categories (basic data, geometry, supports, sections, etc.). In terms of basic data, parameter "n" is defined as the type "integer" (using the parameter_int() function) in order to allow dynamic generation of the number of bays. In the “Geometry” category, on the other hand, the parameter_float() function is used for the creation of the frame span (a), the height of the column (H_1), the height of the roof (H_2), and the bay length (L). As can be seen in Image 1, parameter “L” (Bay length) is created dynamically by the multiplicity counter kn, which was defined earlier.

Next, the variables defined as input data can be employed by the generate() function to generate the block; that is, to create nodes and members, assign supports to nodes, create coordinate systems, and create dimensions. This is shown in Image 2, and it can be further explored in the script provided at the end of the article.

It is to be noted that all available objects and attributes can be found in the Console (View → Console). As Image 3 shows, the objects and their properties can be displayed through the icon indicated in the image.

Although not used in this example, the global_parameters() function can also be adopted in the script. This function serves to parameterize the block, as discussed in the Knowledge Base article Parameterized Models as Blocks in RFEM 6.

Saving the Model as a Block

The block created in this manner can be saved as discussed in the Knowledge Base article Saving Models as Blocks in RFEM 6 (File → Save as Block). However, the difference now is that the JavaScript file has to be imported in the Save as Block window (Image 4).

Once the block has been saved, it can be imported easily into any RFEM 6 file. For this purpose, it is necessary to open Dlubal Center | Blocks and select the block from the relevant category. Prior to being inserted, the block can be modified in the Edit Blocks window. For dynamic blocks created by scripting, the input parameters can be modified in the Structure tab of this window.

As mentioned above, the advantage of dynamic blocks is the possibility to introduce modifications by changing the input variables. Thus, given the manner in which the number of bays (n) and the bay length (L) have been defined in the script, the latter will change automatically when the former are changed. In this example, the predefined number of bays is three and, therefore, three bay lengths are listed as parameters (Image 5). However, the variable “n” can be easily changed into any other number (for example, five), and the structure will be modified accordingly (Image 6).

Final Remarks

Dynamic blocks in RFEM 6 can be created easily by scripting. To create script files, it is sufficient to have a script editor. At this point, parameters can be created dynamically in the script, thus allowing interactive modification of the block afterwards.

The blocks created in this manner can be saved by importing the JavaScript file in the “Save as Block” window. Once available in Dlubal Center | Blocks, they can be imported easily into any RFEM 6 file. Since the blocks are dynamic, interactive modifications of structural parameters as a result of modified input variables are possible each time the blocks are used in an RFEM file.

Author

Irena Kirova, M.Sc.

Irena Kirova, M.Sc.

Marketing & Customer Support

Ms. Kirova is responsible for creating technical articles and provides technical support to the Dlubal customers.

Keywords

Dynamic Blocks JavaScript Scripting Parameterization

Downloads

Links

Write Comment...

Write Comment...

  • Views 1137x
  • Updated 11 January 2023

Contact Us

Contact Dlubal

Do you have any further questions or need advice? Contact us via phone, email, chat or forum or search the FAQ page, available 24/7.

+49 (0) 9673 9203-0

[email protected]

Masonry Design Using Finite Element Analysis (FEA) in RFEM 6

Masonry Design Using Finite Element Analysis (FEA) in RFEM 6

Webinar 2 February 2023 2:00 PM - 3:00 PM CET

New Features of ''Concrete Design'' for RFEM 6 and RSTAB 9

New Features of "Concrete Design" Add-On for RFEM 6 and RSTAB 9

Webinar 9 February 2023 2:00 PM - 3:00 PM CET

Online Training | English

Eurocode 3 | Steel Structures According to DIN EN 1993-1-1

Online Training 2 March 2023 9:00 AM - 1:00 PM CET

Online Training | English

Eurocode 5 | Timber Structures According to DIN EN 1995-1-1

Online Training 16 March 2023 9:00 AM - 1:00 PM CET

Online Training | English

RFEM 6 | Dynamic Analysis and Seismic Design According to EC 8

Online Training 30 March 2023 9:00 AM - 1:00 PM CEST

Stability and Warping Torsion Analyses

Stability and Warping Torsion Analyses in RFEM 6 and RSTAB 9

Webinar 26 January 2023 2:00 PM - 3:00 PM CET

Online Training | English

Eurocode 2 | Concrete Structures According to DIN EN 1992-1-1

Online Training 26 January 2023 9:00 AM - 1:00 PM CET

Reinforced Concrete Tank Design \n in RFEM 6

Reinforced Concrete Tank Design in RFEM 6 (USA)

Webinar 19 January 2023 2:00 PM - 3:00 PM EDT

Modeling and Design of CLT Panels in RFEM 6

Modeling and Design of CLT Panels in RFEM 6

Webinar 19 January 2023 2:00 PM - 3:00 PM CET

Online Training | English

RFEM 6 | Basics

Online Training 19 January 2023 9:00 AM - 1:00 PM CET

New Features in RFEM 6 and RSTAB 9

New Features in RFEM 6 and RSTAB 9

Webinar 21 December 2022 2:00 PM - 3:00 PM CET

Revit, IFC, and DXF Integration in RFEM 6 (USA)

Revit, IFC, and DXF Integration in RFEM 6 (USA)

Webinar 15 December 2022 2:00 PM - 3:00 PM EDT

Stress Analysis of Surfaces and Members in RFEM 6

Stress Analysis of Surfaces and Members in RFEM 6

Webinar 15 December 2022 2:00 PM - 3:00 PM CET

Online Training | English

RFEM 6 | Students | Introduction to Reinforced Concrete Design

Online Training 12 December 2022 4:00 PM - 5:00 PM CET

Online Training | English

Eurocode 5 | Timber Structures According to DIN EN 1995-1-1

Online Training 8 December 2022 9:00 AM - 1:00 PM CET

Geotechnical Analysis with Construction Stages in RFEM 6

Geotechnical Analysis with Construction Stages in RFEM 6

Webinar 1 December 2022 2:00 PM - 3:00 PM CET

Online Training | English

RFEM 6 | Students | Introduction to Timber Design

Online Training 25 November 2022 4:00 PM - 5:00 PM CET

RFEM 6
Hall with Arched Roof

Main Program

The structural analysis program RFEM 6 is the basis of a modular software system. The main program RFEM 6 is used to define structures, materials, and loads of planar and spatial structural systems consisting of plates, walls, shells, and members. The program can also design combined structures as well as solid and contact elements.

Price of First License
4,450.00 EUR