Author Topic: measuring a distance in 3d  (Read 4089 times)

0 Members and 1 Guest are viewing this topic.

idrawwithcad

  • Guest
measuring a distance in 3d
« 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

MickD

  • Gator
  • Posts: 3314
  • (x-in)->[process]->(y-out)
measuring a distance in 3d
« Reply #1 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 ;)
Forth is like the Tao: it is a Way, and is realized when followed.
Its fragility is its strength; its simplicity is its direction - Michael Ham

Lao Tzu: “To attain knowledge, add things
every day; to obtain wisdom, remove things every day.”

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16727
  • Superior Stupidity at its best
measuring a distance in 3d
« Reply #2 on: August 11, 2005, 08:47:29 PM »
.... or a temporary linear dimension ....
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
measuring a distance in 3d
« Reply #3 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
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

--> Donate to theSwamp<--

idrawwithcad

  • Guest
measuring a distance in 3d
« Reply #4 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

idrawwithcad

  • Guest
measuring a distance in 3d
« Reply #5 on: August 11, 2005, 09:53:09 PM »
thanks for the other two replies, i will try those out very soon!

thanks guys

daron

  • Guest
measuring a distance in 3d
« Reply #6 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.

cad-waulader

  • Guest
measuring a distance in 3d
« Reply #7 on: August 12, 2005, 12:14:40 PM »
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.

CADaver

  • Guest
measuring a distance in 3d
« Reply #8 on: August 13, 2005, 06:21:17 PM »
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.

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16727
  • Superior Stupidity at its best
measuring a distance in 3d
« Reply #9 on: August 14, 2005, 12:39:45 AM »
Welcome back CADaver .. and thanks for the tip .. I'll have to put that one in my repetoir(sp)
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal