home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 8 / CDASC08.ISO / VRAC / SEP93CAD.ZIP / TIP896.LSP < prev    next >
Lisp/Scheme  |  1993-08-31  |  1KB  |  33 lines

  1. ;TIP896:  ISO.LSP   Draw an Isometric Box   (C)1993, Tom Johnson
  2.  
  3. (defun c:ISO () 
  4.    (graphscr)
  5.    (setvar "osmode" 0)
  6.    ( defun dtr (d) (/ (* d pi) 180.0))
  7.    (setq pt1 (getpoint "\nWhere do you want to start your iso box: "))
  8.    (setq a  (dtr 30))  ;These are the set angles of the isometric box.
  9.    (setq b  (dtr 150))
  10.    (setq c  (dtr 210))
  11.    (setq d  (dtr 330))
  12.    (setq e  (dtr -90))
  13.    (setq m (getdist "\nHow deep is the box: ")) ;These are your sizes
  14.    (setq n (getdist "\nHow wide is the box: ")) ;of you box.
  15.    (setq p (getdist "\nHow high is the box: "))
  16.    (setq o m) ;This is so you don't have to repeat you distances.
  17.    (setq r p)
  18.    (setq pt2 (polar pt1 a m)) ;This is for your angle conversion.
  19.    (setq pt3 (polar pt2 b n))
  20.    (setq pt4 (polar pt3 c o))
  21.    (setq pt5 (polar pt1 e r))
  22.    (setq pt6 (polar pt4 e r))
  23.    (setq pt7 (polar pt2 e r))
  24.    (command "line" pt1 pt2 pt3 pt4 "c"  "") ;This draws you lines.
  25.    (command "line" pt1 pt5 "")
  26.    (command "line" pt4 pt6 "")
  27.    (command "line" pt2 pt7 "")
  28.    (command "line" pt6 pt5 "")
  29.    (command "line" pt5 pt7 "")
  30.    (princ)
  31. ); end iso_box.lsp
  32.  
  33.