OpenNest System.NullReferenceException error

Hi @Petras_Vestartas,

today i’ve tried to use OpenNest and the Rhino Plugin. I’ve downloaded the newest from Food4Rhino, unblocked and put the folder opennest133_0 in my Grasshopper libraries folder. Next i installed the OpenNestRhino.rhp PlugIn using PluginManager. Installation worked fine but if i run OpenNest command, after the prompt for options, sheet polyline and objects for nesting i just get this error:

Command: _CommandHistory
Command: _CommandHistory
Command: OpenNest
OpenNest: Number of sheets: 1
Exception caught during RunCommand
System.NullReferenceException: Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.
bei OpenNestLib.OpenNestUtil.SortGuidsByPlanarCurves(List`1 guids, Double tol)
bei OpenNestRhino.OpenNest.GetObjectsToNest()
bei OpenNestRhino.OpenNest.RunCommand(RhinoDoc doc, RunMode mode)
bei Rhino.Commands.Command.OnRunCommand(Int32 commandSerialNumber, UInt32 docSerialNumber, Int32 mode)
Command: _CommandHistory

The translated error means: NullReferenceException. This is with Rhino 6 SR34 (6.34.21034.7001, 02/03/2021). Anything i can do to make the PlugIn command work ?

The OpenNest GH component seems to work ok with a simple example.

thanks for any help,

Is the same error persists with 1.3.3 (previous one) ?

On Rhino 7 I am using it works fine, if the 1.3.3 does not work neither let me know.

Thanks @Petras_Vestartas, i’ve removed the old version and installed 1.3.3 instead. It works with the 6 recangles and with the 9 polygons in the file below. However if i use the outlines of the letters A,B,C it gives me the same NullReferenceException error.

Once i convert the letters to polylines, everything works as expected, so it must be either the font or something else.

OpenNestExample.3dm (307.8 KB)

btw. could you please print to the command line once it is finished or redraw once ?

The red polylines works (red polylines) on my pc (curves not):

btw. could you please print to the command line once it is finished or redraw once ?
This I can do. For now the Rhino Plugin, is really the most basic one.

Do the red polylines works for you ?

Hi @Petras_Vestartas, yes the red polylines work as expected.


Yup curves must be converted to polylines in Rhino already.
Or I usually use this trick. If you have polygons around curves, they will be nested and then curves would automatically be oriented. Rhino OpenNest Plugin orient curves that are inside closed polylines automatically. Just be sure these polylines fully enclose curves (you need to generate those curves yourself).

Thanks a lot for the tip Petras. I am wondering, is the basic packing feature of OpenNest exposed in the Rhino PlugIn ? Is this accessable from eg. Python like shown below:


So far i’ve not tried to access the gha with NodeInCode, but i guess this works out of the box. Reason why i try to access the rhp directly is the load time when i try to access the gha.


I added a version for you 1.3.4 so that you could use OpenNestLib.dll as a library.
I attach the Rhino Command file. You will need to translate this to Python to get correct workflow. Or a simpler way, would be Rhino Plugin setup in visual studio using C# so that you could contribute directly for the plugin using file attached.

I would not go into that sketchy way of using .gha or .rhp file.

OpenNestRhino.txt (15.4 KB)

Let me know how it works, I curious to have contribution.


Thank you a lot Petras. I will report back how this works, so far i can load it like this:



1 Like