COG and mass of unmeshed components

Alihan Alayoğlu_22549
Alihan Alayoğlu_22549 Altair Community Member
edited June 2022 in Community Q&A

I'm dealing with the calculation of COG and mass of the unmeshed components in HyperMesh.  Even though all the mats and props are assigned to the each component which contains solids, software doesn't give any COG or mass value.

I am able to find volume of solids and multiply with density to find mass but since nastran's summary template ctr_of_gravity only works with elements; looks like it is not able to calc COG as in a regular CAD tool.

Is there any way to find them out? I'm all ears for a TCL macro advice:) 

Tagged:

Best Answer

  • tinh
    tinh Altair Community Member
    edited June 2022 Answer ✓
    Hi did you try using command hm_getcentroid ?

Answers

  • tinh
    tinh Altair Community Member
    edited June 2022 Answer ✓
    Hi did you try using command hm_getcentroid ?
  • tinh
    tinh Altair Community Member
    edited June 2022
    example *createmarkpanel solids 1 "select solids of comps"; tk_messagebox -message [hm_getcentroid solids 1]
  • Alihan Alayoğlu_22549
    Alihan Alayoğlu_22549 Altair Community Member
    edited June 2022
    tinh said:

    example *createmarkpanel solids 1 "select solids of comps"; tk_messagebox -message [hm_getcentroid solids 1]

    It doesn't work. No message box after solid select-proceed

  • Alihan Alayoğlu_22549
    Alihan Alayoğlu_22549 Altair Community Member
    edited June 2022

    Thanks Tinh. hm_getcentroid works now. Just in a different way.

     

    *createmark solids 1 all
    hm_getcentroid solids 1

     

    Now I'm trying to directly transfer those xyz values from command window to create node by coordinates panel and obtain a complete macro including multiplication of density and volume to add the mass at that coordinate as CONM2 element :)

     

  • tinh
    tinh Altair Community Member
    edited June 2022

    It doesn't work. No message box after solid select-proceed

    i am sorry, just miss typing tk_messagebox instead of tk_mesageBox
  • tinh
    tinh Altair Community Member
    edited June 2022

    Thanks Tinh. hm_getcentroid works now. Just in a different way.

     

    *createmark solids 1 all
    hm_getcentroid solids 1

     

    Now I'm trying to directly transfer those xyz values from command window to create node by coordinates panel and obtain a complete macro including multiplication of density and volume to add the mass at that coordinate as CONM2 element :)

     

    oh my god, viewing an attached photo on smartphone's browser is too difficult, @Rahul, could you please improve it. too difficult using community website, compare with old forum website ! even i cannot type codes.
  • tinh
    tinh Altair Community Member
    edited June 2022

    Thanks Tinh. hm_getcentroid works now. Just in a different way.

     

    *createmark solids 1 all
    hm_getcentroid solids 1

     

    Now I'm trying to directly transfer those xyz values from command window to create node by coordinates panel and obtain a complete macro including multiplication of density and volume to add the mass at that coordinate as CONM2 element :)

     

    hi Alihan, don't createmark all codes like this *createmark solids 1 "by comp id" $compid; #replace $compid with actual id of the component; *createnode {*}[hm_getcentroid solids 1]; it will create yellow node at centroid of component if you have many comps, make a loop!
  • Alihan Alayoğlu_22549
    Alihan Alayoğlu_22549 Altair Community Member
    edited June 2022
    tinh said:

    hi Alihan, don't createmark all codes like this *createmark solids 1 "by comp id" $compid; #replace $compid with actual id of the component; *createnode {*}[hm_getcentroid solids 1]; it will create yellow node at centroid of component if you have many comps, make a loop!

    Appreciate for help