Skip to content

DataSpec Getting Started

Ollie Green edited this page Apr 14, 2021 · 8 revisions

Creating A Rule

To get started, click on the DataSpec Rule Manager button in the Regular ribbon tab -> RegularIcons_RuleManager
All of your DataSpec rules live in the Revit document, and the Rule Manager is where you can view, create, edit or delete any existing rules. In a Revit document with no pre-existing rules, the Rule Manager window will look empty, like so:

  • To create a new rule, click on the New Rule button. The Rule Editor window should appear.
  • See examples of how rules are built up piece-by-piece in our Examples section.

 

Managing Rules

  • Once defined, rules are saved into the Revit model, and can be easily accessed and edited at any time. To edit a rule, open the Rule Manager dialog:

  • Click the pencil icon next to a rule to edit it.
  • Click the 'X' button next to a rule to delete it. Note: Deleted rules cannot be recovered!
  • To duplicate a rule, as a convenient basis for creating a new rule, select a rule and click on the 'Duplicate Rule' button. The editor window will then appear.
  • Rules can be exported to or imported from .JSON files using the 'Transfer Rules' button.

 

Validating Data

  • Once a rule has been defined, users can select the rule by clicking on it and pressing the Execute button.
  • Executing a rule will expand a resizable side panel and begin creating a validation report. The UI will be frozen as this report is created. Executing our example rule displays the following report:

  • Once the report has run, DataSpec will report what percentage of data was valid against your chosen rule.
  • Data can be sorted by clicking any of the column headers.
  • Where data has been found to be invalid against the rule, a randomised value has been generated in compliance with the rule's format standards.
  • Validation reports can be easily exported to .CSV format for review in other software.

NOTE: For ease of use, any of the target parameter values can be edited and revalidated directly in the UI, by clicking and re-typing a new value in the cell.

 

Rule Parts

DataSpec rules are defined using a series of 'rule parts', which are arranged in a specific sequence by the user. Let's examine each of these rule parts in detail:

Any Alphanumeric (A-Z, 0-9) will allow any letter or number in a code. Case specificity can be toggled between only uppercase, lowercase or any case by clicking on the A-Z button in the rule part body.

This equates to the regex '[A-Z0-9]', '[a-z0-9]' or '[A-Za-z0-9]', depending on the chosen case options.

Any Letter (A-Z) refers to any single letter in a code. Case specificity can be toggled between only uppercase, lowercase or any case by clicking on the A-Z button in the rule part body.

This equates to the regex '[A-Z]', '[a-z]' or '[A-Za-z]', depending on the chosen case options.

Any Digit (0-9) allows for any single digit in a value.

This equates to the regex '\d'

Custom Text allows the user to specify any particular word or symbol they want. This is defined by clicking the 'Edit' button and typing in the text box once the rule part has been added.

This can be useful for company names, such as 'ACME'. Protected regex symbols are automatically sanitised from any user input. This can be made case sensitive by ticking the 'Case Sensitive' checkbox.

Option Set lets the user define several options for part of a code, any of which will be accepted by the validator.

As with Custom Text, any protected regex symbols are sanitised as they are entered. These options can be made case sensitive by ticking the 'Case Sensitive' checkbox.

Full Stop (.) is a simple shortcut for defining a '.' character.

Hyphen (-) is a simple shortcut for defining a '-' character.

Underscore (_) is a simple shortcut for defining a '_' character.

Open Parenthesis '(' and Close Parenthesis ')' are simple shortcuts for defining the '(' and ')' characters.

Please Note: Any rule part can be made optional by ticking the 'Optional' checkbox in the rule part body.