Hi,
After using the following line of Python code using Rhino.Inside Python in VS Code, I get an error after the script finishes. Could someone suggest how to fix this exception? I am not even sure if this line specifically causes the problem, but I noticed the script works fine when I skip this one.
centroids = [mesh.Faces.GetFaceCenter(i) for i in range(mesh.Faces.Count)]
Exception:
Unhandled Exception: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
at Python.Runtime.Runtime.PyObject_TYPE(BorrowedReference op)
at Python.Runtime.Runtime.NullGCHandles(IEnumerable`1 objects)
at Python.Runtime.Runtime.TryCollectingGarbage(Int32 runs, Boolean forceBreakLoops)
at Python.Runtime.Runtime.Shutdown()
at Python.Runtime.PythonEngine.Shutdown()
at Python.Runtime.Loader.Shutdown(IntPtr data, Int32 size)
Thank you for your time!!