This Client Server article is republished in its entirety from 2002 for reference purposes.
By Todd Cassell, Support Analyst, Bentley Corporate Headquarters 16 December 2002
There is a little known and little-used function in PlantSpace P&ID tagging that makes maintaining and using the Tag tools much easier.
Normally, the tags for a specific component are defined with the Tag Editor using a Value Source that is usually set to either Key-in or List (Figure 1).
Figure 1 However, what would happen if you wanted to pick from a list that changes quite frequently? One option would be change the tag set definition for that property whenever a new value was needed. This, however, would require reloading the tag library each time in order to see the changes
A better alternative would be to utilize the database query function for tagging. By setting up a small database table and then defining that same tag definition to query this table, the entire process is simplified and maintaining the data is quite a bit easier.
This article will show you how to set up both a simple and somewhat more complex query. The versions used for this example are MicroStation Schematics/PlantSpace P&ID version 7 or higher, and Microsoft Access for the database itself. The only tag set referenced will be the delivered pipe tag set.
The first step is to create a new Microsoft Access database to hold the tables to be used by PlantSpace P&ID. For the purposes of this article, I will assume you are familiar with this procedure, and will not go into detail on this (If you're not sure how to create a new Microsoft Access database, refer to the Microsoft Access Help).
Figure 2 and Figure 3 Name the database "Tags" Create two blank tables named "Spec" and "Data" In the Spec table, create a column named Spec with seven rows Begin naming your rows with "CS100" and continue until "CS700" (see Figure 2 below). Save your changes and close this table. In the Data table, create two columns named "Spec" and "Line" In the Spec column, set it up the same way as in the previous Spec table (CS100-CS700). In the second column (Line), add rows containing values of 100 through 700 as illustrated in Figure 3
Figure 4 The next step is to set up an ODBC datasource. Again, I am assuming that you are familiar with this procedure, so I will not go into detail. Create the datasource and name it "Tagdata" (Figure 4).
(If you're not sure how this is done, refer to MicroStation Schematics Administrator Guide, Page 218).
With the database table and the ODBC datasource created, the next step is to define the tag fields that will be using this query.
Figure 5 For the purpose of this article, there will be two examples demonstrating how queries can be used to generate tag data. The first example will return a pick list of available values, and the second example will set a value for one property based on the value of another property selected from the pick list. The Pick List QueryTo begin this portion, open the Define Tags dialog box by selecting the menu option P&ID>Configuring>Tags>Define. Next, select the "Spec" field from the Pipe tag set. Set the Value Source to "ODBC Query." Set the ODBC Source field to "Tagdata." Finally, set the ODBC Query to "Select Spec from Spec Order by 1" (Figure 5).
By setting up the dialog box in this manner, we have simply directed the application to query the Tagdata ODBC source, which points to the tag database, and return all the values from the Spec column which resides in the Spec table. Refer to Figure 2 to see these values.
Once this has been completed, close the tag dialog boxes, and select the Tag Component tool from the P&ID menu. Select a pipe to tag and you will be presented with the standard tag dialog box, but with an added feature (Figure 6).
By selecting the Spec field, you will now be presented with a pick list based on the choices listed in the Spec column of the Spec table (Figure 7).
By defining the spec data available for tagging, it is much easier to maintain up to date specs, while reducing the chance of typing errors. Any modifications of specs as the job progresses can now be accomplished by simply changing one table.
Suppose there was a situation that called for a value to be assigned based on another value that was picked? Can that also be accomplished in the same manner as the spec pick list above?
Figure 8 The short answer to the above question is yes. Although it is a little more involved, it is still a relatively easy task. As with the "Pick List Query" above, select the "Spec" field from the Pipe tag set. Set the Value Source to "ODBC Query," the ODBC Source field to "Tagdata" and the ODBC Query field to "Select Spec from Data where Line = '"+LINE+"' order by 1." For clarification purposes, the '"+LINE+"' translates to single quote, double quote, +LINE+, double quote, single quote (Figure 8).
This query defines that a spec from the data table is being selected, but it is going to be based on the choice that is made for the line number. This is the purpose of setting the ODBC query to Line = '"+LINE+"'. It basically instructs you to go to the Line column and find the value that matches what you have chosen for the Line property, then return the value found in the Spec column for that row. In Figure 9 below, you can see the standard tag dialog box when the pipe tag set is selected.
But, as illustrated in Figure 10, by changing the line number to 400, both the spec value and the $format field change to reflect the change to Spec.
Therefore, any change to the line number field that has a matching value in the appropriate database table, will directly affect both the spec field and the $format field.
Figure 10 By utilizing this built-in tool, one can establish company standards as well as avoid data input errors. By establishing the data in one central table, this data can be easily used for other projects just by modifying the proper tag sets. This is a useful, convenient and flexible method to use where establishing predefined values is required for tagging components.
Client Server Archive
Plant TechNotes And FAQs
Bentley's Technical Support Group requests that you please confine any comments you have on this Wiki entry to this "Comments or Corrections?" section. THANK YOU!