Calling object generator within ansys script

Ashish
Ashish Member Posts: 5
Name Dropper First Comment
edited June 2023 in Structures

Hi,

Is it possible to call the object generator tool within an IronPython script?

I am trying to use Python code to automate creating repetitive contacts and the object generator is great at doing that with just a few named selections. I would like to pass the named selections through the script and have the object generator auto generate adjacent contacts, all within the script.

Any guidance would be helpful. Thanks.

Answers

  • Ashish
    Ashish Member Posts: 5
    Name Dropper First Comment

    Any help would be appreciated.

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

    Hi @Ashish , I don't think that the object generator is exposed. However you can easily create an automation script to do what the object generator would do (ie loop through the entitites of the scoping in a named selection, create a Mechanical tree object and scope it to that entity).

  • Ashish
    Ashish Member Posts: 5
    Name Dropper First Comment

    Hi @Pernelle Marone-Hitz ,

    Thanks for the answer.

    I actually want the scoping to be done using the adjacent entities, which are a subset of the named selections I have created.

    For example, I have 10 bolts on a flange and I have a NS for all the bolt underheads and a NS for all the locations where they should be bonded. Object Generator automatically creates contacts for each bolt separately, instead of just bonding all the bolts together on the flange.

    As far as I know, it checks for adjacent entitities and decides how to create the contact. I am not sure if programming this myself is easy. Do you have any suggestions?