home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 8 / CDASC08.ISO / VRAC / CAD08N06.ZIP / BALLOON.LSP < prev    next >
Lisp/Scheme  |  1993-04-28  |  1KB  |  23 lines

  1. ; BALLOON.LSP  A program to place text centered in a circle at the end
  2. ; of a leader.  A useful customization would be to have the function
  3. ; switch to a specific layer.
  4. ; Invoke the function after it is loaded by entering BLN at any
  5. ; Autocad prompt.
  6. ; The text height is the same as the current dimension text height - DIMTXT
  7. ; The diameter of the circle is 3/8 multiplied by DIMSCALE
  8. ; The current text style must not have a set height
  9.  
  10. (defun C:BLN ( / Scale Radius Po Pe Pm Txt)
  11.   (setvar "CMDECHO" 0)
  12.   (setq Scale (getvar "DIMSCALE")
  13.         Radius (* 0.15625 Scale)                  ; radius of the bubble
  14.         Po (getpoint "\nStart of Leader: ")
  15.         Pe (getpoint Po "\nEnd of Leader: ")
  16.         Pm (polar Pe (angle Po Pe) Radius))      ; center of bubble and text
  17.   (command "dim1" "leader" Po Pe ^C^C)
  18.   (command "circle" Pm Radius)
  19.   (Setq Txt (getstring "\nEnter Part Number: "))
  20.   (command "text" "M" Pm (* Scale (getvar "DIMTXT")) 0 Txt)
  21.   (princ)
  22. ) ; end BLN
  23.