Make Text justification changes

Discussion in 'AutoCAD' started by RaghuMN, May 27, 2004.

  1. RaghuMN

    RaghuMN Guest

    Hi all,

    I have a text with default (bottom left) justification.
    How can I change it's justification to Bottom Center (or any other justification) -
    (a) without deleting the text and recreating
    (b) without changing the location of text / shifting the text position

    I have tried of this type, but did not work. i.e., they did not do any changes-
    (entmod (subst (cons 10 (list 10 15))(assoc 10 (entget ent_nam))(entget ent_nam)))
    (entmod (subst (cons 72 1)(assoc 72 (entget ent_nam))(entget ent_nam)))
    (entmod (subst (cons 73 1)(assoc 73 (entget ent_nam))(entget ent_nam)))

    Any suggestions?

    Also, 1 or 2 examples for creating a justified (bottom center or any other except default) TEXT using entmake or activex methods?

    Thanks,

    MNRaghu
     
    RaghuMN, May 27, 2004
    #1
  2. I would guess that entmod-ing to change association-list values would be
    like changing them in the Properties dialog box. You can change the
    justification, but if the origin point is not also changed, then the new
    justification will be generated from that same point, and therefore the text
    will move. You'd probably have to find some way to extract the actual
    extents of the piece of text, and calculate the appropriate location of the
    origin point for the justification you want, and then change both the
    justification and the origin-point values.

    I think there used to be an add-on text modification thing that did what
    you're looking for, that is, if you changed the justification, it left the
    text where it was and moved the origin point. I want to say it was CHTEXT,
    but I still keep that around, and I tried it, and it doesn't work that way.
    Maybe it did in an earlier version, and they've since "fixed" it.

    Kent Cooper, AIA


    ...
    .....
     
    Kent Cooper, AIA, May 27, 2004
    #2
  3. RaghuMN

    Doug Broad Guest

    Suggestions:
    1) For mtext, the properties command can change the justification
    without moving the block of text. For text, justification changes
    shift the text.
    2) Use entget once. Save the result. Then build all the changes
    *before* using entmod.
    3) To code a justification without a change in location, you will need
    to calculate the text extents and change the 10 and 11 codes as
    necessary to keep the text from moving. It is a *good* thing
    however when text moves at the justification change, because
    each different line of text can be "aligned" to the justification.
    4) Many justifications use the 11 code rather than the 10 code
    for the text insert location. A few use both 10 and 11. Only
    the default justification uses 10.

    Hope that helps.
     
    Doug Broad, May 27, 2004
    #3
  4. (command "justifytext" (entget ent_nam) "" "BC")
     
    Alan Henderson @ A'cad Solutions, May 27, 2004
    #4
  5. RaghuMN

    Doug Broad Guest

    Nice one Alan. Wasn't familiar with that command.
     
    Doug Broad, May 27, 2004
    #5
  6. Yes, a nice (new) thing to know about. It's in A2K4, but not A2K (don't
    know about in between).

    Kent Cooper, AIA
     
    Kent Cooper, AIA, May 27, 2004
    #6
  7. RaghuMN

    ECCAD Guest

    Works in R2002 - neat.
    Bob
     
    ECCAD, May 27, 2004
    #7
  8. RaghuMN

    RaghuMN Guest

    Kent, I have seen the CHTEXT lisp with the version that I have, but this seemed a little confusing, and needs some manual intervention in getting the target point.
    In entmod'ing the text, what I got confused was, whether to change the 10's value or not, since this will be dependent on 11's value. I will make a try again :)

    Bob, your program was good for attributes Texts and gave an idea about applying the same to the TEXTs. This uses 74's values, whereas 73's values must be used for TEXTs. I have done the same, but something has gone wrong in my code. Let me check my codes again.:)

    Doug, your suggestions are good and descriptive. I will give this a try on this again to get informed.

    Alan, this I never knew this command. A nice one, and makes coding efforts much easier.

    Thank you all,
    MNRaghu
     
    RaghuMN, May 28, 2004
    #8
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.