Grasshopper

algorithmic modeling for Rhino

hi, i am trying to make a simple definition with python in gh,

any idea?

best,

Views: 2563

Attachments:

Replies to This Discussion

can you post the code inside the script cause I don't have Rhino handy now. 

M.

i want to take results only if the input is True!

tnx in advance,

Attachments:

the code is totally incorrect

ok..

 you have to use indentation in your scripts. (the following is not tested)

if x:

    a=y

    print "Bazinga"

else:

    print "x is false so I do nothing"

note: type hint to x as bool

        y is something i don't know what you are going to choose for this i can't make it out from the screenshot

EDIT: indentation is the four red dots you get when you press "tab" and the they define your loops and if statements.

print means you are outputting a string. so if you only want to print something you don't need an output parameter ( the a)

if x:

    print "y"

else:

    print "x is false so I do nothing"

to set an input as a boolean right click on the input ->dropdown type hint bool

y is going to be type hint float

ok! it works!

but i still get a number in a

output prints "x is false so I do nothing" but (a) continues to print numbers

Attachments:

your a=y must be out of the loop

see the attached

And I was sure that I could manage just fine from my iPad.

there you go

Attachments:

ah ok! i get it... i take results only from the "out"!

tnx Marios!

no worries.

but from out you are getting runtime messages(it can be only string|text)

a is your parameter output (so it can be a point, a mesh, everything)

you have to get this sorted out..

best,

M.

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2025   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service