Skip to content

Configuring Revit objects comparison (RevitComparisonConfig)

As we've seen in the Diffing and Hash pages, we can customise how objects are compared to each other (either using Diffing or by comparing their Hashes) through the ComparisonConfig object.

In addition to the basic ComparisonConfig that we can use with any object, we also have a Revit-specific RevitComparisonConfig object that expands the available options.

Below is an example of how the RevitComparisonConfig looks in Grasshopper. Note that most of them are already covered by the ComparisonConfig object base wiki, while the Revit-specific options are only the first 4 (explained below).

image

Note for developers: Toolkit-specific ComparisonConfig objects

The "default" comparisonConfig object inherits from the BaseComparisonConfig abstract class, which defines all the "basic" options. This abstract class can be extended by the "Toolkit-specific" comparisonConfigs, so you can include additional options to deal with certain objects in your Toolkit, of which RevitComparisonConfig is an example.

In general, if you implement your own Toolkit-specific comparisonConfig object, you will need to implement the functions that deal with it, i.e. a toolkit-specific Diffing() method and a toolkit-specific HashString() method.

The RevitComparisonConfig is in fact used by the RevitDiffing() method, and, when hashing, by Revit's HashString() method. These two methods can be invoked manually, to deal with Revit Objects, or are automatically invoked by the IDiffing() method when the input objects are Revit objects.

ParametersExceptions

Allows to specify Revit Parameter names that should not be considered while Diffing or computing an object's Hash.

This supports * wildcard matching.

ParametersToConsider

The ParametersToConsider input allows you to add parameter names that should be considered while Diffing or computing an object's Hash.

If you add a parameter name in this field, only the value held in that parameter will be considered.

If the parameter name that you specified is not found on the object, then no parameter will be considered for that object.

This input supports * wildcard matching.

ParameterNumericTolerance

This works similarly to the PropertyNumericTolerance option, but it applies to Revit Parameters only. See that wiki section for more details on how to use it.

ParameterSignificantFigures

This works similarly to the PropertySignificantFigures option, but it applies to Revit Parameters only. See that wiki section for more details on how to use it.




For a description of all remaining options, see /Configuring-objects-comparison:-%60ComparisonConfig%60.