Find more posts tagged with
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?
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
Try: