Get distance between points

  1. get distance between points in same sublists


2. Distance between points in the same sublist

Thanks In Advance


2

Hi.
Check this recording about Lacing. Might help you to continue.
It will also be much easier to help you if you share you .dyn-file and dwg-file.

1 Like

I use Geometry. Distance to with lacing L1 and L2 with cross product lacing but the problem in my case with level I want to measure distances between points in the same sublists

@ENGRMA1234 ,

something like this …

KR

Andreas

1 Like

No, Like this image but in sublists I want to do it before flatten I don’t want to draw lines distances only


test1.dyn (14.2 KB)4
@patrick.ericson
@Draxl_Andreas

1 Like

Does this way work?

2 Likes

I’d go this way:

  1. List.Deconstruct set to @L2 for the list.
  2. Then Geometry.DistanceTo from the ‘first’ set of points to the ‘rest’ of the lists.
1 Like

I don’t want to make flatten and this way take the first point with the others points even if in the others sublists I want to take point with other points in the same sublist

It take the first point only with other points What about the second point… etc with the other points

Might be misunderstanding the question… can you post a data set of 3 sublists with 3 items per list, and the expected results if this isn’t correct?

1 Like

Hello, here is a clue

Cordially
christian.stan

3 Likes

Applying the method that @christian.stan provided above, in the manner below, should be the results you are looking for. Each item in each sublist is only getting compared to the other items within the same sublist. If this is correct, please mark christian’s answer as the resolution.

2 Likes

Hello and thank you :wink:, but the merit goes to Mr. Solamour for his handout (clear, precise, concise) of Ljubiana 2018
Cordially
christian.stan

4 Likes

Thank you for providing that link. I have been wanting to implement DesignScript more into my graphs and that will help out greatly!

3 Likes

Thank you very much. This is what I was looking for. It’s like magic

1 Like

Could I get the index of minimum item It should not be zero with code block
such as 2.5,1.5,0,0.5 I want to get the index of 0.5 the second min item or min item ( not be zero )

There may be a way to consolidate to one line of code, but this should work for you.

2 Likes

Thank you for your support , could I use with level2

Try this.

x = (a > 0);
y = List.AllIndicesOf(x@L2<1>, true);
z = List.GetItemAtIndex(a@L2<1>, y);
List.MinimumItem(z);

2 Likes