How to hide coms/solid/surfaces using their volumes or surface area in TCL ?

set vols {}
set areas {}
*createmark comps 1 all
foreach a $areas b $vols {
if { 90000 <= $a && $a <= 100000 } {
hm_createmark {#what input should I give}
*maskentitymark {#comps/solids} 1 0
}
if { 100000 <= $b && $b <=120000 } {
hm_createmark {#what input should I give}
*maskentitymark {#comps/solids} 1 0
}
}
I have volume and areas Values of each comps in set vols and in set areas respectively. Now with some range criteria I want to filter values and at same time I want to hide the respected (if comp1 have area 99000 then that comps/solid should be get selected) entity. How can I proceed further to complete this syntax. Please guide...
Answers
-
do you have the volumes and areas in the same order as your components IDs?
Ideally it would be nice to have also an ordered list with the corresponding Component IDs.
How did you obtain these area/volumes?
0 -
Adriano A. Koga_21884 said:
do you have the volumes and areas in the same order as your components IDs?
Ideally it would be nice to have also an ordered list with the corresponding Component IDs.
How did you obtain these area/volumes?
*createmark comps 1 all
set comList [hm_getmark comps 1]foreach cmp $comList {
*createmark surfs 1 "by collector id" $cmp
set n_surfList [hm_getmark surfs 1]
set tot_area 0
foreach surf_id $n_surfList {
set area [hm_getareaofsurface surface $surf_id]
set tot_area [expr $tot_area + $area]
}
set areas [concat $areas $tot_area]*createmark solids 1 comps $cmp
foreach s [hm_getmark solids 1] {
set vol [hm_getvolumeofsolid solids $s]
}
set vols [concat $vols $vol]
}By using above syntax I get the volume and areas. So the volume and areas are in same order of the component IDs.
0 -
shubham Dhokare_21832 said:
*createmark comps 1 all
set comList [hm_getmark comps 1]foreach cmp $comList {
*createmark surfs 1 "by collector id" $cmp
set n_surfList [hm_getmark surfs 1]
set tot_area 0
foreach surf_id $n_surfList {
set area [hm_getareaofsurface surface $surf_id]
set tot_area [expr $tot_area + $area]
}
set areas [concat $areas $tot_area]*createmark solids 1 comps $cmp
foreach s [hm_getmark solids 1] {
set vol [hm_getvolumeofsolid solids $s]
}
set vols [concat $vols $vol]
}By using above syntax I get the volume and areas. So the volume and areas are in same order of the component IDs.
as you already have a list named 'comList' the same size as the 'areas' and 'vols', you could add it to the foreach loop.
#...using the 'comList', 'areas', and 'vols'
foreach a $areas b $vols c $comList {
if { 90000 <= $a && $a <= 100000 } {
hm_createmark comps 1 $c
*maskentitymark comps 1 0
}
if { 100000 <= $b && $b <=120000 } {hm_createmark comps 1 $c
*maskentitymark comps 1 0
}
}1 -
Adriano A. Koga_21884 said:
as you already have a list named 'comList' the same size as the 'areas' and 'vols', you could add it to the foreach loop.
#...using the 'comList', 'areas', and 'vols'
foreach a $areas b $vols c $comList {
if { 90000 <= $a && $a <= 100000 } {
hm_createmark comps 1 $c
*maskentitymark comps 1 0
}
if { 100000 <= $b && $b <=120000 } {hm_createmark comps 1 $c
*maskentitymark comps 1 0
}
}I used solids ID instead Comps and that worked for me.
*createmark solids 1 all
foreach s [hm_getmark solids 1] {
*createmark solids 1 $s
set center [hm_getcentroid solids 1]}
By using above I extracted the X Y Z coordinates of solids. Now using that I want to hide the same comps/solids. I tried to use foreach command but not sure what input should I give to hm to read the data according to X Y Z coordinates. If there any other solution available please let me know...
foreach a $center {
if { #what input should I give } {
hm_createmark solids 1 $c
}}
in this when I use "puts $a" just before the if statement it gives me values X Y Z coordinate.
0