Need help on making a dictionary with point coordinates

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?

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.

-Kevin

2 Likes

Also, a couple of other potential problems I see from your screenshot.

  1. 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.

  2. 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!!!