Jump to content
paul_a

Automated mass calc

Recommended Posts

I have a model with around 1400 property cards. I need to know the mass of the elements for each property. I started doing this manually by right-clicking property -> "isolate only", selecting all visible elements, and doing mass calc. However, this will take forever to do for all 1400 properties. Is there any way to automate this process?

 

Alternatively, if there is a way to calculate the mass for each material card, that would be useful as well. However, parts of the model are composites with multiple materials in a property, so this probably isn't possible.

Share this post


Link to post
Share on other sites

Thank you for responding, Udhay. Unfortunately, that won't work in this case because each component in my model has around 200 different properties within it. The masses I'm looking for aren't for the components, but the mass of all of the elements that have a specific property assigned. I can do this manually by isolating the elements of that property, selecting them, and using the mass calc tool, but that would take forever to do for 1400 properties. I was wondering if this was possible to do with a macro, for example, to speed it up.

Share this post


Link to post
Share on other sites

Hi @paul_a,

 

You can try a macro like this to save property information to csv file.

 

set fpt [open [tk_getSaveFile -defaultextension .csv] w]
puts $fpt "property name,mass"
set allProps [hm_entitylist props name]
foreach pName $allProps {
    *createmark elems 1 "by property name" $pName
    set temp [hm_getmass elems 1]
    set mass [lindex $temp 0]
    puts $fpt "$pName,$mass"
}
close $fpt

Share this post


Link to post
Share on other sites
On 11/1/2018 at 7:26 PM, vipin said:

Hi @paul_a,

 

You can try a macro like this to save property information to csv file.

 

set fpt [open [tk_getSaveFile -defaultextension .csv] w]
puts $fpt "property name,mass"
set allProps [hm_entitylist props name]
foreach pName $allProps {
    *createmark elems 1 "by property name" $pName
    set temp [hm_getmass elems 1]
    set mass [lindex $temp 0]
    puts $fpt "$pName,$mass"
}
close $fpt

Hello Vipin, I need to use comps instead of elems and extract the masses to a variable. I'm trying the same procedure as you mentioned, but not able to get mass for all components. Can you help. TIA.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
You are posting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...