[Rhino8] Purge() Object Freezes Rhino if a single object is selected

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!

PurgeBug

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

  1. Open new Document
  2. Run Script
  3. Notice times are very close together
  4. Draw a rectangle
  5. Select Rectangle
  6. Run Script
  7. 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)

We updated the Nvidia driver on one affected machine and the slowdown running the above script with a rectangle selected went from a 5 second to 40 seconds (!)
SysInfo_Occurs_Driver_Update.txt (2.3 KB)

Hi @david.birch.uk,

I will try to look at this later this week.

Thanks,

– Dale

Hi @david.birch.uk,

Your script seems fast here on my 3 year old Dell laptop - between 13 and 16 milliseconds. No freeze ups or lags.

– Dale

Thanks @dale

Same on my Dev PC, but this is occuring on several customer PC’s

Lag only occurs if objects are selected.

Anyone else able to replicate? Just open a new document & c# script editor, paste above and record times.

David

Hi @david.birch.uk ,
I have tried it and I can’t reproduce it either.

Could you please send us information about the computers on which it is not working properly? Please check that they have the latest service version of Rhino 8 installed and that Windows has all updates installed.

1 Like

Thank you @Guillermo_Varela & @dale

I can confirm this problem was resolved in Rhion 8.6 - I am no longer able to replicate it on the problematic machines. :slight_smile: