Strange one for you - Purging Objects - can Freeze Rhino - but only if you have an object selected.
I can replicate this on two differently specified windows 11 PC’s but not on a 3rd.
Notice the 5 second lag the second time the script is run below!
This is a toy example but the real issue is causing up to 10minute freezes on our CNC machines & preventing our recommending an upgrade to Rhino 8 to customers.
To reproduce
- Open new Document
- Run Script
- Notice times are very close together
- Draw a rectangle
- Select Rectangle
- Run Script
- Notice Significant Freeze and gap between times
using System;
using Rhino;
using System.Linq;
using Rhino.Geometry;
using Rhino.DocObjects;
var doc = RhinoDoc.ActiveDoc;
// create / find reference layer
int layerId = doc.Layers.FindName("Ref")?.Index ?? doc.Layers.AddReferenceLayer(new Layer { Name = "Ref"});
var layer = doc.Layers.FindIndex(layerId);
// add reference objects
for (int i = 0; i < 1000; i++)
{
var circle = new Circle(50).ToNurbsCurve();
doc.Objects.Add(circle,new ObjectAttributes {LayerIndex = layerId});
}
Console.WriteLine("Created "+ DateTime.Now.ToString("hh.mm.ss.ffffff"));
// delete them
doc.Objects.FindByLayer(layer)?.All(doc.Objects.Purge);
Console.WriteLine("Deleted " +DateTime.Now.ToString("hh.mm.ss.ffffff"));
SysInfo_Occurs.txt (2.3 KB)
SysInfo_DoesNotOccur.txt (2.4 KB)