algorithmic modeling for Rhino
Check this snippet of code: https://github.com/mostaphaRoudsari/dyfpy/blob/master/dyfpy/grassho...
TypeHint.TypeName will give you the type and Access will return item / list /datatree.
Ok Thanks
But this give me the TypeHint that I have choose?
And if I need the type of data that is entering?
I want to understand if I can change the behaviour of the script following the type of enetering data
if(string):
do this
else if (number):
do that
and so on...
Let's call your input `value`. Then you can try something like this:
try:
# assume it's a number
x = float(v) * 10
except ValueError:
# it is None or string
if v is not None:
print v
Anyway very useful
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by