Getting Started With The Standards Checker

 Version:V8, XM, V8i, CONNECT

The Standards Checker, added originally to MicroStation V8 2004 Edition, allows you to check your files against a set of standards that are defined in a separate DGN file or set of DGN files.

As delivered, the Standards Checker can perform the following operations:

1. Generate a report that lists any differences between your file and the file(s) that contain(s) the standards

2. Interactively go through a file, giving you the option to ignore, fix, or skip each noncompliant standard

Note that the Standards Checker can be customized to do more things through the use of VBA or MDL. This article covers only a few of the delivered capabilities.

Before beginning, you first need to understand the files that are involved in setting up and running the Standards Checker, and each file's purpose.
The following diagram will be used as a base for setting up the Standards Checker.


Part 1 - Set up file that contains Standards Checker Settings

1. Create a new design file (I will call this file standards.dgnlib).

2. Navigate to Analyze Tab > Standards Checker Ribbon Group > Configure

For V8i and other versions, you must navigate to Utilities > Standards Checker > Configure

3. Click the "Create new Standard Checker Settings" icon.

4. Give the Settings a name in the Name field. Description field is optional.

5. Toggle the features that you want the Standard Checker Settings to use for this particular Standard Checker.
For example, checking "Check Levels" and "Check Text Styles" will only check the Levels and Text Styles in a file when running those particular Standard Checker Settings.

6. Click the Settings button next to each check field that has been enabled in Step 5. Here you are given a choice as to which file(s) you will use for your source standards (those files that contain the standards you want to use). You are presented with three choices-referred to as A, B and C in the above diagram.

A: Configured DgnLibs - If selected, all of the files specified by the MS_DGNLIBLIST configuration variable are used as the standards source.

B: Selected DgnLibs - If selected, only the specified files from the MS_DGNLIBLIST configuration variable are used as the standards source.

C: Active File - If selected, the file in which you are configuring the Standards Checker (standards.dgnlib in this example) is used as the standards source. With this option, you can create a standards file that includes both the actual standards and the settings for checking those standards.

Note that if either A or B are used, at least three files will be needed for the Standard Checker process (the file being checked, the standards.dgnlib file, and at least one other file specified by MS_DGNLIBLIST configuration variable). However, with the third source option (C) you will only need two files (the file being checked and standards.dgnlib).

In this example, we will use Option C: Active File so that both the Standards Checker Settings and the actual standards are contained in the same file (standards.dgnlib).


7. Toggle the boxes next to the properties you would like to check. For example, if you select ByLevel Color, the Standards Checker will look for any levels with different ByLevel Color than that in your standards source. Press OK in each dialog after adjusting the settings, and press OK again to accept the changes and exit out of the Standards Checker Settings dialog.

You have now set up the relationship between the Standards Checker Settings and the Standards used for actual checking.
To reiterate, this relationship is shown in the above diagram as Part 1.
Now we will move to Part 2, which will show how to use what we have just set up to actually check a file.

Part 2 - Check a design file against the standards

1. Open any design file you would like to check with the Standards Checker.

2. Navigate to Analyze Tab > Standards Checker Ribbon Group > Standards Checker

In V8i and earlier versions, navigate to Utilities > Standard Checker > Check

3. Click the Browse icon to select the standards.dgnlib file created in Part 1.
Note that you have the option to automatically load a Standards DGNLIB file by pointing configuration variable MS_STANDARDSCHECKER_SETTINGSFILE to the particular DGNLIB file.

4. In the Settings Name drop-down menu, select Settings that were created in Step 4 of Part 1. 
Configuration variable MS_STANDARDSCHECKER_SETTINGSNAME can be used to always load a particular Settings Name within the Standards DGNLIB.

5. Make sure that the Interactive button is checked on and select OK. The Standards Checker process has now been initiated.
You will now be interactively presented with each standard in the active file that does not match any of the standards in the DGNLIB file(s) configured as the standards source.

6. As you can see in the above image, the Standards Checker has found a level property that does not match the standards source level property as previously configured (Level2 color).
At this point, you are given three choices:

Ignore - Choose this option to ignore the discrepancy. Once a discrepancy between the file being checked and the configured DGNLIB files is ignored, it is flagged as being Ignored. This is beneficial when you want to check the file again. As you can see in the previous image, there is an option to Show Ignored Problems in the Standards Checker dialog box. When unchecked, previously ignored problems will not be picked up by the Standards Checker.

Fix - Choose this option to fix the problem. The Standards Checker presents you with options that match the standards configured  in the DGNLIB files. By choosing an option and selecting the Fix option you are telling the Standards Checker to move the elements on the original "incorrect level" to the desired "correct level" and effectively removing the "incorrect" level from the file being checked.

Skip - Choose this option to skip the problem. Use this option when you want to simply skip a discrepancy, but do not want to flag it as Ignored in future sessions.
If Show Ignored Problems was checked on in the Standard Checker dialog box, you will be presented with each previously ignored problem and will be given the choice to "Stop Ignoring" or "Continue Ignoring."

7. Once you have ignored, fixed, or skipped all of the discrepancies, a Standards Check Complete dialog box will pop up and show you a general list of what was done to the file.

8. If "Report File" was checked on in the Standard Checker dialog box (Step 5), you will also be prompted to review the report file. Clicking Yes to "Review Report File" will open an .xml file in which a detailed report of what was done to the file being checked will be listed. You do not have to have to run the Standards Checker interactively to run a report file. With just "Report File" checked on, the Standards Check Complete dialog box will immediately pop up asking you if you would like to review the XML file. The default location where the reports are stored can be controlled with configuration variable MS_STANDARDSCHECKER_OUT

If you set your machine's default app for XML file type to a web browser, then you will see an interactive report after pressing Yes.
You can also go back to the XML file later and open it.

Part 3 - Example of how a VBA macro can be used with the Standards Checker

MicroStation includes a few examples of VBA macros that you can run with the Standards Checker.

By default, MicroStation CONNECT delivers them in:
C:\ProgramData\Bentley\MicroStation CONNECT Edition\Configuration\WorkSpaces\Example\WorkSets\MetroStation\Standards\Macros

For example, the SCCompleteRefCheck.mvba will scan through a file and report any reference attachments that are not found, but they were previously attached.
To run this VBA with the Standards Checker, follow these steps:

1. Add SCCompleteRefCheck.mvba to MS_STANDARDCHECKER_APPS configuration variable in your configuration and then load the VBA.

2. Next, run the Standards Checker. You will then be presented with an additional check option in the Standards Checker dialog box: VBA Reference Checker. Toggle this option ON and press OK.

3. After you press OK, the Standards Checker will run with the activated VBA add-on.
Any missing references files in the master file will be reported to you.

4. When the resulting Report File is opened, you will see the reference(s) that are not resolved in the file(s) being checked.
As you can see here, the "ref.dgn" file is missing as a reference attachment within the "test.dgn" master file.

Additional Notes

1. Additional information about the Standards Checker can be found in the Administrative Guide in the delivered documentation under the "Ensuring Standards Compliance" section.
Home > Setting Up the Environment > Ensuring Standards Compliance

2. In MicroStation V8 XM Edition and later releases, you will be able to store custom line styles in DGNLIB files. Therefore, you will be able to use the Standards Checker to check files for non-compliant line styles.

3. Also in XM and beyond, you will be able to check for non-compliant Element Templates stored in DGNLIB files. An element template is a set of element attributes, including color, level, line style, and line weight, that is applied to an element that is being placed.

See Also

MicroStation's Standards Checker in ABD 

Other language sources

 Original Author:Erik Lofgren