🎉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

Extract element volume

User: "Joao_21860"
Altair Community Member
Updated by Joao_21860

Dear all,

 

I need to carry out some calculations and for that, I need to know the volume of each element separately.

 

Is there an easy way I can extract these values from hypermesh or even hyperview?

Find more posts tagged with

Sort by:
1 - 8 of 81
    User: "QuyNguyenDai"
    Altair Community Member
    Updated by QuyNguyenDai

    Try:

     hm_getvalue elems id=<Elem-ID> dataname=volume

     

    User: "Joao_21860"
    Altair Community Member
    OP
    Updated by Joao_21860

    Try:

      hm_getvalue elems id=<Elem-ID> dataname=volume

     

    How would I apply this command line? Scripting?

    User: "QuyNguyenDai"
    Altair Community Member
    Updated by QuyNguyenDai

    You can execute this command directly within command window (below of graphical area) or write it into a TCL script.

    User: "Joao_21860"
    Altair Community Member
    OP
    Updated by Joao_21860

    You can execute this command directly within command window (below of graphical area) or write it into a TCL script.

     

    I applied this command but it seems to extract the volume from single elements. I have a component with 1 million + elements so what I need is to extract the volume of every element and save it into a file.

    Is there a way to adapt this command to automatically do it? Or is there another way?

    User: "QuyNguyenDai"
    Altair Community Member
    Updated by QuyNguyenDai

    Write your own TCL script !

    • Select elements
    • Loop overs selected elements
    • Each element, query the volume
    • Write to file
    User: "Joao_21860"
    Altair Community Member
    OP
    Updated by Joao_21860

    Thank you!

     

    Btw, I also found that you can easily plot and extract it from Hyperview by using derived results

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

    Thank you!

     

    Btw, I also found that you can easily plot and extract it from Hyperview by using derived results

    Hey, friend. I'm also trying to extract the volume of all elements in a model. Could you tell me how did you make it in Hyperview? T

    User: "Adriano_Koga"
    Altair Employee
    Updated by Adriano_Koga

    You could perform this in HV using Result Math. You need to load your result files and choose 'Advance' in Math Template.

    image.png.b2425b4209842ad980372fda1b86eca5.png

     

    Then, go to 'Derived Results' tab, and create a new expression, giving it a name.

    This lets you created derived expressions based on some results, math, etc.

    You will edit the expression using the command' Volume()' and save it.

    After that, you will have a new result with the name you gave. Contour this result in 'Contour' tab and then use query to request all the elements, then export it as a CSV.

    <?xml version="1.0" encoding="UTF-8"?>image.thumb.png.4e9d8bb0f76ec3daec1a0e4c7eb06e05.png

     

     

    In HM you can use the command line mentioned in above replies with a few changes.

     

    #user selects elements and stores in a variable elems_list

    *createmarkpanel elems 1 'select elements to calculate volume from:'

    set elems_list [hm_getmark elems 1]

    *clearmark elem 1

     

    $retrieves the volume of all the elements stored in mark 1

    eval '*createmark elems 1 $elems_list'

    set volume_list [hm_getvalue elems mark=1 dataname=volume] 

    *clearmark elems 1

     

    #writes the data to a CSV file

    set fo [open 'dir/filename.csv' w]  ; ### CHANGE THIS ###

    foreach elemo $elems_list volo $volume_list {

         puts $fo '$elemo $volo'

    }

    close $fo