API key does not work

Hello,
I need some help.
I copied the code from the examples in the Dlubal library. When I run the code, the following error message appears:
image.
RFEM starts a new model. So the connection works, but nothing else is executed.

Here is my code:

unit_10_new_model_Test_Test.py (5.5 KB)

Hi Ashraf,

Are you using the API II key that starts with "ak..."?

Best regards,
Stefan Hoffmann

Hi Stefan,

thank you for the quick response. Yes, I am using the API 2 key. The connection to RFEM is working as well. A new project is created, but nothing else.

Best regards,
Ashraf Mohsen

Hi Ashraf,

it seems that you have forgotten to remove or comment out the example (line 153 to end of file). There the script will create another project in RFEM with an empty key wich doesn't work in your way.

I really would recommend to watch the Webinar | Introduction to New Dlubal API for RFEM | Thu, Apr 3, 2025. There you'll get all infos about the default functionallity of the API (gRPC). Some code snippets are not up to date anymore, but the content is still very helpfull. One topic is how to store the API-Keys in a config.ini which might be interessting for you.

Happy coding.

Best regards
Robert Milrath

1 Like