Hello, I’m a grasshopper newbie, and I need your help guys!!
I got points referenced to points in rhino, and got their coordinates using deconstruct method.
Using python script, I would like to get something like '{‘A’: ‘177.8, 51.47, 0’, ‘B’ : ‘277.8, 51.47, 0’, …), {‘name’ : ‘(x,y,z)’}
But it seems like I can’t get them. (Seems like it’s storing first letter of the point coordinates, 2 in 277.803971, 5 in 51.474662)
Python script:
bushing_dict = dict(zip(names,c_pts))
print "bushing_dict: ", bushing_dict
How can I solve this problem?
kev.r
(Kevin)
February 7, 2023, 2:03am
2
The names input is a list and the c_pts input is a DataTree.
For information about utilizing DataTrees with python, see this page:
Also you are more likely to get help if you attach a grasshopper file to your question.
Asking questions and getting answers is what this forum is all about. Although people are generally very helpful, there are things you can do to improve your chances of getting good and quick answers. Below you will find some suggestions, but don’t think of them as rules and especially don’t think of them as guarantees.
1. Choose a descriptive title for your post
Don’t title your question Help! or I have a problem or Deadline tonight!, but actually describe the problem you are having.
2. Be s…
-Kevin
2 Likes
kev.r
(Kevin)
February 7, 2023, 2:42am
3
Also, a couple of other potential problems I see from your screenshot.
Attaching multiple wires to a single input isn’t the best way to combine values. It’s easy to mix up the order of the combined values. It is better to get in the habit of using the Merge component.
You shouldn’t use the output of Panel components as inputs to other components. The Panel is converting all the data you pass through it into strings (if this is your intent, there are better ways).
-Kevin
1 Like
Hey Kevin, Thank you for your answer.
I think I need to watch more of the ‘DataTree’ tutorial videos!!!