View Full Version : 2D distance between 3D points

Tyke

1st Nov 2010, 07:21 am

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.

eldon

1st Nov 2010, 09:34 am

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. :D

Tyke

1st Nov 2010, 10:14 am

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.

eldon

1st Nov 2010, 10:30 am

In fact, by doing a search, I found this thread (http://www.cadtutor.net/forum/showthread.php?42128-DistanceInquiry.lsp-(Dist-replacement)&p=283841&viewfull=1#post283841) which seems to be what you want :D

SEANT

1st Nov 2010, 10:41 am

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

http://www.cadtutor.net/forum/showthread.php?22977

ReMark

1st Nov 2010, 11:26 am

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

Tyke

1st Nov 2010, 12:46 pm

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. 8)

I believe the default value is osnapz = 0.

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

Thanks guys.

rkent

1st Nov 2010, 03:06 pm

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.

Rebel

1st Nov 2010, 03:57 pm

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"

rkent

1st Nov 2010, 04:03 pm

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.

dumfatnhappy

1st Nov 2010, 05:42 pm

I just pull a tape on the fly (using linear dimension) since it cannot see 3D if the ucs is set to plan/top/world

Powered by vBulletin™ Version 4.1.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.