home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1993 #2 / Image.iso / cad / jul93.zip / TIP884.LSP < prev    next >
Lisp/Scheme  |  1993-06-21  |  1KB  |  31 lines

  1. ; TIP884:  DIS.LSP (C)1993, Bill Bratt
  2. ; Perpendicular Distance
  3.  
  4. ; This is similar to the distance command but sets the osnap to 
  5. ; NEAR for the first pick and PERP for the second pick.
  6. ; This can be used where you need accurate perpendicular distances.
  7. ;****************************************************************
  8. (defun C:DIS ()
  9.      (graphscr)
  10.      (setq SAVE_CMDE (getvar "cmdecho"))
  11.      (setq SAVE_ORTHO (getvar "orthomode"))
  12.      (setq SAVE_OSMODE (getvar "osmode"))
  13.      (setvar "cmdecho" 0)
  14.      (setvar "orthomode" 0)             ;Ortho off
  15.      (setvar "osmode" 512 ) 
  16.      (prompt "\nOSNAP is set at NEAREST")
  17.      (setq FIRST_PNT (getpoint 
  18.      "\nPick your first point to get a distance from: \n\n"))
  19.      (setvar "osmode" 128 ) 
  20.      (prompt "\nOSNAP is set at PERPENDICULAR")
  21.      (setq SECOND_PNT (getpoint 
  22.      "\nPick a point to get a distance from the FIRST POINT: \n\n" FIRST_PNT))
  23.      (setq DIST_1 (distance  FIRST_PNT SECOND_PNT))
  24.      (prompt "\nThe distance from the first point is: ") 
  25.      (prompt (rtos DIST_1 4 6))
  26.      (setvar "cmdecho" SAVE_CMDE )
  27.      (setvar "orthomode" SAVE_ORTHO )
  28.      (setvar "osmode" SAVE_OSMODE )
  29.      (princ)
  30. ); end dis.lsp
  31.