Justifying Text after Mirroring a Plan

Discussion in 'AutoCAD' started by Ben Hoffmann, Dec 29, 2003.

  1. Ben Hoffmann

    Ben Hoffmann Guest

    Hello All,
    Our company frequently does opposite hands (mirror images across the
    y-axis) of our plans and I'm trying to create a script to automate it. The
    problem occurs when mirroring a group of "DTEXT" objects. We use "DTEXT" to
    create our text objects and have several scripts already written using this
    so completely switching to "MTEXT" is not an option. In the original plan,
    the objects are left-justified (according to the "DTEXT" properties) and the
    insertion points and the left-hand points of the bounding box all have the
    same x-coordinate. After mirroring the objects, they are still
    left-justified according to the "DTEXT" properties, but the left-hand points
    of the bounding box no longer line up. Now the right-hand points of the
    bounding box have the same x-coordinate.

    EXAMPLE:
    Before:
    BH-55
    W8X18 STL. BM.

    After Mirroring:
    BH-55
    W8X18 STL. BM.

    One solution I've come up with is to convert a group of "DTEXT" objects
    to a single "MTEXT" object, mirror it, change the justification, then
    explode it back to "DTEXT" objects. This works well but I'm trying to get
    away from having to select each and every object or group of objects. My
    plan for the script file is to do a selection set of all "DTEXT" objects,
    then create sub-sets of objects that have the same x-coordinate for the
    insertion points and the left-hand points of the bounding box. Then I could
    convert only those objects to a single "MTEXT" object, mirror it, change the
    justification, and explode it back to multiple "DTEXT" objects. Does this
    make sense or is there a simpler way to accomplish this? Also, what is the
    best way to create the subsets? Should I use an array? I was thinking of
    using one with the number of columns being the number of unique groups of
    "DTEXT" objects and the number of rows being the number of lines of text in
    the group... Make sense? Any suggestions?

    Thank you in advance!
    Ben Hoffmann
    Scholz Design, Inc.
     
    Ben Hoffmann, Dec 29, 2003
    #1
  2. Ben Hoffmann

    ECCAD Guest

    Interesting approach. I would do it like this:
    Get all the Dtext objects (list 1)
    Pull out text - line at a time, (list 2)
    Pull the insertion points (list 3)
    Delete all the old stuff (selection set in 1)
    Insert new Dtext, strings, at IP's
    Save
     
    ECCAD, Dec 29, 2003
    #2
  3. Ben Hoffmann

    Tom Smith Guest

    I doubt that you're going to be able to automate this, but good luck in
    trying. I differ with the other response. I'd convert all the blocks of
    aligned text to mtext first (maybe using txt2mtxt), so you're dealing with
    fewer things, and because mtext makes things easier anyway. Then mirror the
    whole sheet, then remirror the mtext blocks, then explode them back to text
    if you must.
     
    Tom Smith, Dec 29, 2003
    #3
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.