Skip to main content

Lesson 4: Project values

A check that has "NDXTEST" typed into it works for one project only, and a check that has "DRAFT" typed into it stops being right as soon as the drawings move to the next phase. In this lesson you move such values into the project, where they can be changed in one place, or just for one report, without touching the checks. Then you check every drawing against a drawing register: the drawing number must be in the register, and the title on the drawing must match the title in the register.

What you learn​

  • Project variables, used in Fixed value checks and patterns.
  • Lists, used by the One of a list check.
  • Saved patterns, one pattern used by several checks.
  • Lookup tables, loaded from an Excel or CSV file, in Row and Columns mode.
  • Changing variables and tables for one report, just before it runs.

Files for this lesson​

Download Lesson 4 files (zip) and unpack it.

FileWhat it is for
template/NDXTEST-NHX-B1-00-DR-A-200100_P02_A3_landscape.pdfThe template for the document type.
check/NDXTEST-NHX-B1-00-DR-A-200120_P01_A3_landscape.pdfDrawing to check.
check/NDXTEST-NHX-B1-01-DR-A-200121_P01_A3_landscape.pdfDrawing to check.
check/NDXTEST-NHX-B1-02-DR-A-200122_P01_A3_landscape.pdfDrawing to check.
check/NDXTEST-NHX-B1-03-DR-A-200123_P01_A3_landscape.pdfDrawing to check.
check/NDXTEST-NHX-B1-RF-DR-A-200124_P01_A3_landscape.pdfDrawing to check.
check/NDXTEST-NHX-B1-ZZ-DR-A-200199_P01_A3_landscape.pdfDrawing to check.
drawing-register.csvThe drawing register: drawing number, title and revision of each drawing. You load it as a lookup table.

The register can also be downloaded on its own: drawing-register.csv. Open it in Excel to see what it holds before you start.

Values that live in the project​

There are four kinds of project values: project variables (a named value, such as the project code), lists (allowed values, such as role codes), saved patterns (one pattern reused by several checks) and lookup tables (a table from an Excel or CSV file, such as a drawing register); see Project values.

All of them are on the Project tab. You do not have to leave the document type to change them, though: the Project values button at the top of the document type page opens a side panel with tabs for the variables, lookup tables and lists. In this lesson you set up the values from that panel.

The Drawing document type page with the Project values panel open on the right, showing the variable Project code set to NDXTEST

Each value can be changed just before a report runs. The report keeps the values it ran with, so you can always see what it was checked against.

Lookup tables: Row and Columns​

A Lookup check takes two texts from the drawing: the key it looks up (for example the drawing number) and the text it compares (for example the title). In Row mode it finds the first row holding the key and passes when the compared text is anywhere in that row; in Columns mode it finds the key in one chosen column and compares with the cell in another. In both modes the key must match a cell exactly, including upper and lower case. See Validators › Lookup.

How a Lookup works: the key, here the drawing number, is found in the table; in Row mode the compared text must be anywhere in that row, in Columns mode it must equal the cell in the chosen column

Steps​

Set up the project and its values​

  1. Create a new project named Lesson 4, drop the lesson 4 template on the Doctypes tab, open the document type and rename it to Drawing with Edit details.

  2. On the Drawing page, choose Project values at the top. The panel opens on the right, on the Variables tab. Click the last row of the grid, type Project code as the Name, press Tab, type NDXTEST as the Value and press Enter. The grid works like a spreadsheet.

  3. Switch to the Lists tab and choose New list. Name it Role and type the options A, B, C and D in the grid, one per row.

  4. Switch to the Lookup tables tab, choose Import and pick drawing-register.csv. Choose Open the full page to see the table on Project › Lookup tables. It is listed as "drawing-register.csv", 1 sheet, 7 rows in the first (the header and six drawings), "Not used yet". Go back to the Drawing document type afterwards.

    The Lookup tables page with drawing-register.csv loaded

Set up the fields​

  1. Open the Drawing document type and choose Auto-extract title block, then Remove all.
  2. Click these boxes: the seven small drawing number boxes (Project, Originator, Volume, Level, Type, Role, Number), REVISION and DRAWING TITLE. Rename the title of the small Project box to Project code.
  3. Add checks in the popup:
    • Project code: the + under Fixed value.
    • Role: the + under List, and pick the list Role.
    • REVISION: the + under Pattern ("P" + 2 digits).
  4. Choose Add 9 fields.

Use the variable​

  1. Expand the Project code row and click its Fixed value block.
  2. Switch Expected value from Text to Project variable and pick Project code. The helper text shows its current value, NDXTEST. Choose Save.

Save the revision pattern​

  1. Expand the REVISION row and click its Pattern block.
  2. Choose Save as pattern… and name it Revision. Choose Save. The pattern is now listed under Project › Saved patterns. Another check, or a file name filter, can use it with the Saved pattern block, and a change to it changes all of them.

Check against the register​

The register's first column holds the full drawing number, such as NDXTEST-NHX-B1-00-DR-A-200100. Build the same text from the seven boxes, as in lesson 2.

  1. Choose Add › Extract: Combination. Name it Drawing number, add seven sources (Project code, Originator, Volume, Level, Type, Role, Number, each the entry without its label), and type the pattern a-b-c-d-e-f-g. The preview reads NDXTEST-NHX-B1-00-DR-A-200100. Choose Save.

  2. Expand the DRAWING TITLE row and choose Add check › Found in a lookup table…. The Lookup editor opens.

  3. Set:

    • Lookup table: drawing-register.csv;
    • Looks up: Drawing number;
    • Look up by: Row.

    Choose Save. On the template it passes: the register's row for 200100 contains "GROUND FLOOR PLAN".

Run the report​

  1. On the Validate tab, choose the six PDFs from the check folder, name the report Lesson 4, and choose Run report.

  2. Before the run, the dialog Check the values for this report lists the project values the document type uses: the variable, the lookup table and the list. Each can be changed for this report only. Leave them as they are and choose Run report.

    The dialog Check the values for this report, here from the example project with its Role list

  3. Export the report to Excel and filter the Results sheet on Status FAIL. Look at the Details of the DRAWING TITLE checks.

Change the project code for one run​

  1. Run the report again on the same six PDFs, named Lesson 4 other project.
  2. In Check the values for this report, change Project code for this report to NDXDEMO. Leave Also save these changes to the project off, and choose Run report. Every drawing now fails its Project code check, because the drawings say NDXTEST. The project itself still has NDXTEST.

Exercise​

Set up the document type as in the steps: Project code (Fixed value from the variable), Role (One of a list), REVISION (the saved pattern), the Combination "Drawing number", and DRAWING TITLE checked against the register in Row mode. Run it on the six drawings, then run it again with the project code changed for that run only.

You're done when…

  • every check passes on the template;
  • the report "Lesson 4" shows Files 6, and Results 6: 3 passed, 3 failed;
  • drawings 200120, 200121 and 200124 pass;
  • drawings 200122, 200123 and 200199 fail their DRAWING TITLE lookup, and you can say why for each (see the answers below);
  • the report "Lesson 4 other project" shows Results 6: 0 passed, 6 failed, and the project variable still says NDXTEST.

Check yourself​

Exercise answers​

Why do 200122, 200123 and 200199 fail?
  • 200122: the Number box says 200123, although the big drawing number says 200122. The Combination builds NDXTEST-NHX-B1-02-DR-A-200123 from the boxes, and that number is not in the register.
  • 200123: the number is in the register, but the register calls it "FOURTH FLOOR PLAN", and the drawing says "THIRD FLOOR PLAN". Details: Not in the row of "NDXTEST-NHX-B1-03-DR-A-200123".
  • 200199: the drawing number is not in the register at all. Details: "NDXTEST-NHX-B1-ZZ-DR-A-200199" not found in the lookup table.

Questions​

The register is updated with two new drawings. What do you do?
Your register has the drawing numbers in lower case. Will the lookup work?
Why use a project variable for the project code rather than typing NDXTEST into the check?
In the example project

NDX Example - Text and drawings has the list Role (A, B, C, D), used by the Role field of the data frame "Title block". When you run a report there, the dialog Check the values for this report offers the Role list, as in the picture above.

See also​