Grasshopper

algorithmic modeling for Rhino

What is wrong with my Grasshopper installation?

Rhino 4 (latest service release) and Grasshopper (latest version) are running without problems -

with one exception: If I try to run even the simplest VB.NET examples I get error messages as for instance: "Name cos is not declared" (when I wanted to compute the cosine of an angle)...

 

It seems to me that the VB-component has no knowlege of Basic keywords and Rhino-Objects/Methods.

 

Can somebody help me??

Thanks, Peter

Views: 1135

Replies to This Discussion

Hi Peter,

This is because scripting components have now switched over to using the new RhinoCommon library rather than the old RhinoDOTNET/OpenNurbs one. If you still want to use the old library you can - you just need to use a 'legacy' scripting component rather than the normal one.

Hope this helps,

Paul
Thanks for your reply!

And how can I import the new RhinoCommonLibrary?
My grasshopper only offers one kind of VB-component.

Peter
To get the legacy script components in the most current GH, you have to expand the "script" component group...also, to access the math functions, you have to lead in with "math." so math.cos, or math.sin, or math.pi, etc.
You should actually have two types, though the legacy version is hidden in the drop-down list so it's possible you may have missed it:


The difference is in the 'imports' region. The new 'normal' components have:

Imports Rhino
Imports Rhino.Geometry
Imports Rhino.Collections

and use RhinoCommon, the old 'legacy' ones have:

Imports RMA.OpenNURBS
Imports RMA.Rhino

instead, meaning they use RhinoDotNet (i.e. the ON... objects most of us are more used to). So you shouldn't have to do anything special to import one or the other, you should just have to pick the component you want.

I just noticed you were having problems with cos as well - this is because in VB.NET cos is actually hidden away in the 'math' namespace - to use it in grasshopper you need to use math.cos() rather than just cos().

Paul
Thanks very much - this really helps ;-)
Peter

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service