Grasshopper

algorithmic modeling for Rhino

So I am trying to use the round function.  From the expression editor function list is says 

Round(x[,d])

The issue is when I type this in I get an invalid expression (1519)

 

I am sure I don't have something correct with the syntax, but can't figure it out.  Anybody else run into this problem.

 

Dennis

Views: 6539

Replies to This Discussion

Figured it out.  Instead of Round(x[,d])

it's Round(x,d).

Not sure why the square brackets are listed.

Hi Dennis,

 

square brackets indicate optional arguments in VB documentation notation. So you can type both Round(x) and Round(x, d)

 

--

David Rutten

david@mcneel.com

Poprad, Slovakia

Hey David,

 

I was wondering if d could be integrated to the round component? I was happy to see the round component. But I do not use it (most of the time), because the d is important.

 

 

Best Regards

DeDackel

 

ps.: hope you had some fun in Berlin :-)

David 

Apologies for being stupid bu could you tell me what wrong with this? Doesn't appear to round. I'm very new to all this

I think you need to set the variable a = math.round() result. Right now you are just setting a = to the original values inputted.

Something like this

RoundValue = math.round(x,2)

A= RoundValue

Syntax for grasshopper expressions and Visual Basic code is different. In this case, the function doesn't do anything because you do not store the return value. It should read:

x = Math.Round(x, 2)

Print(x)

A = x

--

David Rutten

david@mcneel.com

You guys are awesome

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