How to set refinement level Python

I had a lot of trouble finding documentation for how to set the refinement level for an object with the CollisionAPI. The following code should do the trick.

from pxr import Sdf

prim = prims_utils.get_prim_at_path("/some/prim/path")
ref_level = prim.GetAttribute("refinementLevel").Get()
    if ref_level == None:
        prim.CreateAttribute("refinementLevel", Sdf.ValueTypeNames.Int)
print(prim.GetAttribute("refinementLevel").Set(2))
2 Likes