Renumbering Grids from CAD layers

Hi community.
I have a dynamo graph which can create grids from vertical and horizontal grid lines. Bun numbering is incorrect as you can see on screetshot. How can i fix it?



Grids from CAD-4.dyn (73.0 KB)
Aks Örnek.dwg (121.5 KB)

Hi,

All you need to do is sort the curves from CAD, vertical by X horizontal by Y.

That should be an easy implementation.

Hope it helps

1 Like

Actually earlier version like that but if you consider grids, some of them are not orthogonal. I can’t sort non-orthogonal onnes that’s why i’m separating V and H grid layers from the CAD.

That is true, but as you can see here we are sorting by starting point of the curve, so the angle is taken out of the equation.

2 Likes

That’s good. I will try it. thank you uvery much @Josip.Komadina

1 Like

Just one more thing,
If you don’t want to separate them by layer, to determine horizontal from vertical, you could just do angle to axis and group them by proximity to 0.

Hope it helps.

1 Like

Wow thanks for sharing your knowledge

Where should i connect “Vector.AngleWithVector” node to determine the layer is horizontal or vertical?

Hi,

You could try something like this.

Hope this helps.

2 Likes

If you visit to Istanbul don’t forget to find me. I offer you the best Turkish Kebap in the city:)

2 Likes

Final Dynamo Graph. Hope someone will benefit from it.
Grids from CAD-Final.dyn (129.0 KB)

1 Like

Hi @Josip.Komadina & @arincakkin ,

Don’t get me wrong I think the approach of @Josip.Komadina is actually quite good and creative but I have to interject to express my concerns regarding the flaws of this method.

  1. This method only works when the grids are actually drawn vertically within the degrees of 0-10. In my testing I found out that some grids are actually drawn around 180 degrees, which this method does not account for.
  2. On a second node, all vertical grids drawn in a degree of 350-360 degrees are not accounted for in your method, and are as a result not added to the list.
  3. Also a third, maybe a bit less big of a problem, but this only works when you have 2 separate groups, if you have 3 groups this approach won’t split the second and third group.

I have created a small script which should solve these issues and make it a bit more robust:

2023-09-29 Sort Direction in X amounts of groups.dyn (55.3 KB)

2 Likes

Thank you @Daan .I will ctry it. And Another thing i want to do. What if we need create multi-segmented grids from Cad layers? Do you guys any idea for this issue? @Daan and @Josip.Komadina

1 Like

You could join them by start and endpoints, im sure there are already some posts about this on the forum.

Then to determine in which group they should fall perhaps the grid bubble should be the line which has the “domination” direction, but i’m not sure if that is the case, then using distanceto the start and endpoint you can find to which line/ direction it belongs.

1 Like