Good Day everyone,
I found this LISP online that's almost exactly what I need, however I need some improvements before I can use it. A list below of what I intended to do:
1. Change the text to color blue and assigned it on separate layer.
2. Prompt of balloon diameter size
3. Make the balloon runs sequentially until I hit Escape (meaning I click only without running the command again)
Can someone tell me what to do to achieve this? Thanks in advance.
Credits to all the people who created this LISP.
;ANY QUESTIONS or REQUESTS: paulmcz@yahoo.com
;
;*************************************************************************
; Size of balloon depends on dimscale setting *
; Looks best with 3 digits for part and sheet numbers *
; If part number starts with number, next increment is 1+ that number *
; If you want to increment any number, start with that number *
; You can overwrite the numbers any time on prompt *
; Typed in part number overwrite defaults *
;*************************************************************************
(defun incr ()
(progn (setq inn2 (atoi inn))
(setq inn3 (1+ inn2))
(setq inn (itoa inn3))
)
(setq sl (strlen inn))
(cond
((= sl 1) (setq inn (strcat "" inn)))
((= sl 2) (setq inn (strcat "" inn)))
(T nil)
)
)
(defun c:bn (/ in)
(setq cmd (getvar "cmdecho")
osm (getvar "osmode")
)
(setvar "cmdecho" 0)
(setq cc (getpoint "\\n Center point of balloon: "))
(if inn
()
(setq inn "1")
)
(incr)
;enter to accept or enter a numeric value
(princ "\\n Start Number < ")
(princ inn)
(princ " >? :")
(setq in (getstring))
(if (= in "")
(setq in inn)
)
(setq ds (getvar "dimscale"))
(setq th (getvar "dimtxt"))
(setq cd (* th 4.0))
(setq dia (* cd ds))
(setq txt (* th ds))
(setq rad (/ dia 2))
(setq ptl1 (list (- (car cc) rad) ))
(setq ptl2 (list (+ (car cc) rad) (cadr cc)))
(setq ptt1 (list (car cc) (+ (cadr cc) (* 0.8 txt))))
(setq ptt2 (list (car cc) (- (cadr cc) (* 0.8 txt))))
(setvar "osmode" 0)
(command "circle" cc rad)
;(command ".line" ptl1 ptl2 "")
;(command ".text" "m" ptt1 (* txt 0.8) 0 in)
; adjust text height part #
(entmake (list (cons 0 "TEXT")
(cons 10 cc)
(cons 11 cc)
(cons 1 in) ; actual text
(cons 7 (getvar "TEXTSTYLE"))
(cons 40 txt)
(cons 72 4)
)
)
(setvar "cmdecho" cmd)
(setvar "osmode" osm)
(princ)
)
(prompt "\\nType < bn > to start Balloon with counter")
; Original version by Mr Randy
; This version by Rick Stanich