Assignment Cross Section No. with API

Dear community,

Is there a way via the API to explicitly assign a Cross Section Number during "Import from RSECTION" – similar to what is possible in Grasshopper?

Currently, I use the following code for the import:

rfem_app.import_from(
    filepath=os.path.abspath('cross_section.rsc'),
    import_attributes=common.import_export.RsectionImportAttributes()
)

When importing via the API, the Cross Section No. is automatically assigned (sequentially, starting with the last existing number +1).

My workflow is as follows:

  • Many non-standardized cross sections are initially created automatically in RSECTION via the API.
  • These cross sections are then automatically imported into the RFEM model.

(The Member/Cross Section assignment I control in Grasshopper.)

Since the cross sections are currently still being optimized and adjusted, it would be helpful for my workflow if I could assign a fixed Cross Section No. during import so that existing cross sections in the model can be specifically overwritten.

Is there already a possibility for this in the API or a recommended workflow?

Thank you very much!

Hi mfrei,

first of all, welcome to the community!

And now to your question, it is not possible to set the no of the cross section during the import. What you can do is, use get_object after the import to get the imported cross section, then you can use update_object on any cross section you want. After this you can use delete_object to get rid of any cross section which is not needed anymore.

If you have more then one cross section, you should work with a list of objects instead of single objects.

This is just a workaround, of course it is not the premium solution. I wrote a note (RUS ID 6010) to the development team, to implement this better.

Best regards
Robert Milrath

Dear robert.milrath,

Thank you for the warm welcome!

&

thanks for the quick reply and for forwarding this to the development team!

Thanks for the suggestion- Your temporary workaround sounds reasonable. I'll look into that.

Best regards,
Marilies Frei