Plug In Development - Rhino Crashes

We are currently developing an in-house plugin with Rhino Common for one of our projects. The plugin is meant to create a large number of polysurfaces, by copying, trimming, splitting etc. a large number of surfaces… We had developed a Python script before, which runs fine (albeit slow). When re-coding everything in Rhino Common, the plugin works fine (and is much, much faster). However, when processing a large number of items, Rhino crashes on a regular basis. I cannot really find out what is causing the crash…

What I did notice: Let’s say I have 100 items to process, I can run the plug-in fine by processing, let’s say, 20 items at once and executing the plug in five times in a row. When I select all 100 items at once, it crashes about half way through. Perhaps it’s some kind of memory issue (as I mentioned, the plug in does copy, trim, join a large number of surface/polysurfaces in rhino common, before creating the final rhino run-time objects).

Would anyone be able to direct me as to what is causing the crash and how to avoid it? Thanks.

You should probably start by running this through the debugger to get better info on what is going on.

Without that and certainly without code it is going to be hard to tell.

I assume you’re programming your plug-in with Visual Studio code, and have started your plug-in using the wizard. Make sure you have the debug configuration selected, built your plug-in code. Now start the debugger.

Whenever Rhino crashes the debugger should show you a call stack and some info about the reason.