Grasshopper

algorithmic modeling for Rhino

Id like to think im pretty clued up with VB.NET having worked wirh several .NET API's including CATIA. However, Rhino is stumping me right now. I want to access a Rhino application from an external form. Im guessing this is not what is referred to as a "plug in".

 

I can access and retrieve an existing Rhino application object, or create a new one, from my form. However, when I try to interact with Rhino in any any way through using my own functions defined in a class library (.dll), and using fucntions stored in the RMA library, I keep hitting a brick wall. I just cant get it to work.

 

As a test, see code below, I have a console application that is calling a Class1 object (referenced as an extenal dll) that  simply assigns a value to the x property of this object. Im usng the On3Dpoint object.

 

This simple instruciton causes an error message that is being duplicated in my more complicated project. I belive the Rhino_DOTNET.dll is up to date. Im targeting the .NET 2.0 frame work. Using Rhino 4, SR8. Note this is a very basic test just to see if it is the reference/compiler/other settings that are causing the probelm. Im not interacting directly with Rhino, just testing to see if I can call functions from the referenced RMA libraries etc. It appears I cant :(

 

This is the class1 code:

 

Public Class Class1

Sub test()

Dim oPt As New RMA.OpenNURBS.On3dPoint

oPt.x = 10

Dim btest As Boolean = False

End Sub

End Class

 

This is the console code

 

Module Module1

Sub Main()

Dim oClass As New Class1

oClass.test()

Dim bTest As Boolean = False

End Sub

End Module

 

 

 

The error message I get is

 

Could not load file or assembly 'Rhino_DotNet, Version=4.0.61206.14, Culture=neutral, PublicKeyToken=552281e97c755530' or one of its dependencies. An attempt was made to load a program with an incorrect format.

 

 

HELP!!!

 

 

 

Views: 265

Replies to This Discussion

True, you cannot load the Rhino SDK from 'abroad'. Your code has to be running inside Rhino.
I think Steve is looking into ways of making this easier in the Rhino5 SDK, but for the time being your only option is to make a plugin that runs inside Rhino, and then somehow communicate with rhino through that plugin.

--
David Rutten
david@mcneel.com
Poprad, Slovakia
Thanks fo the reply David. At least I can get some sleep now so I can approach this from another angle. Ill post something when I get it to work.

Awesome work by the way,

Steve

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

© 2022   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service