GH: Py script can't change obejct name

Why doesn’t the following GH/Python-script code execute? The rs.ObjectName function fails.

When I do the same thing via Tools | PythonScript it works fine.

// Rolf

(The original post is no longer editable, some “empty tag” makes it fail so I have to post a reply to myself instead).

Hm… perhaps this attribute simply does not exist for non-baked Breps? If so, then the component should do something like “BakeWithNames” instead.

But how do I do that?

Edit: Solved

// Rolf