Grasshopper

algorithmic modeling for Rhino

...I seem to be having trouble with some simple native functions, such as Sin(x), Cos(x), sqrt(x), for example...I'm getting a "Cos is not declared" (or Sin, or sqrt) error when I try to use these...I'm pretty reliant on trig functions, so this is a bit alarming to me.  All my old VB.NET components simply aren't running now.

I recently loaded the most recent build, but did so at the same time I moved from Vista to Windows 7...anyone have any clue what might be happening?

thanks,

Dave

Views: 243

Replies to This Discussion

You need to either type "Math.Sin(x)"
or import the math namespace, then you can use just sin(x)

http://msdn.microsoft.com/en-us/library/thc0a116(VS.71).aspx
Thanks, Daniel! math.xxx will completely work.

But...if I'm using the coder in GH, the "imports" section is greyed out and I can't add or edit text there. I'm curious: how do I go about importing the namespace in that arena?
Why and when did the requirement for this Math prefix become active.


Many thanks
I just noticed this as well. Hmmm as far as i can tell this was active since version 43, but i'm not sure. Is it possible to import the namespace?
Yea, I forgot that we can't simply type in "Imports System.Math" up there ourselves.
Maybe David can add this when he gets back.

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service