It seems so simple

Discussion in 'AutoCAD' started by E.L. Stewart, May 24, 2004.

  1. E.L. Stewart

    E.L. Stewart Guest

    yet I cannot get it to work!

    Dim NewTxt As AcadText
    Dim TxtIPT As Variant
    TxtIPT = ThisDrawing.Utility.GetPoint(, "Insertion
    Set NewTxt = ThisDrawing.ModelSpace.AddText(QEID,
    TxtIPT, 3.75)
    NewTxt.StyleName = "Notes"
    NewTxt.Alignment = acAlignmentMiddle

    I want my text to have middle justification. Everything else works as
    expected. If I leave the last line the text does not even get created. If
    I comment out the last line, everything else works.

    Any ideas. It seems too easy.

    Heterosexual does NOT mean homophobic
    White does NOT mean racist
    Male does NOT mean sexist

    To reply directly to me use DEODORANT
    E.L. Stewart, May 24, 2004
  2. E.L. Stewart

    Jeff Mishler Guest

    When you give a text entity an alignment other than acAlignmentLeft you must
    provide the TextAlignmentPoint property as well. Just add this to the end
    of what you posted:

    NewText.TextAlignmentPoint = TxtPIT

    Jeff Mishler, May 24, 2004
  3. E.L. Stewart

    LochDhu Guest

    The Text is probably sitting at the origin (0,0,0) - because if you use something other than acAlignmentLeft, AutoCAD uses either a combination of the Insert Point and the TextAlignment Point, or just the TextAlignment Point. For acAlignmentMiddle you need to set an textalignment point - check the Help for further assistance.

    LochDhu, May 24, 2004
  4. E.L. Stewart

    E.L. Stewart Guest

    I knew it would be simple.


    E.L. Stewart, May 24, 2004
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.