Finding body id based on surface name that it contains

Hi,

I am looking for a way to get the body name and its id using a surface that belongs to this body. For example, in the image below I would like to get the body id number (111) based on the surface name (Tear_Fault_13@A).

Let me know if you anyone knows how to do this using python. Thanks!

Body_Volume_Surface

You can use the Cubit “in” keyword. In the regular Cubit command language you can do

draw body in surface with name “Tear_Fault_13@A”

You can implement this in python using the parse_cubit_list method.

body_id = cubit.parse_cubit_list(“body”, "in surface with name ‘Tear_Fault_13@A’ ")

Note the use of the single quotes embedded inside double quoted string to represent the surface name.

Thanks,
Karl

Hi @karl,

Thank you, this solved my problem.

Best,