Hello. I have a complex 3D geometry consisting of several hundred element blocks, which is created and meshed through a Python script. What I need to do is create a sideset and nodeset containing all external surfaces. This would be the set of hex element faces which belong to one and only one element, or surfaces belonging to only one element block. Can this be done from Python, and if so, how? Thank you.
Hi @wilkesed,
here is a short example when all unmerged surfaces count as external.
#!cubit
reset
create brick x 1
create brick x 1
create brick x 1
move Volume 2 x 2 include_merged preview
move Volume 2 x 2 include_merged
move Volume 3 z 2 include_merged
webcut volume all with plane xplane offset 0 preview
webcut volume all with plane xplane offset 0
imprint vol all
merge vol all
mesh vol all
#!python
sids=cubit.parse_cubit_list("surface","all with is_merged=false")
face_ids=cubit.parse_cubit_list("face",f"in surface {' '.join(str(id) for id in sids)}")
cubit.cmd(f"nodeset 1 add surface {' '.join(str(id) for id in sids)}")
cubit.cmd(f"sideset 1 add surface {' '.join(str(id) for id in sids)}")
If that’s not what you need, can you share the geometry that you are working on or a smaller example?