Repeatable hangs running macros. Sometimes it pauses for several seconds

Hi Mcneel team,

In the latest Beta (an a few build before that) I’ve been getting a lot of hangs after running simple macros. I run my macro from a button and after it finishes Rhino hangs for several seconds, sometimes as long as 30 seconds. It happens repeatedly but not always.

Some examples of the macros that I run where Rhino hangs:

1. Plane from center:

'_Noecho
_-Rectangle
_Center
_Pause
_Pause
_SetRedrawOff
_SelLast
_PlanarSrf
_Delete
_SetRedrawOn

2. Framed perspective (selected) :

'_NoEcho
_SetRedrawOff
_SetView _World _Perspective

-_ViewportProperties
_Lens 50 _Enter
_Pause
'_CPlane _World _Top
-_RunScript (
Call ZoomNonCurves()
Sub ZoomNonCurves()
If isNull (Rhino.SelectedObjects())Then
Rhino.ObjectsByType 1+2+8+16+32+256+512+4096+8192+16384+32768+65536+131072+134217728, 1
del=True
End If

Rhino.ZoomSelected
If del Then
Rhino.UnselectAllObjects
End If

End Sub
)
_ProjectOsnap
_Disable
_SetRedrawOn
_Echo

There’s a few others but these are the two that I use the most and it’s most apparent/annoying.

Thanks,

G

hi McNeel team,

The issue of random, but very frequent, hangs of up to 10-15 seconds when I run simple macros like the one above continues. It happens in both my desktop and my laptop builds.

Can you please address this? What other info do you need from me to address this issue?

Thanks,

Gustavo

I’ll run some tests in 9.0.26203.18303 try to replicate, should know something in an hr or so.

Not able to repeat here in 9.0.26203 — i ran your first macro in a timed loop, 25 runs, worst case was a fraction of a second. But that was driving it through a script harness, and the suspect code is what the toolbar system does after a button macro finishes — it updates the recent-commands list and saves toolbar/settings state, and that save path was reworked in recent betas to make backup copies and to retry-and-wait when something like OneDrive or antivirus has the file locked. That would look exactly like your random multi-second pause, and would hit any machine with the same sync/AV setup.

To narrow it down:

  1. Does it also hang if you paste the same macro at the command line instead of clicking the button?
  2. Is your Windows profile or %AppData% under OneDrive (or another sync tool), or a heavier antivirus than Defender?