Return to index: [Subject] [Thread] [Date] [Author]

RE: AUTOCAD: Getting The Text Size Right

[Subject Prev][Subject Next][Thread Prev][Thread Next]
Bill, et. al.,

I have the LISP routine, SetScale.LSP (SS) in ACAD.LSP to adjust the
height of text to the scale of the drawing.

Because I invariably use details of different scales on the same sheet, I
will draw the details at full size and then XREF them onto a 24 X 36 (or
whatever size) sheet.  The XREF's are scaled at 12/scale, e.g., if the
final drawing is to be 1/8" scale, the XREFs are scaled at 12/(1/8), or 96.
(I haven't automated that yet, but have a cheatsheet tacked next to my
monitor.)  The following routine for text height on the detail drawing will
create text 3/16" high (1/8" high for weld size heights) on the final
drawing.  (IMO, 3/16" size text on a drawing is the smallest that can be
reasonably read on a microfiche viewer.)

;-------------------------
;SETSCALE.LSP
(defun c:ss (/ ds)
        (setvar "CMDECHO" 0)
        (setq ds (getvar "DIMSCALE"))
        (setscale)
        (setvar "CMDECHO" 1)
        (princ)
)
(defun setscale  (/ ans scal sf txtht)
        (initget "Yes No")
        (if (= ds nil)
                (setq ds (getvar "DIMSCALE"))
        )
        (princ "\007DIMSCALE is set to " )
        (princ ds) (terpri)
        (setq ans (getkword "Do you want to change the scale? <Y>: "))
        (if (= ans nil)
                (setq ans "Yes")
        )            ; ENDIF ans nil
        (if (= ans "Yes")
                (progn
                        (setq scal (getstring "Enter scale (e.g. Enter 1/4
for 1/4 in/ft): "))                         (cond
                                ((= scal "1/16")
                                        (setq sf (/ 1.0 16.0)))
                                ((= scal "3/32")
                                        (setq sf (/ 3.0 32.0)))
                                ((= scal "1/8")
                                        (setq sf (/ 1.0 8.0)))
                                ((= scal "3/16")
                                        (setq sf (/ 3.0 16.0)))
                                ((= scal "1/4")
                                        (setq sf (/ 1.0 4.0)))
                                ((= scal "3/8")
                                        (setq sf (/ 3.0 8.0)))
                                ((= scal "1/2")
                                        (setq sf (/ 1.0 2.0)))
                                ((= scal "3/4")
                                        (setq sf (/ 3.0 4.0)))
                                ((= scal "1")
                                        (setq sf 1.0))
                                ((= scal "1-1/2")
                                        (setq sf (/ 3.0 2.0)))
                                ((= scal "3")
                                        (setq sf 3.0))
                                (t nil)
                        )              ;COND
                        (setq ds (/ 12.0 sf))
                        (setvar "DIMSCALE" ds)
                        (setvar "DIMCEN" (/ ds 16))
                        (setq txtht (* ds (/ 3.0 16.0)))
                        (command "STYLE" "WELD" "SIMPCLPL" (/ (* 5.0 txtht)
6.0)                                 "0.67" "" "" "" "")
                        (command "STYLE" "STD" "SIMPCLPL" txtht "0.67" "" ""
"" "")                 )                 ;PROGN scal
        )                    ;ENDIF ans
        (setq ans nil)
        (princ)
)
;-----------------------

******* ****** ******* ******** ******* ******* ******* ***
*   Read list FAQ at: http://www.seaint.org/list_FAQ.asp
*
*   This email was sent to you via Structural Engineers
*   Association of Southern California (SEAOSC) server. To
*   subscribe (no fee) or UnSubscribe, please go to:
*
*   http://www.seaint.org/sealist1.asp
*
*   Questions to seaint-ad(--nospam--at)seaint.org. Remember, any email you
*   send to the list is public domain and may be re-posted
*   without your permission. Make sure you visit our web
*   site at: http://www.seaint.org
******* ****** ****** ****** ******* ****** ****** ********