I create an object in Rhino, and then I add a key/value pair in this Attribute User Text section. And then I would like to access that kv pair in Grasshopper somehow, but I can’t figure it out. Object will be a Brep. I can do python or C# scripting if needed.
I have tried brep.GetUserString(“key”) but that gives me null. Interestingly, I can SetUserString and then get the user string via GH, but the kv pairs I set that way do not show up in the “Attribute User Text” panel, which makes me think I’m barking up the wrong tree.
Well, I only need to GetUserString as I will be setting them manually when I create the object in Rhino (GH will use the info to create other objects that work in conjunction with the object I create), but that thread did it for me.
I used…
private void RunScript(Guid x, ref object A)
{
Rhino.DocObjects.RhinoObject obj = this.RhinoDocument.Objects.FindId(x);
string v = obj.Attributes.GetUserString("test");
A = v;
}