Hello forum members,
When I run the script, I am getting an this error. It is especially when I read the 3dm file, I came across this error.
C:\Users\fited\Desktop\python-rhino-script>python -m rhinoInsideTest2
Unhandled Exception: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
at UnsafeNativeMethods.CRhinoDoc_Delete(UInt32 serialNumber)
at Rhino.RhinoDoc.Finalize()
my script is
mport rhinoinside
rhinoinside.load()
import Rhino
import os
import time
# input file path
inputFile = r'C:\Users\fited\Downloads\2021_06_07_Brace_Model.3dm'
# get the template file path
templateFile = Rhino.ApplicationSettings.FileSettings.TemplateFile
rhinoDoc = Rhino.RhinoDoc.CreateHeadless(templateFile)
Rhino.RhinoDoc.ActiveDoc = rhinoDoc
Rhino.Commands.CommandStyleAttribute(2)
rhinoDoc.Import(inputFile)
time.sleep(10)
Rhino.RhinoApp.RunScript('_-GrasshopperPlayer 2021_03_11_Brace_Generation_Script.gh',False)
time.sleep(5)
Rhino.RhinoApp.RunScript(' -exit N _-Enter',False)