eplisp

Unmirror (UNMIRROR)

eplisp, the free multilingual LISP library

Unmirror (UNMIRROR)
Openly licensed; the original file is hosted here together with its license.
…
Rate this tool:
CommandsUNMIRROR
CategoryBlock Tools
AuthorLance A. Endres
Sourcelendres/CAD-Support-Files
LicenseMIT
RequirementsAutoCAD, AutoCAD LT 2024 or later, BricsCAD (no ActiveX calls)
Prompt languageEnglish
Filesunmirror.lsp (8 KB)
Added2026-10-26
Download the original fileSource repository

UNMIRROR turns mirrored blocks (negative scale) back to positive scale, repositions their attributes and makes lines run left to right.

UNMIRROR is an old but still useful routine that fixes blocks whose scale factors became negative after the MIRROR command. It addresses problems such as backwards-looking content, shifted attributes and scale differences in block counts.

Overview

From the selection the command keeps only blocks with a negative X, Y or Z scale and LINE objects. It makes each block's scale factors positive and, for blocks with attributes, moves the attributes back to the positions defined in the block. For each block name it asks once whether to rotate the block 180° and applies that answer to other blocks of the same name.

For lines in the selection it swaps the start and end points where needed, so every line runs left to right, and vertical lines bottom to top.

How to use it

  1. Load unmirror.lsp with APPLOAD.
  2. Type UNMIRROR at the command line.
  3. Select the blocks and/or lines to fix and press Enter.
  4. For each block name, answer Yes/No to whether the block should be rotated 180°.

Notes and limitations

  • Modifies the selected blocks and lines directly; the work is wrapped in one undo group, so U reverts it.
  • There is a bug in the code: when a selection contains both mirrored blocks and lines, some lines can be skipped. Run blocks and lines separately.
  • Attributes are moved to their block-definition positions without accounting for block scale, so on blocks scaled other than 1 attribute positions may shift.
  • Uses the global variables OLDERR and ROTLST.
  • Try it on a copy of the drawing first.

Source and license

This tool is not made by eplisp. The file is published unchanged under its author's license; copyright stays with the author.

References

  1. Source repository: lendres/CAD-Support-Files – https://github.com/lendres/CAD-Support-Files
  2. Author: Lance A. Endres – https://github.com/lendres
  3. License: MIT – https://github.com/lendres/CAD-Support-Files/blob/b8303392c64a33077e883f51db54c00f3a710a5a/License.txt

Found a mistake, or are you the author of this tool? Request a correction or removal