Get mass and volume of each component

Jaggs
Jaggs New Altair Community Member
edited October 2020 in Community Q&A

Hello Friends,

 

I have lets say 100 components and I need to display each collector's mass, volume individually, can you please help me out.

 

With the piece of code shown below i am able to get net mass, volume of all the collectors which are displayed but not able to get individual collectors'

 

*createmark components 1 'displayed'

set i [hm_getmark comps 1]

foreach j $i {
set a [hm_getmass comps 1 'by comp id' $i]
puts $a

}

 

Thanks in advance.

Tagged:

Answers

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited November 2014

    *createmark components 1 'displayed'

    set i [hm_getmark comps 1]

    foreach j $i {

    *createmark comps 1 $j

    set a [hm_getmass comps 1]

    puts $a

    }

    It is giving the mass of all components because the mark 1 of components has all the displayed components in it. Each time the loop is run the mark needs to be updated with the id of the component.

  • tinh
    tinh Altair Community Member
    edited November 2014

    Hello Friends,

     

    I have lets say 100 components and I need to display each collector's mass, volume individually, can you please help me out.

     

    With the piece of code shown below i am able to get net mass, volume of all the collectors which are displayed but not able to get individual collectors'

     

    *createmark components 1 'displayed'

    set i [hm_getmark comps 1]

    foreach j $i {

    set a [hm_getmass comps 1 'by comp id' $i]

    puts $a

    }

     

    Thanks in advance.

     

    Hi,

    There is available template for component summary

    You can invoke the template from panel Post>summary>load the template 'components'>summary.  (optistruct, with other solver, name of the template file may differ)

  • Rahul_P1
    Rahul_P1
    Altair Employee
    edited November 2014

    Summary may only give mass and not volume in certain user profiles, 

     

    Perhaps you can convert the model to Abaqus format and use the below script,

     

    <?xml version="1.0" encoding="UTF-8"?>post-4438-0-07238200-1415870633_thumb.jp

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited November 2014

    @Jaggs : last solution is writing yourself a TCL script for that image/emoticons/default_smile.png' alt=':)' srcset='/emoticons/smile@2x.png 2x' width='20' height='20'>

  • Jaggs
    Jaggs New Altair Community Member
    edited November 2014

    Thank you very much for the help people.

     

    I have one more question, i need to find the volume of the solid now and I am using this commant 'hm_getvolumeofsolid solids solidID '.

    My question is what is solid id? Is there any difference between solid id and comp id?

     

    Please let me know.

  • tinh
    tinh Altair Community Member
    edited November 2014

    Thank you very much for the help people.

     

    I have one more question, i need to find the volume of the solid now and I am using this commant 'hm_getvolumeofsolid solids solidID '.

    My question is what is solid id? Is there any difference between solid id and comp id?

     

    Please let me know.

    Yes, there is a difference

    solids belong to solid object

    comps belong to component object

    so solid is different from comp

    to get solid ids you can use *createmarkpanel solids 1; puts [hm_getmark solids 1]

    to get solid ids stored in component compid you can use *createmark solids 1 'by comp id' $compid;puts [hm_getmark solids 1]

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited November 2014

    @Jaggs: Have a look at the page 'Data Names' of Hyperworks's help.