# TheSwamp

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

Title: measuring a distance in 3d
Post 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
Title: measuring a distance in 3d
Post by: MickD on August 11, 2005, 08:41:08 PM
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 ;)
Title: measuring a distance in 3d
Post by: Keith™ on August 11, 2005, 08:47:29 PM
.... or a temporary linear dimension ....
Title: measuring a distance in 3d
Post by: Kerry on August 11, 2005, 08:51:37 PM
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.

Code: [Select]
`(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
Title: measuring a distance in 3d
Post by: idrawwithcad on August 11, 2005, 09:52:01 PM
Quote from: MickD
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
Title: measuring a distance in 3d
Post by: idrawwithcad on August 11, 2005, 09:53:09 PM
thanks for the other two replies, i will try those out very soon!

thanks guys
Title: measuring a distance in 3d
Post by: daron on August 12, 2005, 08:08:02 AM
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.
Title: measuring a distance in 3d