RSTAB9 API II C# | set_base_data

I’m using C# api to turn on some addOns and set standards but I keep getting an error.

Failed to update AddOns: status statusCode = "Unknown", Detail= "Invalid value." )

I tested this simple snippet and it works:

var addons = new BaseData.Types.Addons { SteelDesignActive = true, }; 

var baseData = new BaseData { Addons = addons, }; 

await app.set_base_data(baseData);

And if I expand this snippet with setting up standards it results in an error, what am I missing?

var baseData = await app.get_base_data(modelId.Guid);

baseData.Addons.SteelDesignActive = true;

baseData.Standards.SteelDesignStandardGroup =
BaseData.Types.Standards.Types.SteelDesignStandardGroup.En1993StandardGroup;
baseData.Standards.SteelDesignStandard =
BaseData.Types.Standards.Types.SteelDesignStandard
.SteelDesignNationalAnnexAndEditionEn1993Ds201507Standard;

…and other standards and standard groups

await app.set_base_data(baseData);

Also I assume I can only use set_base_data without get_base_data like in my first example, right? But do I need to set all available properties in this case or? Seems a bit excesive to burn 2 credits just to turn on an AddOn.

Hi Bojan,

First of all, welcome to the community!

I tested your code, and it runs on my machine without any problems (6.12.0007 with 2.12.7). Can you tell me which version your're working with? Please make sure that the installed versions of the API and the Dlubal app are compatible, i.e. API version 2.12.2 works with RFEM 6.12.2, etc.

About the numbers of requests it is like you said. You can use set_base_data without get_base_data, but then you need to provide all required properties, not just the one you want to change.
The two-credit approach (read + write) is recommended to avoid overwriting other values.

Best regards
Robert Milrath

1 Like

Thank you for the quick anwser. I tried this code with RSTAB9.11 and api 2.12.2 which to my understanding is a compatible pair or am I mistaken?

Related question - so backwards compatibility of api is not present? Can newer RSTAB versions use older api or not really? If 40 people use RSTAB do all of them need to migrate at the same time or is there a softer transition option that would be available?

Hi Bojan,

9.12.2 works with 2.12.2 and so on. It could also work if it is not exactly the same index at the end, but it is not recommended to have different versions in the API and the Dlubal-App. So in your case 9.11.x is not compatible with 2.12.2.

However, if you work with different versions, you should get an info in the terminal window like this:
WARNING:
Version mismatch between dlubal.api client package 2.12.7 and server application RFEM 6.12.0008.
To ensure full compatibility, please use the client version 2.12.8.
To update, run: python.exe -m pip install --upgrade dlubal.api==2.12.8

Backward compatibility of the API is not guaranteed. The documentation of the updates always indicate when a version is not compatible with the previous one. In this case, an entry is displayed under “Action required”. However, as explained above, it is best to work with the compatible versions.

Can you install the latest version to test it, or at least two compatible versions?

Best regards
Robert Milrath

1 Like

I did not get a warning and a simple test with only turning on one AddOn and exporting 1 member worked with the combination of RSTAB 9.11 and api 2.12.2.

I have now updated to newest RSTAB and API (RSTAB 9.12 + API 2.12.7) and now it works with the expanded base data setup I had problems with before.

Thank you for your help Robert.

1 Like