Hi there, in our plugin we set & remove a temporary UserData flag on objects to mark them for processing or not.
This works perfectly in Rhino 7 and used to work in Rhino WIP but now I am testing in Rhino 8 I am getting errors.
This is approximately the code I have
[Guid("myguid")]
public class MyFlag : UserData {
//I do not want it to serialize so never implemented any of the override methods.
}
...
RhinoObject o
var oFlag = o.UserData.Find(typeof(MyFlag));
// test for presence
var HasFlag = oFlag != null;
// add flag
if (!o.UserData.Add(new MyFlag ())) {
**This is the error - Add always seems to fail **
}
// remove
if (!o.UserData.Remove(oFlag)) {
// also get an error
}
Is there any way to know why Add is failing?
Is it because I am saving the UserData on the RhinoObject? If i change to RhinoObject.Geometry then i get no issues. However calling this on RhinoObject definately works in Rhino 7. Both descend from CommonObject
which is where i think the UserData is stored.