OBB script error


I’ve been trying to get the oriented bounding boxes (OBBs) for my segmentations, and have been trying to use the script found on this page (Script repository — 3D Slicer documentation) under “Markups ROI” of “Get size, position, and orientation of each segment.”

It always works smoothly until the very last line of code, where I get an attribution error as seen in the picture below.

Why is this happening and how can I fix it?
Thank you in advance for your help.