Grasshopper

algorithmic modeling for Rhino

Working script throws an error when changing slider values?

Good Day,

I've written a Python component that generates random numbers. The numbers are randomly chosen from range domains that are fragments of the starting, input domain.

The script works and outputs correctly, but each time I change the value of an input slider, the component turns red and throws the following exception:


R1 : Starting Range Lower Domain
R2 : Starting Range Upper Domain
X : Number of Domain Fragments
N : Number of Random Numbers to Output


I don't understand why!? When I reopen the component and rerun the script from the inside, it works again.

Any help is greatly appreciated. The script is attached.

Thanks!

 

Views: 350

Attachments:

Replies to This Discussion

Hi Marc,

around line 59, you redefine the keyword "range". Next time the script runs, "range" will be the last variable, so a tuple. range(), or "calling the tuple range", will give an error.

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

Thank you.

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service