Hello,
I guess it is the task for aspiring, as it needs some time to be spend to find solution. Anyway I will take a risk and ask about someone’s help with creating macro for finding the way from pointA to pointB & its distance.
Unfortunately I’m struggling already with that for some time with bad results.
I have attached pdf & excel file.
The excel file consist of a two “data” sheets & one sheet with the layout. The same layout is exported to the pdf for someone who prefers to see pdf instead of excel.
Layout is to just visualize connections of each segments & nodes.
In the excel “coordinate sheet” you will find the data that were used for drawing layout.
Each row there represents just one section with:
• starting point called “NODE_A” & its coordinates (X,Y)
• ending point called “NODE_B” & its coordinates (X,Y)
• the length from NODE_A to NODE_B
When you will join all sections (from above) together you will get the full layout.
The other sheet is called “length to update”.
Each row there consist of NODE_1 & NODE_2 and where I put the question mark it is just required length that I would like the macro to calculate.
The whole problem is that NODE_1 & NODE_2 are just starting & ending points, and in most cases consist of a few sections that sometimes meet junction points somewhere on the way between NODE_1 & NODE_2.
This is difficult for me, as even if I could find the way from NODE_1 to NODE_2 the length is badly calculated because its total include also the length of some “dead end” sections. I mean the sections starting on the junction point but do not leading to the NODE_2.The good news is that there is no any loops in the layout.
I was searching on binary tree algorithm but unfortunately in my case I suppose it is not the issue, as junction points could have more than just two exits (left, right).
Is anyone able to give me any clues or better yet the full vba code, so I could adjust later on to my purposes. Seems that I have already used up all mi ideas…
P.S.
I have raised the question of this problem also in other local forum, see the link below
https://4programmers.net/Forum/Inne/...z_jej_dlugosci
http://www.excelforum.pl/topics15/ma...ci-vt58979.htm
Bookmarks