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 721x
  • Updated 06/27/2022

Contact Us

Contact Dlubal

Do you have further questions or need advice? Contact us via phone, email, chat, or forum, or find suggested solutions and useful tips on our FAQ page, available 24/7.

(267) 702-2815

[email protected]

Online Training | English

RFEM 6 | Basics

Online Training 10/07/2022 9:00 AM - 1:00 PM CEST

Online Training | English

RFEM 6 | Students | Introduction to Member Design

Online Training 10/12/2022 4:00 PM - 7:00 PM CEST

Online Training | English

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

Online Training 10/18/2022 9:00 AM - 1:00 PM CEST

Online Training | English

RSECTION | Students | Introduction to Strength of Materials

Online Training 10/19/2022 4:00 PM - 5:30 PM CEST

Online Training | English

RFEM 6 | Students | Introduction to FEM

Online Training 10/27/2022 4:00 PM - 7:00 PM CEST

Online Training | English

RFEM 6 | Students | Introduction to Steel Design

Online Training 11/10/2022 4:00 PM - 5:00 PM CET

Online Training | English

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

Online Training 11/17/2022 9:00 AM - 1:00 PM CET

Online Training | English

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

Online Training 11/23/2022 9:00 AM - 1:00 PM CET

Online Training | English

RFEM 6 | Students | Introduction to Timber Design

Online Training 11/25/2022 4:00 PM - 5:00 PM CET

Online Training | English

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

Online Training 12/08/2022 9:00 AM - 1:00 PM CET

Online Training | English

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

Online Training 09/21/2022 9:00 AM - 1:00 PM CEST

Rhino/Grasshopper Integration in RFEM 6

Rhino/Grasshopper Integration in RFEM 6

Webinar 09/20/2022 2:00 PM - 3:00 PM EDT

Design Aluminum Structures \n in RFEM 6 and RSTAB 9

Model and Design Aluminum Structures in RFEM 6 and RSTAB 9

Webinar 09/15/2022 2:00 PM - 3:00 PM CEST

Online Training | English

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

Online Training 09/15/2022 9:00 AM - 1:00 PM CEST

Considering Construction Stages \n in RFEM 6

Considering Construction Stages in RFEM 6

Webinar 09/08/2022 2:00 PM - 3:00 PM CEST

Online Training | English

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

Online Training 09/08/2022 9:00 AM - 1:00 PM CEST

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