My plugin has a command that updates a large number of entities in a way like this:
foreach (MyCustomBrepObjectDerived obj in myObjectsCollection)
{
Brep new_brep = MakeMyBrepChanges();
MyCustomBrepObjectDerived new_obj = new MyCustomBrepObjectDerived(new_brep);
doc.Objects.Replace(new ObjRef(obj.Id), new_obj);
}
The problem is that this operation is very slow and takes very much of the time.
Is there a way to speed up the database changes? In AutoCAD, there is the Transaction class that manages the database changes in a single session. Is there a similar thing also in Rhino?
Thanks in advance
Giorgio