Grasshopper

algorithmic modeling for Rhino

Hi,

I am trying to get some random numbers in a vb scripted componentm, similar to the functionality the random component in grasshopper already gives you. I was trying to find a GH Class which does it with Reflector but I was not able to find it. If someone could tell me where to find it or an alternative way, that would be great.

Many thanks, Philipp

Views: 1275

Replies to This Discussion

well... found it... ;)

Dim RandomClass As New Random
Dim RandomNumber As Integer
RandomNumber = RandomClass.Next(4, 14)
This will give you different random numbers each time, use a seed if you want the same random numbers each time:

Dim rnd Ad New Random(537)

The seed can be any integer value.

--
David Rutten
david@mcneel.com
Seattle, WA
Good to know, thanks david !

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