Get_similar_volumes and get_similar_surfaces input type in Python API

Hello, I’m trying to use the get_similar_volumes and get_similar_surfaces methods in Cubit’s Python API on a Mac with Cubit 2021.4. I have provided the method both an integer with the value of the volume/surface ID I would like to get the similar volumes/surfaces for as well as a list including just the integer volume ID and in both cases, I get the same type error:

TypeError: in method 'get_similar_volumes', argument 1 of type 'std::vector< int,std::allocator< int > >'

As I understand it, this is a C/C++ type that it seems to be asking for.

Am I just not giving it a type it understands? Can someone let me know what type it needs?

The data types passed through the CubitInterface were kept simple by design. In C++ those types are int, double, string, and vectors of those types. In python, that maps to int, float, string, and lists of those types.

The error of std::vector< int, …> indicates that you must pass a list of volume ids. Even if only there is only one volume id, it must be in a list.

For example,

similar_vols = cubit.get_similar_volumes( [1] )

Thanks Karl. I ran a simple example to verify the method’s operation and found that my type issue was coming from a specific if statement condition setting some of my volume ID lists back to integers. Thanks for verifying the input type here!