How to check if a specific solid has been meshed in HyperMesh using TCL?

I have a question. After selecting a solid, how can I determine if this solid has already been meshed?
My current method doesn't seem to detect this properly. Do you know any TCL commands or approaches that can help with this?
hm_createmark elems 1 "by solids" $solid_id
My original idea was to first identify the component containing the selected solid, and then use [hm_getmark elems 1]
to check if elements exist. However, this approach seems problematic if the component contains multiple solids, and the elements happen to be associated with other solids rather than the one I selected.
Best Answer
-
Hi,
There's no API to select unmeshed solids. But there's one for unmeshed surfaces ⇒ hm_getunmeshedsurfstomarkFor instance:
#select all surfaces
*createmark surfaces 1 all
#get unmeshed surfaces in mark 2
hm_getunmeshedsurfstomark 1 2
#retrieve solids from previous unmeshed surfaces
hm_createmark solids 1 "by surface on mark"Does this method work for you?
Regards,
Fred.1
Answers
-
Hi,
There's no API to select unmeshed solids. But there's one for unmeshed surfaces ⇒ hm_getunmeshedsurfstomarkFor instance:
#select all surfaces
*createmark surfaces 1 all
#get unmeshed surfaces in mark 2
hm_getunmeshedsurfstomark 1 2
#retrieve solids from previous unmeshed surfaces
hm_createmark solids 1 "by surface on mark"Does this method work for you?
Regards,
Fred.1 -
thanks a lot.
i try this code.and the code is useful for shell mesh,
if i want to check "solid mesh",how to check by your code in advanced
0 -
proc is_solid_meshed {solid_id} {
set comp_id [hm_getvalue solids id=$solid_id dataname=collector.id]
hm_createmark elems 1 "by collector" $comp_id
set elems_temp [hm_getmark elems 1]set catch_result [catch {
eval *createmark elems 1 $elems_temp
*findfaces elems 1
}]
if {$catch_result != 0} {
# Solid not mesh
return 0
} else {
# Solid meshed
*createmark components 1 "^faces"
*deletemark components 1
return 1
}}
set solid_id 215
is_solid_meshed $solid_idCould my phrasing above be improved in any way?
0