Grasshopper

algorithmic modeling for Rhino

Hi,

 

I am tryng to create a piece of code that has only one output. If a statement is true the it outputs A if false it outputs B. Can anyone help?

Views: 1126

Replies to This Discussion

Are you using expressions, VB/C# script components, Python script component or are you compiling a GHA file with Visual Studio?

--

David Rutten

david@mcneel.com

Poprad, Slovakia

I am trying to use a VB script component. I want to be able to have three inputs; a boolean and two values and then return only one. I basically just need to know the command for outputing data. If X > Y output X else if X <  Y output Y.

I am trying to create a robot that follows a lght using an Arduino board and firefly. I will post the definition when it is finished.

I also have another more tricky problem. This is hard to describe; I have a point moving using Kangaroo and I want to create a tail line so every ms it creates a new point of the curve. Is this possible? I am right at the begining of this project but when I have finished I will be uploading all the files.

Attachments:

So if your boolean is called C (for condition), your values are called A and B and your output is called R (for result), then the code you're after looks like:

If (C) Then

   R = A

Else

  R = B

End If

--

David Rutten

david@mcneel.com

Poprad, Slovakia

Thanks that works great. My first bit of coding inside grasshopper very exciting.

Hello David,

How this method work if I was attempting it in Grasshopper?

I am trying to do this: I have a set of circles(curves) that have different radius based on attractor points, and if radius is less then "y" then I want it to create a planar surface.

please help

In VB code or in Grasshopper?

--

David Rutten

david@mcneel.com

Poprad, Slovakia

David,

In Grasshopper, please.

[Smaller Than]

Maths Tab>Operators Panel

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