Variable that extracts text height?

Discussion in 'AutoCAD' started by calpolyarc, Sep 15, 2004.

  1. calpolyarc

    calpolyarc Guest

    Is there a variable that I could include in a lisp routine that would extract the height value of text when the text is selected?? Thanks.
     
    calpolyarc, Sep 15, 2004
    #1
  2. calpolyarc

    T.Willey Guest

    I think it's the dxf code 40.

    Tim
     
    T.Willey, Sep 15, 2004
    #2
  3. calpolyarc

    Rudy Tovar Guest

    Dxf value of 40

    (setq e (entsel "\nSelect Text: "))

    (setq d (entget (car e))
    h (cdr (assoc 40 d));<<in inches;
    )

    No error checking provided or filters.

    --
    MASi
    Copyright 2004 by Cadentity
    www.Cadentity.com

    extract the height value of text when the text is selected?? Thanks.
     
    Rudy Tovar, Sep 15, 2004
    #3
  4. calpolyarc

    calpolyarc Guest

    Awesome! So how can I make that work in this lisp:

    (defun C:tcd ()
    (setq texob (entsel "\nSelect Text: "))
    (setq texht (entget (car texob)) h (cdr (assoc 40 texht))
    )
    (setq copht (* (texht)(-5/4)))
    (command "copy" entsel "" 0,0 0,copht "")
    (princ)
    )

    All I want is to be able to do is select a line of text, and have it copy itself to a point 1.25 times the height of the text in the negative Y direction. My lisp above probably looks really stupid to you gurus, but I'm learning as I go here! Thanks!
     
    calpolyarc, Sep 15, 2004
    #4
  5. calpolyarc

    T.Willey Guest

    Here you go.

    Tim
    ps. watch for word wrap

    (defun C:tcd (/); texob texht h copht)
    (setq texob (entsel "\nSelect Text: "))
    (setq texht (entget (car texob)) h (cdr (assoc 40 texht))
    )
    (setq copht (* h -1.25)) ;<- changed this line
    (command "_.copy" (cdr (assoc -1 texht)) "" "0,0,0" (strcat "0," (rtos copht 2 22))) ;<- changed this line
    (princ)
    )
     
    T.Willey, Sep 15, 2004
    #5
  6. calpolyarc

    T.Willey Guest

    Oooopss... pasted to fast. This line should change so that your variables are localized within your lisp

    (defun C:tcd (/); texob texht h copht)
    to
    (defun C:tcd (/ texob texht h copht)

    Had it the first way for testing. Sorry

    Tim
     
    T.Willey, Sep 15, 2004
    #6
  7. calpolyarc

    Paul Turvill Guest

    Your syntax needs a bit of work ... try this:

    (defun C:tcd ( / texob txht copht)
    (setq texob (entsel "\nSelect Text: ")
    texht (cdr (assoc 40 (entget (car texob))))
    copht (* texht (/ 5.0 4.0))
    )
    (command "copy" texob "" "0,0" (list 0 (- copht)))
    (princ)
    )
    ___


    itself to a point 1.25 times the height of the text in the negative Y
    direction. My lisp above probably looks really stupid to you gurus, but I'm
    learning as I go here! Thanks!
     
    Paul Turvill, Sep 15, 2004
    #7
  8. calpolyarc

    calpolyarc Guest

    Thanks Tim and Paul, your help is appreciated!!!
     
    calpolyarc, Sep 16, 2004
    #8
  9. ;<<in inches; ?

    drawing units!
     
    Marc'Antonio Alessi, Sep 16, 2004
    #9
  10. calpolyarc

    Rudy Tovar Guest

    Depends on discipline of coarse.

    I was speaking in architectural terms...

    But if you want to get technical....well....

    In all things we tend (individualize) in terms some may relate. It's true, I
    assumed that he may have been in architecture, clueless, and went by this
    name "Calpolyarc" well known for their alumni....
     
    Rudy Tovar, Sep 16, 2004
    #10
  11. Depends on of coarse.

    Not only.

    Here, across the pond, we have decimal units
    for both technical or architectural...

    We do not use in inches for any discipline...

    ;)

    Cheers
     
    Marc'Antonio Alessi, Sep 16, 2004
    #11
  12. calpolyarc

    Rudy Tovar Guest

    So you want to get technical...

    So I placed it in a context that I thought he could understand.

    I knew it was units, but I'll just leave it like that.
     
    Rudy Tovar, Sep 17, 2004
    #12
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.