Using DiffTool to Compare Models
The DiffTool extension provides UI controls for comparing 2D and 3D models.
Examples
viewer.loadExtension('Autodesk.DiffTool')
Usage
Using the DiffTool, you can compare the differences between models in Viewer SDK. The DiffTool shows three kinds of changes to the primary model:
- Added: Shows objects that have been added to the primary model.
- Removed: Shows objects that have been removed from the primary model.
- Modified: Shows objects that have been changed in the primary model
There are three modification types:
- Geometry: The geometry data has been modified.
- Transformation: The geometry transformation has been modified.
- Attribute: One or more properties of the geometry has been modified.
Configuring DiffTool LMV extension
A list of all configuration options for the DiffTool LMV extension:
primaryModels* Autodesk.Viewing.Model | An array of loaded “Autodesk.Viewing.Model” instances that are compared by the DiffTool. |
diffModels* Autodesk.Viewing.Model | An array of other loaded Autodesk.Viewing.Model instances that participate in the diff operation as the previous state. Length must match primaryModels to define pairs of models to be compared. |
versionA* string | Version identifier for the primary models, such as “2”, “Version 2”, or “02/26/2018”. Note that you must provide a localized string if you are using something other than numbers or dates. |
versionB* string | Version identifier of the diff models, usually a previous version |
mimeType* string |
|
propertyFilter {Object.<string,Array<string>} | An object representing a category and properties key-value pair to ignore for diff computation. Example: {“Dimensions”:[“Area”,”Length”], “Mechanical - Flow”:[“Flow”]} |
* Required
Using LMV initialization options
Examples
var config = {
availableDiffModes: ['overlay', 'sidebyside'],
diffModels: A,
primaryModels: B,
mimeType: 'application/vnd.autodesk.revit',
diffMode: 'overlay',
versionA: 'A',
versionB: 'B',
propertyFilter: { "Category1": [ "Property1", "Property2" ] }
};
viewer.loadExtension("Autodesk.DiffTool", config);
Show More