Grasshopper

algorithmic modeling for Rhino

Hi everyone,

I just started learning ghpython just a few weeks ago and now I'm trying to create a simple grasshopper component using python. However, while creating a few codings, I have ran into a few problems.

1) For the above coding, I am trying to set a certain rule so that the output with either be 0.8 or 0.7. However, when I tried the component, the answer will always be 0.8 even if the input complies with the first rule.

2)

And for the above coding, I am not sure why the definition of the input doesn't work. Do anyone have an idea of what is causing these problems? Thank you. I would appreciate the help. 

Views: 536

Replies to This Discussion

Hi SXS

I will not recreate the definition, because not all details are available, but I'd say: in the first one, the is operator is wrong. You should use value equality ==. I don't have values to test this, though.

In the second pic, I would not use any sign that is non-ASCII. And, b is not defined in your second GhPython script.

I hope this helps,

Giulio
--
Giulio Piacentino
for Robert McNeel & Associates
giulio@mcneel.com

I see, thank you very much for your help. It's very helpful.

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service