# Dictionary from Geometry and Key

Hi,
Is it possible to create a dictionary with geometry ( in my case ModelCurves ) and keys ?

A bit of background why i need it
I have a n-sided polygon. Each side is made up of n-numbers of ModelCurves. I am modifying each curve separately. i.e, in the given image I am offsetting crv9 to 3m , crv8 to 1m and crv7 to -1, but all three curves remain a part of side āeā. So after modification I can recall all three curves just by giving key/index āeā.

My initial setup is like this ( image ). I select each ModelCurve manually in order and I get a list of 10 items.
Current list structure = [ 0,1,2, 3,4,5,6,7,8,9 ]
Required list structure = [ a:(1), b:(2,3), c:(4,5),d:(6), e:(7,8,9) ]

I dont mind typing a, b,c while selecting curves, but I should be able to recall each curve by their respective side alphatbet. Or in more simple words, i want to group each side with key. I was thinking Dictionary or similar function could be helpful where I could assign key to a set of curves. Is it possible ?

Sure, take a look at this approach:

2022-07-22 Dictionary from Curve direction.dyn (33.6 KB)

1 Like

grouping by vector is not enough.

these lines have the same vector, but should not be grouped together.

they should have the same vector and they should be touching

@Daan , it worked like charm. Just had to tweak some nodes since I am not using Dynamo2.
@timhevel , I understand the limitation of the graph. If I already had such shape, i would group it like this (image)