algorithmic modeling for Rhino
Hello,
First of all: Thanks to the Grasshopper and GHPython community for your quick and helpful answers! This has been a great help in the last weeks.
Here is my current problem:
I have created a CSV file in OpenOffice describing stair case types and have imported it via GHPython.
I decided to store it as a dictionary so that each key (e.g. "a" indicating "Stair case type a") has an associated list of values (e.g. "1.2" as a width or "B" as a remark describing something else).
Question 1: Is that clever? This is the first time I have ever used dictionaries.
Question 2:
When I use type() to find out if I have successfully converted one of the items in a value (which is a list) from a string to a float I get an error. Here is an excerpt of the script:
This usually works fine in GHPython, so I'm guessing it has something to do with the CSV? Any help much appreciated.
I have attached the definition and CSV file.
Cheers,
Max
Tags:
Hi Max. It works fine on my machine. You sure you don't just have a phantom variable (you might have assigned the name type to a variable, overriding the type() function)? A good check is to simple close/open the file. /Anders
Ha! Spot on, thanks Anders :)
So would you use dictionaries for this task or is there a better way?
Sounds good, cheers!
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
© 2024 Created by Scott Davidson. Powered by