How to check if surface exist in a model geometry

Using the python command line, is there a way to check if a surface with a given name exist in my model geometry?

There isn’t one specifically, but you could write a method based on the get_entity_name() method. Essentially loop through each surface until you find a surface with the name.

Also, you could use the parse_cubit_list() functionality as described here.

cubit.parse_cubit_list("surface", f'with name "{surfName}"')

Which will return a tuple (e.g. (589,) )… if it’s empty (i.e. () ), the surface doesn’t exist.

1 Like

Thanks @gvernon, I am using cubit.parse_cubit_list in combination with cubit.get_entity_name to get the the name of the surfaces that I want.