TheSwamp
CAD Forums => CAD General => The Third Dimension => Topic started by: idrawwithcad on August 11, 2005, 08:25:16 PM

hi all
does anyone know an easy way to obtain a horizontal distance between two points in plan view if they have differing Z values?
ie i want to obtain the 'run' between the two points, not the hypoteneus
at the moment we are just drawing a line between the two points, setting the Z values to 0, and then doing a length on it, so there has to be a better way!
any help appreciated!
cheers

try the 'distance' comand.
Type in DI at command prompt, it will ask you for 2 points and it will print to the command line the DELTA values in each direction.
It's a very handy tool ;)

.... or a temporary linear dimension ....

Or something like this :
If one of the points to the VLISP function distance is 2D the return will be planar with the CURRENT construction plane.
(defun 2DDistance ( pt1 pt2)
(distance (list (car pt1)(cadr pt1)) pt2)
)
(defun c:test (/ pt1 pt2 2dd 3dd)
(setq pt1 (getpoint "\nSelect First Point ")
pt2 (getpoint pt1 "\nSelect Second Point ")
2dd (2DDistance pt1 pt2)
3dd (distance pt1 pt2)
)
(prompt (strcat (rtos 2dd 2 5) " : " (rtos 3dd 2 5)))
(princ)
)
Command: test
Select First Point 0,0,0
Select Second Point 200,300,400
360.55513 : 538.51648
kwb

try the 'distance' comand.
Type in DI at command prompt, it will ask you for 2 points and it will print to the command line the DELTA values in each direction.
It's a very handy tool ;)
thanks for the reply, we have tried this one, but it seems to give the distance between the two points with consideration to the Z value unfortunately

thanks for the other two replies, i will try those out very soon!
thanks guys

long way around! Draw a polyline from point to point, move the pline and check its length. plines (not 3dplines) can only be drawn in 2d, so you won't have that problem. But I'm sure Kerry's code will be a whole lot better.

Did what Keith said...worked fine.
Made an aligned dimension from Point A to Point B (two points with differing x, y and Z coordinates), obtained horizontal distance (i.e., in xy plane) between the points. Worked the same whether using point filters or not. Fast and trustworthy within the displayed accuracy of the dimension obtained.

Keith's dim trick is a fast efficient method for obtaining the "plan" distance, I use it all the time. If you desire the X and Y offsets, use point filters with the distance command.
Enter the distance command and when promted for the first point enter .Z and pick an open spot on the drawing (that'll get the Z=0 of the UCS) then osnap the first point desired. Do the same for the second point.

Welcome back CADaver .. and thanks for the tip .. I'll have to put that one in my repetoir(sp)