home *** CD-ROM | disk | FTP | other *** search
/ Share Gallery 1 / share_gal_1.zip / share_gal_1 / GR / GR505.ZIP / LSP.EXE / SLINE.LSP < prev    next >
Text File  |  1987-07-12  |  2KB  |  42 lines

  1. (defun c:sline ()
  2.    ;
  3.    ; Mike Pillers, P.E.     July 12, 1987
  4.    ; Machine/ Mechanism Design Consultant
  5.    ; MJP Mechanical Engineering & CAD Service
  6.    ; San Jose, CA          (408) 280-7959
  7.    ;
  8.    ; This command will generate a typical "Cross-section" line
  9.    ; drawn as a phantom line, complete with arrow heads at
  10.    ; at both ends.
  11.    ;
  12.    ;                    AutoCAD version 2.5 is required.
  13.    ;
  14.   (setvar "cmdecho" 0)
  15.   (if (not asize) (setq asize 0.50))      ;initial default arrow size
  16.   (if (not PThk)  (setq PThk 0.030))      ;   "       "    Pline width
  17.                 
  18.   (defun GETR (val msg / tm)
  19.     (setq tm (getreal (strcat msg " <" (rtos val 2 4) ">: ")))
  20.     (cond ((= (type tm) 'REAL) (eval tm))
  21.           ((= tm nil) (eval val))
  22.           (t (princ "\007 *error* not a REAL") (eval val)) ) )
  23.  
  24.   (defun loop ()
  25.     (cond ((setq p2 (getpoint p1 " To point: ")) (command p2) 
  26.                                      (setq p0 p1) (setq p1 p2) (loop))
  27.           ( t (command "u" (polar p1 (angle p1 p0) asize)
  28.                        "w" (/ asize 3) 0.0 p1 ""))))
  29.  
  30.   (setq asize (getr asize " Arrow head size"))
  31.   (setq PThk  (getr PThk " Pline width"))
  32.   (setq p1 (getpoint " From point: "))
  33.   (command "pline" p1 "w" 0.0 0.0)
  34.   (setq p2 (getpoint p1 " To point: "))
  35.   (command "w" 0.0 (/ asize 3) (polar p1 (angle p1 p2) asize) 
  36.            "w" PThk PThk p2)
  37.   (setq p1 p2)
  38.   (loop)
  39.   (command "change" "l" "" "p" "lt" "phantom" "")
  40.   (eval "Done")
  41. )
  42.