FAQ-000063 · Integrations

Can Mia create a parametric script from an existing RFEM model?

Yes, if the model is open in RFEM and connected to CALC. Mia reads it and writes a Python script for the Dlubal API in which you change key values as variables.

Dlubal CALC · Updated:

The short answer

Yes. Open the model in RFEM and connect RFEM to CALC. Mia reads the objects and loads and writes a Python script for the Dlubal API that rebuilds the model in RFEM. You decide which values become variables in the script. An uploaded RFEM file is not enough for this. Always check the result against your original model.

Why the model has to be open in RFEM

If you upload an RFEM file to the chat, Mia only receives an overview of it, for example the number of objects and the dimensions of the model. A script needs the individual nodes, members, cross-sections, supports, and loads.

Mia reads these details through the Dlubal-Connector from the model that is active in RFEM. So activate the model the script should be based on before you ask her. The FAQ on the RFEM connection explains how to set it up.

Having Mia create the script

Describe what the script should do and name the values that may change later. The more precisely you do this, the better the result fits. An example for a hall:

“Read the active RFEM model completely, including the loads. Write a Python script for the Dlubal API that rebuilds this model in the model that is active in RFEM when the script runs. The script must not create a new model and must not use fixed object numbers, but assign new numbers above the highest existing ones. Put the span, heights, frame spacing, number of frames, cross-sections, and loads at the top of the script as variables. First list what you read and what you cannot carry over. Do not run the script yet.”

Adapt the variables to your model. The last sentence leaves the model unchanged for now, so you can read the script in peace.

The free object numbers matter because a new RFEM model is not empty. It already contains template objects, for example materials, cross-sections, nodal supports, and load case 1. A script with fixed numbers starting at 1 therefore stops with a message that an object already exists.

Running the script

To run the script, activate a new model in RFEM and ask Mia in the chat to run the script there. If in doubt, ask her which model is currently active. The start button on the code block in the chat runs Python in CALC itself, not in RFEM. It is therefore not suitable for an RFEM script.

If the script stops with a message, the model may already be partly built. Give Mia the message, for example an invalid value for an action category, and ask her for a correction. After that, it is best to start in a new model.

Creating variants with other values

For a variant, you only change the variables at the top of the script, for example the span or the number of frames. Nodes, members, supports, and loads are calculated from them. Ask Mia to run the saved script unchanged and to change only these variables.

An example: “Run the saved script in the active model with a span of 15 m and 4 frames. Change nothing else in the script.”

The script is yours. You can copy it from the chat, save it, and later keep using it yourself with the Dlubal API.

Checking the result

Compare the new model with the original before you rely on it, for example the number of objects and, after a calculation, the support reactions. The object numbers may differ.

For larger models, we recommend building the script in steps, for example geometry and cross-sections first, then supports and loads, and checking the result in RFEM after each step. What Mia's list says she cannot carry over, you add yourself in RFEM.