Keep in mind that grips are not saved in a 3dm file. Rather, there are created, somewhat on the fly, when the user wants to use them.
Does does get saved in 3dm files are objects that inherit from
By design, Rhino will not save custom CRhinoObject-derived classes. This means, the
CRhinoRectangleObject found in the sample you referenced, will not be saved in he file. Rather, it’s base class, or
CRhinoCurveObject, will be saved.
Thus, the technique you can use to round trip custom objects, such as
CRhinoRectangleObject is to attached a piece of custom user data to the object that saves with the base object. Then when Rhino reads the 3dm file, check to see if the object has your custom data and, if so, convert it back to your derived class type.
The SampleMarker SDK sample project demonstrates how to do this.
Does this help