Sort points

I tried to make it look a bit like a tutorial. With a specific function per group.
With some explanation.

Some points of interest.

  • You could easily turn this into a complete numbering system.
  • I introduced a reference point, what is movable around your project, so you can start the 0 anywhere you want.
  • Using the Z, you could easily add a floor number to every surface.
  • Using a bounding box per building (so you know the range of x-min to x-max (same for Y) you could see in what building the surface is.
  • Using the x of centre of every surface (and sorting them) you could easily number the surfaces per floor
  • collect the numbers (merge or entwine) to create a label per surface
    Building: Floor: Surface: Wall : Corner.

I hope this is what you need, otherwise it will have enouhg material to find your own solution.

Regards, Eef

sort points test caseEW.gh (123.3 KB)

Okay thankyou! No problem at all

Hello @Eef_Weenink thanks for helping me. I like your approach, But for some surfaces the point ordening is not consistent.


Also for every form the zero point should start for example at this site.


As you can see here, the zero points do not start correctly on every side. The sides with two points are correct — these are the outer edges. However, where the two points are located on the inner side (i.e., for the smaller surface), it is incorrect.

Dear @Nick, this is the point to study + change the code in the .gh file.

  1. All zero points are referenced to a reference point Upper left Group.
    By moving the slider the point is turned between 0- 360 degrees around your project (and so will all the points with zero). If you need a reference per building , floor, etcetera, change it into a reference point for that (can be done with copy paste etc.
  2. In the “find centre of surface”, you may add a small function:
  • check rotation direction of the circle, if or if not clockwise >> flip curve.
    that forces that all circles will have the same direction and so will the numbers.

Regards, Eef

Hello @Eef_Weenink , I now made from each reference point a cirkel but if I change the seam all the point numbers are changing. if one instance has the right zero point then the other on a different axis does not.

sort points.3dm (66.5 KB)

sort points test caseEW.gh (135.9 KB)

For the surfaces that are rotated these green points should be placed here. So the reference points should be on the same side. then the zeropoints are correct.

Could you please explain a bit more about what should define the reference for the first point, and how the direction (clockwise or counterclockwise) should be determined?

Great, now every building has a circle around to move the reference point. If you want every referencepoint to move seperatedly, add this:


NB: Do not forget the Graft ^
Just move the sliders to rotate them around the project.

Hello Eef,

I get your point, but I want to make it generic. Every project can have a difference count of surfaces. This means now, that I have to add sliders for every surface and I don’t want that.

Do you know a solution for that?

take it apart, level per level:

  1. Per surface you want the starting point at the “same spot”. I suggested to use the reference point on the circle, but you could also do something with values of x or y; distance to a line; many options here, only depending on “what you want/need”
  2. Per level of your building (floors) you could renumber them by using the Z-value (the higher the Z the higher the floor number.
  3. Per building you could repeat the same kind of choices. Maybe you have a entrance road and want to number accordingly to the closer to the entrance or maybe closer to city centre.

So many solutions. It starts with want you want.

Secondly: Think about the numbering order:

  • clockwise anti-clockwise. I gave a solution with the small circles (not the one with the refence point) (I think you mixed these with eachother). With sorting along a curve you can order the segments of the polyline and you have your segments numbered correctly.

Think about it in “boxes of programming” (functions). Build a generic function to order segments clockwise; a generic function to number surfaces in the building, A generic function of ordering buildings etcetera.

regards, Eef

Hey Eef,

Thanks for your advice!

I found a solution for the sorting points problem. I used a different approach and also used some of your methods!