home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 15 / CD_ASCQ_15_070894.iso / vrac / may94cad.zip / TIP979.LSP < prev    next >
Text File  |  1994-04-25  |  1KB  |  45 lines

  1. ; TIP979.LSP: BISECT.LSP   Bisect Two Lines   (c)1994, C.D. Iddings
  2.  
  3. (defun C:BISECT()
  4. (setvar "cmdecho" 0)
  5. (setvar "osmode" 512)
  6.  
  7. (defun *error* (msg)
  8. (princ "error : ")
  9. (princ msg)
  10. (terpri)
  11. )
  12.  
  13. (prompt "\nSelect lines of ANGLE TO BISECT in CCW order about Intercection")
  14. (setq   LN (entsel
  15.                 "\nSelect First Line: ")
  16.         PA (cadr LN)
  17.         ED (entget (car LN))
  18.         P1 (cdr (assoc 10 ED))
  19.         P2 (cdr (assoc 11 ED))
  20.         LN (entsel
  21.                 "\nSelect Second Line: ")
  22.         PB (cadr LN)
  23.         ED (entget (car LN))
  24.         P3 (cdr (assoc 10 ED))
  25.         P4 (cdr (assoc 11 ED))
  26.         P5 (inters P1 P2 P3 P4 nil))
  27.   (if (> (distance P5 P1)(distance P5 P2))
  28.                             (setq W1 (angle P5 P1))(setq W1 (angle P5 P2)))
  29.   (if (> (distance P5 P3)(distance P5 P4))
  30.                             (setq W2 (angle P5 P3))(setq W2 (angle P5 P4)))
  31.    (setq WW (/ (+ W1 W2) 2))
  32.      (if (< WW W1)(setq WW (+ WW pi)))
  33.    (setq
  34.         L1 (distance P1 P5)
  35.         L2 (distance P2 P5)
  36.         L3 (distance P3 P5)
  37.         L4 (distance P4 P5)
  38.         L5 (max L1 L2 L3 L4)
  39.         P6 (polar P5 WW L5))
  40. (command "line" P6 P5 "")
  41. (prin1)
  42. (setvar "osmode" 0)
  43. )
  44. 
  45.