View Full Version : Title bubble routine using slide library not working in AutoCAD 2007
esaffle
2007-03-09, 10:41 PM
Ok, since you guys fixed my problem so quickly last night, I now have another one for ya.
I am using a slide lib. to insert a title bubble into a detail drawing. When it goes through its lsp routine (2dtitle.lsp) it asks for information to insert into the title. All of that is fine, all of the information is entered. The problem occurs when you finalize the command and it shows the "scale" of the drawing listed at "full size". It is actually the full 3" tall text, which is not what it needs to be.
All other scales come out correctly. I hope I am explaining this correctly. I will include the lsp and the cui that we are using. Hopefully that will allow you to play with it and help me out.
The routine is listed under the "symbols" menu, then "drafting aids". I think loading the cui as a partial will give you full access to everything. That is, if I did it and understand it correctly. Thanks!! And have a great weekend.
Adesu
2007-03-10, 03:00 AM
Hi esaffle,
I'm not understand what are you doing,I only test your code,and test again
(defun c:2dti (/ b_detail b_sheet e i_pt len old_blipmode
pt_2 sc sc_al sc_length s_name s_num t1
t1_pt t2 t2_pt t3 tit_le tit_lenght tit_length)
(setvar "cmdecho" 0)
(setvar "menuctl" 0)
(setq old_blipmode (getvar "blipmode"))
(setvar "blipmode" 0)
(setq sc (getvar "dimscale")) ; get the drawing scale
(if
(or (= s_name nil) (= s_num nil))
(setq s_name "none")
);if
(if
(null (tblsearch "style" "au101s03"))
(command "_style" "au101s03" "arial narrow" (* sc 0.21875) "" "" "" "")
);if
(command "_textstyle" "au101s03")
;(command)
(setq t1 (* (* 0.5 0.125) sc))
(setq t2 (* (* 1.75 0.09375) sc))
(setq t3 (* (* 1.75 0.09375) sc))
(setq s_name "au101s03")
(setq i_pt (getpoint "\nselect start point: ")) ; the pline start point
(setq t1_pt (list (+ (car i_pt) (* 0.0625 sc)) (+ (cadr i_pt) t1)))
(setq t2_pt (list (+ (car i_pt) (* 0.0625 sc)) (- (cadr i_pt) t2)))
(setq tit_le (getstring t "\nenter the title: "))
(setq b_detail (getstring t "\ndetail: "))
(setq b_sheet (getstring t "\nsheet number: "))
(setq tit_lenght (strlen tit_le))
(cond
((= sc 1.0)(setq sc_al "scale: full size"));option 1
((= sc 2.0)(setq sc_al "scale: half size"));option 2
((= sc 4.0)(setq sc_al (strcat "scale: 3" (chr 34) "=1'-0" (chr 34))));option 3
((= sc 8.0)(setq sc_al (strcat "scale: 1 1/2" (chr 34) "=1'-0" (chr 34))));option 4
((= sc 12.0)(setq sc_al (strcat "scale: 1" (chr 34) "=1'-0" (chr 34))));option 5
((= sc 16.0)(setq sc_al (strcat "scale: 3/4" (chr 34) "=1'-0" (chr 34))));option 6
((= sc 24.0)(setq sc_al (strcat "scale: 1/2" (chr 34) "=1'-0" (chr 34))));option 7
((= sc 32.0)(setq sc_al (strcat "scale: 3/8" (chr 34) "=1'-0" (chr 34))));option 8
((= sc 48.0)(setq sc_al (strcat "scale: 1/4" (chr 34) "=1'-0" (chr 34))));option 9
((= sc 64.0)(setq sc_al (strcat "scale: 3/16" (chr 34) "=1'-0" (chr 34))));option 10
((= sc 96.0)(setq sc_al (strcat "scale: 1/8" (chr 34) "=1'-0" (chr 34))));option 11
((= sc 128.0)(setq sc_al (strcat "scale: 3/32" (chr 34) "=1'-0" (chr 34))));option 12
((= sc 192.0)(setq sc_al (strcat "scale: 1/16" (chr 34) "=1'-0" (chr 34))));option 13
((= sc 384.0)(setq sc_al (strcat "scale: 1/32" (chr 34) "=1'-0" (chr 34))));option 14
);cond
(setq sc_length (strlen sc_al))
(if
(> sc_length tit_length) ;((> tit_length sc_length)
(progn
(setq lay1 "text3")
(if
(not (tblsearch "layer" lay1))
(command "_layer" "m" lay1 "c" 1 "" "")
)
;(command "_layer" "s" "text3" "") it's not need
(command "_text" t1_pt 0 tit_le)
(setq e (entlast))
(setq e (textbox (entget e)))
(setq len (car (cadr e)))
) ; progn
) ; if
(if
(null (tblsearch "style" "bottom"))
(command "_style" "bottom" "simplex" (* sc 0.09375) "" "" "" "" "")
);if
(command "_textstyle" "bottom")
(setq lay2 "text2")
(if
(not (tblsearch "layer" lay2))
(command "_layer" "m" lay2 "c" 2 "" "")
)
;(command "_layer" "s" "text2" "") it's not need
(command "_text" t2_pt 0 sc_al)
(setq pt_2 (polar i_pt (* pi 2.0) (+ (* (* sc 0.0625) 2.0) len)))
(command "_pline" i_pt pt_2 "")
(command "_pedit" "l" "w" (* 0.03125 sc) "")
(setvar "attdia" 0)
(command "_insert" "2_det" i_pt (getvar "dimscale") "" "" b_detail b_sheet)
(setvar "blipmode" old_blipmode)
(princ)
);defun
vBulletin® v3.6.7, Copyright ©2000-2009, Jelsoft Enterprises Ltd.