I have a gridview in which I display records for editing. Once complete, I want the “go” button to update not only the underlying database, but also the blocks represented by the rows in the gridview.
More specifically, each row has a field “ID” and each block has a field “ID”. Without the user having to select the blocks, I’d like the plugin to locate the appropriate block and update its UserData, as well as updating the corresponding row in the database.
I already have the code in place to update the database, but I’m stumped on getting the instance, itself.
If you are tracking instance objects by something other than an object guid, than you will have to dig through all instance references until you find the one you are looking for. For example:
RhinoObject objects = doc.Objects.FindByObjectType(ObjectType.InstanceReference);
if (null != objects && objects.Length > 0)
foreach (var obj in objects)
var instance_object = obj as InstanceObject;
if (null != instance_object)
// TODO: Is this my instance object? If so, update instance reference and then break...