How to export all reaction forces and moments in a file ?

Options

Hi,

Here is my problem : I would like to :
(i) create in Mechanical all the reaction forces and moments ;
(ii) export all these data in a file (.csv for example).

For the first point, I have writen a Python script, and I get a folder containing subfoler with reaction forces and moments for my boundary conditions, joints, beams, springs, contacts.

Now, I would like to create another Python script in order to export these data in a file.

I found the ACT extension "ACT reaction forces" and the export format is exactly what I want, one table for each type of reaction. But I don't know how to do that ...

I don't use this extension for two reasons:
1- It creates reactions in mechanical and the export file (and I would like, if possible, two separate process) ;
2- All reactions are in the global coordinate system and we can't select local CS for certain reactions.

Thanks for your help
Jean

Best Answer

  • Pernelle Marone-Hitz
    Pernelle Marone-Hitz Member, Moderator, Employee Posts: 810
    First Comment First Anniversary Ansys Employee Solution Developer Community of Practice Member
    Answer ✓
    Options

    You will indeed have to use the automation API to insert all reaction objects you need (like you seem to have done already). You can use with Transaction() method to suspend the graphics display while you're inserting those objects. Then, you'll have to evaluate the results. Once this is done, indeed you'll have to loop through the objects and export the data that you need.

    You could also have a look at this extension that seems close to what you want to achieve, and shares the source code.

    Finally, if all the info you need is contained in the "Result Summary" that Mechanical provides:

    you could consider using this code to export the data: https://discuss.ansys.com/discussion/292/how-can-i-export-results-summary-worksheet-in-mechanical Important note - this method uses undocumented and unsupported commands. We do not guarantee it will work, nor that it will work for all versions. Use at your own risk ;-)

Answers

  • Pernelle Marone-Hitz
    Pernelle Marone-Hitz Member, Moderator, Employee Posts: 810
    First Comment First Anniversary Ansys Employee Solution Developer Community of Practice Member
    Options

    Hi @Jean , not sure what your question is exactly. However I believe this post might help:
    https://discuss.ansys.com/discussion/2163/export-result-data
    Also, some extensions include the source code. You can check whether it is the case for that specific app, and reuse the parts of the code that are useful to you.

  • Jean
    Jean Member Posts: 9
    Name Dropper First Comment
    Options

    Hi @Pernelle Marone-Hitz ,
    Thanks for your answer.

    Unfortunately, the ACT extension only give the .wbex file.

    With your link, I should export reactions one by one.

    I'm wondering if there is a Python command, or an APDL command for : (i) generate all reaction forces and moment at once ; (iii) export them in a table format.
    And I would like to do this for : boundary conditions, contacts, joints, springs, beams.

    I hope my explanations are clearer.

    If it's not possible, I will try to export the data one by one in a loop.

    Regards,
    Jean

  • Jean
    Jean Member Posts: 9
    Name Dropper First Comment
    edited December 2023
    Options

    Thanks a lot for all these informations.
    I will try :)