Can elements with mixed properties be organised into seperate components bearing the same properties assinged to the Component ID

Xavier
Xavier Altair Community Member
edited July 2022 in Community Q&A

here is a simpler example of the problem
the elements are present in one Component (Auto)
with mixed property (all 4 thickness assinged to the elements) i have even attached solver deck file.
imageimage

after the reorganizing the elements and sorting them into new Components, with their respective prop_name as Component_name  assigned with respective property ID it would be as shown below.


image    image   
i have done this manually, in the actual model there is more than 150 properties to be done in the same way
is there any simpler way to do it, kindly suggest.

thanks in advance

Xavier

Answers

  • Ben Buchanan
    Ben Buchanan
    Altair Employee
    edited July 2022

    The attached should get you what you want.  Should be pretty easy to modify too.

  • Xavier
    Xavier Altair Community Member
    edited July 2022

    Hello Ben,

    thanks for script, it helps in half of the work( Creates new Components and stores the respective property elements in that component)

    but the other half is left out( Renaming the Component name as same the Property name, and assigning the Components to their respective property)

    kindly have a look into the below indication.

     imageimage

  • Ben Buchanan
    Ben Buchanan
    Altair Employee
    edited July 2022
    Xavier said:

    Hello Ben,

    thanks for script, it helps in half of the work( Creates new Components and stores the respective property elements in that component)

    but the other half is left out( Renaming the Component name as same the Property name, and assigning the Components to their respective property)

    kindly have a look into the below indication.

     imageimage

    For the name you can change line 28 to:

    set newComp [hm_latestentityid comp name="$propName"]

    and to add that property to the component use the following:

    *setvalue comps id=$newComp property=$propID

    or you can forget all this and just import your model and create components by property.

    image

    LoL sorry I didn't think of this before.