how to know the coordinates of a certain alphabet$B!!(Bin a word

Discussion in 'AutoCAD' started by youngman, May 18, 2004.

  1. youngman

    youngman Guest

    hi

    i have a column of words that share a certain alphabet,

    how to determine the coordinates of a certain alphabet so that i can

    Arrange the words in a line made by the alphabet

    thank you

    regards
     
    youngman, May 18, 2004
    #1
  2. I'm assuming you mean they share a single letter. I would probably use
    bounding boxes to break the words at the letter that is shared, and adjust
    the horizontal text positions based on these widths. For example:

    -- "shape" and "cactus" share "a".
    -- Use GetBoundingBox() to get widths of "shape" and "cactus" text
    objects.
    -- Change SHAPE's textstring to APE and store the original word in a
    variable.
    -- Change CACTUS's textstring to ACTUS and store the original word in a
    variable.
    -- Use GetBoundingBox() to get widths of APE and ACTUS text objects.
    -- Change the words back to their original values.
    -- The new Y-coord for the CACTUS text should be found by the following
    formula:
    (Y-coord of insert point of SHAPE) + (width of SHAPE) - (width of APE) +
    (width of CACTUS) - (width of ACTUS)

    If you have a column, just go down the list of words, using this method on
    each one to align it with the first word.
    This isn't tested, it's just how I would go about trying to do it.

    HTH,
    James
     
    James Belshan, May 18, 2004
    #2
  3. -- The new Y-coord for the CACTUS text should be found by the following
    oops... both times, I meant to say "X-coord", not "Y-coord".
     
    James Belshan, May 18, 2004
    #3
  4. youngman

    youngman Guest

    Thanks for your advice.i would like to try.

    thank you

    regards
    ---------------------
     
    youngman, May 19, 2004
    #4
  5. Thanks for your advice.i would like to try.
    Good luck. Let us know if this approach works or does not work for you, or
    if you run into problems.

    James
     
    James Belshan, May 19, 2004
    #5
  6. youngman

    youngman Guest

    hi,
    i tried ,and i partly succeeded.

    for i found that the widths of the bounding boxes are sometimes different
    though the len of two words are same.(
    i dont know why)

    (for exemple word1.36 bounding box width 411, word 2.56 bounding box
    width 487)

    thank you after all
     
    youngman, May 19, 2004
    #6
  7. youngman,

    If the font used by the text items is a "proportional" font, different
    letters can have different widths. So "1.36" can have a different width
    than "2.56" even though they have the same number of letters. The method I
    gave you should be able to handle this, because the bounding boxes are based
    on the actual font used by each text item.

    My VBA isn't working yet on my new computer, otherwise I would just try to
    try out a quick example.

    James
     
    James Belshan, May 19, 2004
    #7
  8. youngman

    youngman Guest

    Thank you so much.

    i am too busy to have a complete try .

    thanks after all.

    best regards
     
    youngman, May 21, 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.