Extract element volume
Answers
-
Try:
hm_getvalue elems id=<Elem-ID> dataname=volume
0 -
Altair Forum User said:
Try:
hm_getvalue elems id=<Elem-ID> dataname=volume
How would I apply this command line? Scripting?
0 -
You can execute this command directly within command window (below of graphical area) or write it into a TCL script.
0 -
Altair Forum User said:
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?0 -
Write your own TCL script !
- Select elements
- Loop overs selected elements
- Each element, query the volume
- Write to file
0 -
Thank you!
Btw, I also found that you can easily plot and extract it from Hyperview by using derived results
0 -
Altair Forum User said:
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
0 -
You could perform this in HV using Result Math. You need to load your result files and choose 'Advance' in Math Template.
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"?>
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
1