Hi,
When running an ironpython script, the if __name__ == '__main__':
seems to be causing an error. I’ve checked the script in Rhino 7 and works fine.
Is this a Rhino 8 bug, or do we need to do something differently here?
Test file: GridLayout.py (2.1 KB)
The error the console is returning:
System.NullReferenceException: Object reference not set to an instance of an object.
at Eto.Forms.Window.set_Title(String value) in D:\BuildAgent\work\dujour\src4\DotNetSDK\Eto\src\Eto\Forms\Window.cs:line 244
at InvokeStub_Window.set_Title(Object, Object, IntPtr*)
at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
— End of stack trace from previous location —
at Python.Runtime.PythonException.ThrowLastAsClrException()
at Python.Runtime.PythonException.ThrowIfIsNull(NewReference& ob)
at Python.Runtime.PyModule.Execute(PyObject script, PyDict locals)
at Python.Runtime.RhinoCodePythonEngine.ExecuteScope(PyModule pyscope, PyObject pycode, String pythonFile, IDictionary2 inputs, IDictionary
2 outputs, String beforeScript, String afterScript)
at Python.Runtime.RhinoCodePythonEngine.RunCode(String scopeName, Object code, String pythonFile, IDictionary2 inputs, IDictionary
2 outputs, String beforeScript, String afterScript)
at Rhino.Runtime.Code.Languages.PythonNet.CPythonCode.ExecutePython(ExecuteContext context)
at Rhino.Runtime.Code.Languages.PythonNet.CPythonCode.ExecuteCode(ExecuteContext context)
at Rhino.Runtime.Code.Code.Run(ExecuteContext context)
Thanks!
Dan