Create a Revision Table with PlantLink

<< Click to Display Table of Contents >>

Navigation:  PlantExpressTools > How to use > Create Lists >

Create a Revision Table with PlantLink

Previous pageReturn to chapter overviewNext page

This chapter describes how you can create a revision table. It is a combination of the List function, PlantProjectManager's Version/Revision function and PlantLink.

The workflow shown in this chapter is supposed to be a work around until we have a dedicated function to create the Revision Tables automatically.

The end result we want to accomplish looks like this:

Create Lists 68

The basis for the table is the Version/Revision history managed by PlantProjectManager. For details, see: Activate Version/Revision.

Create Lists 69

The general approach is to create a symbol which will contains A, B, C and so on. This symbols will the get the revision data (date, name, description) from the table above. Finally, the List function will create the table for the revisions.

First we need to identify which class to use. It makes sense to have the class under the Non Engineering Items. If you want you can use PlantExpressTools' undocumented function AQAPETCREATECLASSES to create a class anywhere you want, because Project Setup doesn't allow to create a class under some classes.

If you use this option, you select the Non Engineering Items class and type in a Name for the class. In this case Revisions as a suggestion. If you don't type in a Display Name, the Display Name will be the Class Name. The Display Name can always be changed in Project Setup.

Create Lists 70

After clicking OK, the class will be created. You then create a symbol which will later be inserted as the first column in you template drawing.

Create Lists 96

We also need 4 properties to store the data from the PlantProjectManager history database in the symbols. And one more property with an acquisition from the drawing title.

Make sure you add a Space as the Default Value for the Name, Description and Date properties. Otherwise you will later get the "." in the Annotations which you probably won't like.

Create Lists 71

The block of the symbol could look like this:

Create Lists 72

For the List function we also need an Annotation the List function will later insert.

The Revision Index will be shown by the Symbol itself and the remaining Description, Name and Date will be shown through the Annotation.

Create Lists 73

Next we need to create a database view in the ACProject.db. Use a SQLite Editor which allows the creation of views. We always recommend SQLite Expert. The free Personal version is sufficient for this purpose.

Create Lists 74

In the ACProject.db you will find the table ReportRevisions this table contains the history of all drawings, but also of reports from PlantReporter (if you have the version/revision feature enabled).

Create Lists 75

You need to create a view like this:

Create Lists 76

To make it easier, you can copy the SQL Statement from here:

SELECT
      [main].[ReportRevisions].[VersionNumber],
      SUBSTR ([main].[ReportRevisions].[RCFName], 1, LENGTH ([main].[ReportRevisions].[RCFName]) - 4) AS [TrimmedRCFName],
      STRFTIME ('%d-%m-%Y', [main].[ReportRevisions].[DateTime]) AS [FormattedDate],
      [main].[ReportRevisions].[UserName],
      [main].[ReportRevisions].[ChangeDescription]
FROM   [main].[ReportRevisions]
WHERE  [main].[ReportRevisions].[VersionType] = 'R'
ORDER  BY [main].[ReportRevisions].[DateTime]

When you need the US date format you use '%m/%d/%Y'.

The result of the view looks like in the following image. As you can see, there are the 5 properties we defined above.

Create Lists 77

Next we create a new link configuration with PlantLink. The data source is the ACProject.db. You can select the file with the Browse button and PlantLink we adapt the path automatically.

Create Lists 78

Next you select Update.

Create Lists 79

Now the class where the revision objects exist.

Create Lists 80

You select the view you created earlier.

Create Lists 81

Now we need to link the drawing title and revision index properties with the columns from the view. This tells PlantLink how to find the correct row in the view.

Create Lists 82

You then map the remaining columns to the other 3 properties. By default, the Clear value checkbox is checked. You should disable this to keep the Space as the Default Value as set in Project Setup.

Create Lists 83

Finally, you define a name.

Create Lists 84

If everything has been setup correctly you should see Active as the Status.

Create Lists 85

Now we need to setup the List function with a new configuration.

You select the class for the symbols, the Annotation you created and the property which holds the revision index, and select A-Z.

Create Lists 86

We don't need a title block in this example.

Create Lists 87

You select the orientation.

Create Lists 88

The start point where the first Annotation should be inserted and then some length and height for the table.

Create Lists 89

And finally a name.

Create Lists 90

Like with the link configuration the configuration must show Active.

Create Lists 91

You may want to enable to updating of lists on drawing save in order to ensure, that the revision table is up-to-date when saving the drawing.

Create Lists 97

In the drawing you add the legend/title for the revision table. You will probably do this in the dwt file which you use to create new drawings.

Create Lists 92

Then you insert the symbol in the drawing and you set the Index with A to E (or whatever is the maximum you want to see).

Create Lists 93

When you now save the drawing PlantLink will bring in the data from the ACProject.db database and the List function will then insert the Annotations.

Create Lists 94

If you have a revision table which should only show a certain number of rows (e.g., 5), but you are now at revision 6, you simply delete the row with A and move every thing down. The you either insert another revision symbol and use F for the index, or you copy the top row and change the E to F.

Create Lists 95