;;; balloon.lsp ;;; ;;; Copyright (C) 1997, Charles W. Robbins ;;; ;;; Charles Robbins provides this code for your use. Use the code ;;; to your benifit and at your own risk. Charles Robbins does not ;;; warrant that the code is error free in your application. (alert "balloon.lsp - Copyright (C) 1997, Charles W. Robbins. Type balloon to start") (defun c:balloon () ;;;setup (setq osm (getvar "osmode")) (setvar "osmode" 0) (setq unitssetting (getvar "lunits")) (setvar "lunits" 2) ;;;program (setq q "y") (setq textsize (getstring "\nWhat size text do you want ")) (while (= q "y") (setq sp (getpoint "\nPick the leader starting point")) (setq ep (getpoint "\nPick the center of the ballon")) (setq text (getstring "\nWhat is the item number ")) (setq txtsz (atof textsize)) (setq dia (* 2.0 txtsz)) (setq ang (angle sp ep)) (setq angdeg (* ang (/ 180.0 pi))) (setq deg1 (- angdeg 10.0)) (setq ds1 (rtos deg1)) (setq d1 (strcat "@" (rtos (* 0.125 (/ txtsz 0.125))) "<" ds1)) (setq deg2 (+ angdeg 10.0)) (setq ds2 (rtos deg2)) (setq d2 (strcat "@" (rtos (* 0.125 (/ txtsz 0.125))) "<" ds2)) (command "line" sp ep "") (command "line" sp d1 "") (setq pt1 (cdr (assoc 11 (entget (ssname (ssget "L") 0))))) (command "line" sp d2 "") (setq pt2 (cdr (assoc 11 (entget (ssname (ssget "L") 0))))) (command "solid" sp pt1 pt2 pt2 "") (command "circle" ep "d" dia) (command "trim" "l" "" ep "") (command "text" "m" ep textsize "0" text) (initget 1 "y n") (setq q1 (getkword "\nDo you another item on this bubble?[y or n] ")) (while (= q1 "y") (setq npt (list (+ (car ep) dia)(cadr ep))) (if (> ang 1.5708) (if (< ang 4.7124) (setq npt (list (- (car ep) dia)(cadr ep))) ) ) (setq text1 (getstring "\nWhat is the item number ")) (command "circle" npt "d" dia) (command "text" "m" npt textsize "0" text1) (setq ep npt) (setq q1 (getstring "\nDo you another item on this bubble?[y or n] ")) ) (initget 1 "y n") (setq q (getkword "\nDo you want another ballon?[y or n] ")) ) (setvar "osmode" osm) (setvar "lunits" unitssetting) )