# Thread: 2D distance between 3D points

1. ## 2D distance between 3D points

Registered forum members do not see this ad.

When working in 3D I can obtain the 3D (slope) distance between any 3D points.
The results are the slope distance, delta X, delta Y, delta Z, angle in X-Y plane and angle from X-Y plane. What's missing is the 2D distance between the two points.
I vaguely remember someone once telling me there is a way to get that 2D distance, but I can't seem to find a reference anywhere about it.

Is it possible to get the 2D distance between two 3D points? There is enough information there to calculate it.

2. i expect there is a clever lisp somewhere, but if you draw a line between the two points and then List it, the length in the current UCS (2D length) is given as well as the 3D Length, amongst other info.

3. Thanks Eldon.

I've just got round to working that one out myself, but you were quicker. But drawing a line, listing it and then deleting it is a bit over the top just to get the information displayed which is actually there, somewhere.

I have a VBA macro which does the calculation and displays the results in a message box, so I have no problem doing it. We work with a company who just have AutoCAD 2011 without VBA and my contact there has asked for my help with the problem.

4. In fact, by doing a search, I found this thread which seems to be what you want

5. Or, if AutoCAD LT compatibility is an issue, this thread has a Command Macro that removes the Z displacement from the calculation:

6. Interesting. When I did a LIST on a line drawn in 3D between two different elevations I got this:

LINE Layer: "0"
Space: Model space
Handle = 3aa
from point, X= 20.8057 Y= 17.9927 Z= 1.0000
to point, X= 20.8137 Y= 28.5582 Z= 3.0000
In Current UCS, Length = 10.5654, Angle in XY Plane = 90
3D Length = 10.7531, Angle from XY Plane = 11
Delta X = 0.0080, Delta Y = 10.5654, Delta Z = 2.0000

7. Okay, we have the solution

It's governed by a System Variable "OSNAPZ"

osnapz=0 --> 3D-Distances
osnapz=1 --> 2D-Distances

You can have the 2D distance OR the 3D distance, but not both.

I believe the default value is osnapz = 0.

But it works a treat and is exactly what was needed here.

Thanks guys.

8. You can use .xy filter on the second point.

Dist, osnap to endpoint, type .xy, osnap endpoint of other end, finally osnap to the first endpoint to use the same z value.

9. Isn't that what the very first dimension is from the distance command? eg:

Command: di
DIST
Specify first point:
Specify second point or [Multiple points]:
Distance = 16'-7 15/32", Angle in XY Plane = 32, Angle from XY Plane = 12
Delta X = 13'-9 9/32", Delta Y = 8'-7 15/16", Delta Z = 3'-4 3/4"

10. Registered forum members do not see this ad.

Originally Posted by Rebel
Isn't that what the very first dimension is from the distance command? eg:

Command: di
DIST
Specify first point:
Specify second point or [Multiple points]:
Distance = 16'-7 15/32", Angle in XY Plane = 32, Angle from XY Plane = 12
Delta X = 13'-9 9/32", Delta Y = 8'-7 15/16", Delta Z = 3'-4 3/4"
Only if OSNAPZ is set to 1, I keep it set to 0 so I use filters.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts