Table of Contents

Method CmdCompare

Namespace
VectorDraw.Professional.ActionUtilities
Assembly
VectorDraw.Professional.dll

CmdCompare(object, object, bool)

Compares two drawings and visualizes the differences in the current document.

public int CmdCompare(object Drawing1Path, object Drawing2Path, bool navigate)

Parameters

Drawing1Path object

The file path of the first drawing to compare. Pass a 'user' object to display a file dialog.

Drawing2Path object

The file path of the second drawing to compare. Pass a 'user' object to display a file dialog.

navigate bool

If true, the method waits for the user to press arrow keys to automatically zoom to the yellow rectangle areas where differences are found.

Returns

int

0 if there are no differences between the drawings.

Greater than 0 if differences are found.

-1 if an error occurs during comparison.

Remarks

This method allows you to quickly identify differences between two versions of a drawing, displaying changes with color coding.

See Compare(vdDocument) for additional information.

Important Notes:

  • It is recommended to compare drawings of the same type and extension.
  • Two block references are added to this document, one for each compared drawing.
  • The comparison only works for objects in Model Space.
  • Double-value properties are compared using the CompareDocumentSettings DecimalPrecision setting, which defaults to 8 decimal places.

Color Coding Convention:

vdDocument.FileProperties.CompareDocumentSettings.SameObjectsColorObjects that are identical in both drawings.
vdDocument.FileProperties.CompareDocumentSettings.NoMatchingObjectsColor1Objects in drawing 1 that have no matching object in drawing 2.
vdDocument.FileProperties.CompareDocumentSettings.NoMatchingObjectsColor2Objects in drawing 2 that have no matching object in drawing 1.
vdDocument.FileProperties.CompareDocumentSettings.DifferentObjectsFadeEffectFade effect applied to objects of the same type with the same handle but different properties on both drawings.
vdDocument.FileProperties.CompareDocumentSettings.RectangleColorRectangles that group neighboring changes for visual clarity.
vdDocument.FileProperties.CompareDocumentSettings.IncomparableObjectsColorObjects that are incomparable, usually because comparison is not supported for their type.
See Also
CompareDocuments