🎉Community Raffle - Win $25

An exclusive raffle opportunity for active members like you! Complete your profile, answer questions and get your first accepted badge to enter the raffle.
Join and Win

Automated mass calc

User: "Altair Forum User"
Altair Employee
Updated by Altair Forum User

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.

Find more posts tagged with

Sort by:
1 - 6 of 61
    User: "Udhayakumar Ramasamy"
    Altair Community Member
    Updated by Udhayakumar Ramasamy

    Goto model browser and select component view (3rd icon) . You can see the mass, thickness, material everything assigned to the components there.

     

     

    image.png.2f8087035201b243210a0460340b0c68.png

    User: "Altair Forum User"
    Altair Employee
    OP
    Updated by Altair Forum User

    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.

    User: "vipin_22401"
    Altair Community Member
    Updated by vipin_22401

    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

    User: "Altair Forum User"
    Altair Employee
    OP
    Updated by Altair Forum User

    Vipin, thank you so much, this worked and saved me about 12 hours of repetitive clicking.

    User: "Altair Forum User"
    Altair Employee
    OP
    Updated by Altair Forum User

    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.

    User: "vipin_22401"
    Altair Community Member
    Updated by vipin_22401

    Hi @rrishav,

     

    Use  'by comp name' instead.