Grasshopper

algorithmic modeling for Rhino

Hello!

I just want to write a python script witch is not using the Rhino application just the rhinocommon.dll (so it should run from commandline, without open the Rhino). For import I used:

sys.path.append(r"C:\Program Files\Rhinoceros 5 (64-bit)\System")
clr.AddReferenceToFile("RhinoCommon.dll")

(I'm using IntelliJ for IDE)

It works fine, until I call the Rhino.Geometry.Brep.CreateFromLoft method, than its throw a bunch of errors:

Unhandled Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
at UnsafeNativeMethods.RHC_RhinoSdkLoft(IntPtr pCurves, Point3d start_point, Point3d end_point, Int32 loft_type, Int32 simplify_method, Int32 rebuild_point_count, Double refit_tolerance, Boolean bClosed, IntPtr pBreps)
at Rhino.Geometry.Brep.LoftHelper(IEnumerable1 curves, Point3d start, Point3d end, LoftType loftType, Int32 simplifyMethod, Int32 rebuildCount, Double refitTol, Boolean closed) at Rhino.Geometry.Brep.CreateFromLoft(IEnumerable1 curves, Point3d start, Point3d end, LoftType loftType, Boolean closed)
at Microsoft.Scripting.Interpreter.FuncCallInstruction6.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.LightLambda.Run8[T0,T1,T2,T3,T4,T5,T6,T7,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7) at System.Dynamic.UpdateDelegates.UpdateAndExecute7[T0,T1,T2,T3,T4,T5,T6,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6) at Microsoft.Scripting.Interpreter.FuncCallInstruction10.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.LightLambda.Run8T0,T1,T2,T3,T4,T5,T6,T7,TRet
at IronPython.Compiler.Ast.CallExpression.Invoke5Instruction.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.LightLambda.Run8T0,T1,T2,T3,T4,T5,T6,T7,TRet
at IronPython.Compiler.PythonCallTargets.OriginalCallTarget7(PythonFunction function, Object arg0, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6)
at IronPython.Runtime.FunctionCaller1.Default6Call1(CallSite site, CodeContext context, Object func, T0 arg0) at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2) at Microsoft.Scripting.Interpreter.FuncCallInstruction6.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.LightLambda.Run4T0,T1,T2,T3,TRet
at IronPython.Compiler.Ast.CallExpression.Invoke1Instruction.Run(InterpretedFrame frame)

and so on.....

other Rhino methods working fine.

Have you got an idea what should be the problem?

Views: 1186

Replies to This Discussion

This does not seems very grasshopper related but more like something you should ask over at discourse.rhino.com

A lot of RhinoCommon operations rely on Rhino being loaded. All the really interesting geometrical stuff requires Rhino to be installed and available. So this is expected behaviour.

We have a special build of RhinoCommon which only exposes those methods and classes which can be used without Rhino.exe, though I'm having a hard time finding it online now...

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service