Point to Surface - Perpendicular Distance Calculation

Hello Team Dynamo,

I’m trying to determine the distance between a point and a surface using Dynamo. I have a sloped vertical surface with points in front of it. As I mentioned, the distance needs to be perpendicular to the surface, measuring the length in that direction.

There are many other solutions that involve finding the nearest point, but that’s not my goal. I have already calculated the distance for 4 points using an old-school method, where I create cross-sections perpendicular to the surface. In these cross-sections, I can see the surface and the point, and then I simply measure the distance there.

It works very well, but this solution is precise but not optimal. For example, if I have 100 points, I would need to create 100 cross-sections and measure the horizontal distance between the point and the surface in each cross-section.

I’m uploading the file here.
Here are the 4 points that I have already measured using my old-school method for reference
all of them are negativ cause they are behind the wall.
13 = -0.022427
99 = -0.006884
18 = -0.005080
19 = -0.013151
Here are some pictures for illustration:


DGM_TT.dwg (1.0 MB)

A kind colleague has tried to assist me by looking for the nearest point. Unfortunately, that is not what I am looking for or trying to achieve. If I were to project a point onto this surface, it would have the same elevation as the original point and be perpendicular to the surface.
I will be grateful for any information.

And here is the solution provided by my colleague, but as I mentioned, it’s more about being perpendicular and in his solution it is not but i will put it here maybe someone can edit it.
testlevel.dyn (37.6 KB)

Hi, here is solution for both methods (nearest point, cross section).
For point number 13 the distance is same. It depence only on cross section direction. Here I determined the cross section direction by added alignment. Cross section direction is determined perpendiculary from point to alignment. Cross section is represented only by point and normal vector in Dynamo graph. This example is for one selected point only.



image

1 Like

Thank you very much @Drbohlav for your support.
That is very helpful.

1 Like

@Drbohlav
Would it be possible to select multiple points here instead of just one point by bringing up the list? Thanks in advance.

Civil3DToolkit package

Yes @Drbohlav , I have done that, but unfortunately, the list is empty at the end.

I can see first mistake here. Good luck.
image

1 Like

There are other features to learn if you want to use graph to more than one object.
For example here are more information about list levels and lacing in this links:

3 Likes