How to Compare AutoCAD drawings

It becomes increasingly difficult to remember what has been changed from one revision to another as your design develops, especially when working in a remotely distributed team. The DWG Compare feature by AutoDesk provides a way to perform a visual comparison between two drawings - it identifies objects that have been modified, added, or removed from the two drawings and uses color and revision clouds to show the differences. The result displays in a new drawing called the comparison drawing.

Three colors in the comparison drawing highlight the common objects and the differences. You can specify colors to identify the following:

  • Objects that exist only in the first drawing – green, by default
  • Objects that exist only in the second drawing – red, by default
  • Objects that are unchanged or common to both drawings – gray, by default

To compare drawings with DWG Compare you should:

  1. Do one of the following to launch the DWG Compare utility:
    1. Click Collaborate tab > Compare panel > DWG Compare.
    2. Click Application menu > Drawing Utilities > DWG Compare.
  2. In the DWG Compare dialog box, click Browse to select the first drawing file.
  3. Click the color to change the default color settings for the objects that exist only in the first drawing.
  4. Browse to and select the second drawing file that you want to compare with the first drawing.
  5. Click the color to change the default color settings for the objects that exist only in the second drawing.
  6. Click Compare. A new drawing opens which contains the comparison results.

How to Compare AutoCAD drawings using GroupDocs.Comparison

Despite the fact that drawings comparison feature provided by AutoDesk is quite handy and powerful it is obviously doesn’t provide a way to compare drawings programatically and manipulate found differences in code. GroupDocs.Comparison provide an easy and convenient API to detect differences between drawings (and many other supported file formats) and apply or discard found changes to result document. Here is an example of DWG drawings comparison

Source / Target Drawings

Here are the steps to compare two DWG files:

  • Instantiate Comparer object with source document path or stream;
  • Call add method and specify target document path or stream;
  • Call compare method.

The following code sample demonstrates an approach described above.

As a result, we get a DWG file where the deleted elements are marked in red, the added – in blue, and the modified – in green.

Result DWG

More resources

Advanced Usage Topics

To learn more about document comparison features, please refer to the advanced usage section.

GitHub Examples

You may easily run the code above and see the feature in action in our GitHub examples:

Free Online App

Along with full-featured Java library we provide simple, but powerful free Apps. You are welcome to compare your DOC or DOCX, XLS or XLSX, PPT or PPTX, PDF, EML, EMLX, MSGand other documents with free to use online GroupDocs Comparison App.