Text angle

Discussion in 'AutoCAD' started by TCEBob, Feb 29, 2004.

  1. TCEBob

    TCEBob Guest

    Please, what variable is text angle?

    rs
     
    TCEBob, Feb 29, 2004
    #1
  2. You mean dxf code? 50
     
    Jason Piercey, Mar 1, 2004
    #2
  3. TCEBob

    TCEBob Guest

    Um, no. Figured that out. Then there is no variable? How does dtext etc.
    know what angle to use the next time? More particularly, how can I save
    the present angle, write text at a new angle and then restore the
    original? Wait -- I know one way: write a single empty string. Get it as
    entlast and find assoc 50. Erase the freak string. Any saner suggestion?

    rs
     
    TCEBob, Mar 1, 2004
    #3
  4. TCEBob

    R.K. McSwain Guest

    1) Save the DXF code 50 from the current text style
    2) Set it to something else
    3) Write your text
    4) Restore DXF 50

    ....or use (entmake) or (vla-AddText) to write the text as you desire, and not worry about what the current style is set to.
     
    R.K. McSwain, Mar 1, 2004
    #4
  5. TCEBob

    TCEBob Guest

    Upon looking it up, dxf 50 is the Oblique angle in the style table,
    whereas it is the Rotation angle in text objects. (and 51 is the
    Oblique.) So the question is still open: How can one find the current
    (most recent) text rotation angle? How does Dtext know?

    vla-addtext sounds good but "help" is quiet on it. VLIDE looks it up and
    finds it but the description there is for Basic, not Lisp. Probably the
    same variables. But the subroutine does not seem to specify the
    insertion angle.

    rs


    1) Save the DXF code 50 from the current text style
    2) Set it to something else
    3) Write your text
    4) Restore DXF 50

    ....or use (entmake) or (vla-AddText) to write the text as you desire,
    and not worry about what the current style is set to.
     
    TCEBob, Mar 1, 2004
    #5
  6. TCEBob

    x-lisper Guest

    How can one find the current
    (defun get-last-rotationangle (/ ss)
    (if (setq ss (ssget "_x" '((0 . "TEXT"))))
    (* (/ (cdr (assoc 50 (entget (ssname ss 0)))) pi) 180.0)))

    not fully tested.
     
    x-lisper, Mar 1, 2004
    #6
  7. TCEBob

    R.K. McSwain Guest

    Sorry, I thought "text angle" meant "obliquing angle" instead of "text string rotation angle"
    It's all documented, except that the examples are in basic.
    Take a look at http://www.afralisp.com/vl/pm1.htm for an example in lisp.
     
    R.K. McSwain, Mar 1, 2004
    #7
  8. TCEBob

    TCEBob Guest

    But of course. Thanks for the reminder about ssget. I would have thought
    that the desired member of ss would be the most recent, rather than the
    first (ssname ss 0). In any case I will give it a twirl.

    It doesn't really say that ssget will return objects in the order of
    creation but it seems like a good assumption.

    rs
     
    TCEBob, Mar 1, 2004
    #8
  9. TCEBob

    TCEBob Guest

    Afralisp is already on my favorites list; I should be quicker to look
    there when I have a question. Thanks for your suggestions, I an better
    informed now.

    rs

    Sorry, I thought "text angle" meant "obliquing angle" instead of "text
    string rotation angle"
    It's all documented, except that the examples are in basic.
    Take a look at http://www.afralisp.com/vl/pm1.htm for an example in
    lisp.
     
    TCEBob, Mar 1, 2004
    #9
  10. TCEBob

    x-lisper Guest

    It doesn't really say that ssget will return objects in the order of
    other way

    (defun get-activespace (/ dwg)
    (setq dwg (vla-get-activedocument (vlax-get-acad-object)))
    (if (eq (vla-get-activeSpace dwg) acmodelspace)
    (vla-get-modelspace dwg)
    (if (eq (vla-get-mspace dwg) :vlax-true)
    (vla-get-modelspace dwg)
    (vla-get-paperSpace dwg))))

    (defun get-lastobject (/ obj)
    (not (vl-catch-all-error-p
    (setq obj
    (vl-catch-all-apply
    'vla-item
    (list (get-activespace)
    (1- (vla-get-count (get-activespace))))))))
    obj)

    (defun get-last-textangle (/ obj)
    (if (and (setq obj (get-lastobject))
    (eq (vla-get-objectname obj) "AcDbText"))
    (vla-get-rotation obj)
    0.0))
     
    x-lisper, Mar 1, 2004
    #10
  11. TCEBob

    TCEBob Guest

    Thing of beauty. I will get personal with it later.

    rs
     
    TCEBob, Mar 1, 2004
    #11
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.