Redraw doesn't update Property panel in Rhino 7

The following code works in Rhino 6. Meaning, after is executes, the object’s “Name” property is updated with the new name in the “Properties” panel.

CRhinoObjectAttributes attribs = obj->Attributes();
attribs.SetName(newName, true);
bool result = RhinoApp().ActiveDoc()->ModifyObjectAttributes(obj, attribs);
RhinoApp().ActiveDoc()->Redraw();

In Rhino 7, the “Name” is not updated until Rhino loses and regains focus. A selection event also updates it. How can I force an update of the “Properties” panel after I change the “Name” attribute?

Hi @mike14,

Where you are running this code from? (a command? a panel? etc…).

Also, after modifying the name attribute, there is no reason to redraw the doc, since to geometry changes were made.

– Dale

From a panel.

Just confirmed that it works fine from a Command. But I put the above code (minus the unnecessary Redraw) into a CRhinoTabbedDockBarDialog’s ON_BN_CLICKED function and it does not update the name.

Hi @mike14,

Having your button click handler run a test command is actually a very good approach for this.

– Dale

In Rhino 6 when I rename an object from a panel, the Properties panel updates on its own. Has this capability been removed from the API in Rhino 7? Or is this a bug?

Hi @mike14,

Without a sample that allows me to repeat what you see, I have no idea.

Did scripting a tet command work?

– Dale

Yes. If I execute the same code from within CRhinoCommand::RunCommand it does not exhibit the problem.