Adding Data from The Process Table to Isometric Backing Sheet, Drawing Frame, Seed File


Applies To
Product(s):OpenPlant Isometrics Manager
Version(s):08.11.09.XXX (SS5) | 08.11.11.XX (SS6)
Environment:Windows 7/8.1/10 (64 bit)
Area:Settings/Attributes
Subarea:DBQuery
Original Author:Abhijit Bute, Bentley Product Advantage Group

Background

In general, the majority of data for Isometric output is gathered from the Piping table. However, situations can arise where data from other tables in the Project Database could be valuable for placement on Iso's. The following illustrated steps demonstrate how to pull a field from the Process table into Isometric backing sheet.

Steps to Accomplish

Adding Configuration Files

In workspace for isometrics does not include the query and grid functionality. It can be added by adding 2 configuration files. Copy attached gridlines.txt and textnodes.txt and paste it in style configuration directory. Ex. \Bentley\Plant V8i\Bentley PlantV8i Projects\SAMPLE_IMPERIAL\Config\OpenPlant\Isometrics\Styles\IFC\ Config

Please find the query file below to be pasted in style configuration directory:

communities.bentley.com/.../Gridlines-_2600_-Textnodes-File.zip

Create New Drawing Attribute & Define Query

To get database attribute in Drawing Tag dialog ,user need to add query, project database location in textnodes.txt file,While creating an isometric AP adds a few standard drawing attributes. Currently these are:

  FILENAME     ISO-L1000.r017

  STYLE        IFC

  DATE         3-3-2014

  TIME         11:45:28

  PRJ_NAME     ROTAT1

  SIZE1        150

  SIZE2        0

  SPECMAIN     MCS150

  LINENUMBER   L1000

  UNIT         U

  SERVICE      S

  NAME         ISO-L1000

  ALIAS        ISO-L1000

  ACTIVE       True

Marked LINENUMBER in upper case, as this attribute will be used in the examples to query the database.

A For MS Access (32bit) Following Query should be added in Textnodes.txt 

mydsn=Driver={Microsoft Access Driver (*.mdb, *.accdb)};Dbq= C:\ProgramData\Bentley\Plant V8i\Bentley Plant V8i Projects\SAMPLE_METRIC\Projdata\projdata.mdb;

00_keytag = DBQUERY ($(mydsn), select keytag from TAG_REG where tag_no='$(LINENUMBER)')

Note: The above project path shown is an example. User need to set their own path as per their project.

The DBQUERY above gets the value of the KEYTAG column in the TAG_REG table from the row where the TAG_NO column equals the value contained in LINENUMBER drawing attribute. The resulting value is stored in a new drawing attribute named 00_KEYTAG.

Please note that $(attrname) is expanded to the value of the drawing attribute attrname. LINENUMBER is a drawing attribute that was already added by the AP interface to OPIM

Similarly we can define query for other attributes like popp_nom, popt_nom, FLUID_FILL as described below.

00_popp_nom = DBQUERY($(mydsn), select popp_nom from process where keytag='$(00_keytag)')

00_popt_nom = DBQUERY($(mydsn), select popt_nom from process where keytag='$(00_keytag)')

00_FLUID_FILL = DBQUERY($(mydsn), select FLUID_FILLING_FACTOR from process where keytag= '$ 00_keytag)')

Refer below image for edit textnodes.txt file.

B For MS Access (64bit) Following Query should be added in Textnodes.txt 

mydsn=Driver={Microsoft Access Driver (*.mdb)};Dbq=C:\ProgramData\Bentley\Plant V8i\Bentley Plant V8i Projects\SAMPLE_METRIC\Projdata\projdata.mdb;

00_keytag = DBQUERY ($(mydsn), select keytag from TAG_REG where tag_no='$(LINENUMBER)')

00_popp_nom = DBQUERY($(mydsn), select popp_nom from process where keytag='$(00_keytag)')

00_popt_nom = DBQUERY($(mydsn), select popt_nom from process where keytag='$(00_keytag)')

00_FLUID_FILL = DBQUERY($(mydsn), select FLUID_FILLING_FACTOR from process where keytag='$ (00_keytag)')

C For SQL database following query should be added in textnodes.txt

mydsn=Driver={SQL Server};Server=SQL Server name;Database=sql databse name;

Uid=user id;Pwd=password;

00_keytag = DBQUERY ($(mydsn), select keytag from TAG_REG where tag_no='$(LINENUMBER)')

00_popp_nom = DBQUERY($(mydsn), select popp_nom from process where keytag='$(00_keytag)')

00_popt_nom = DBQUERY($(mydsn), select popt_nom from process where keytag='$(00_keytag)')

00_FLUID_FILL = DBQUERY($(mydsn), select FLUID_FILLING_FACTOR from process where keytag='$ (00_keytag)')

The isometric result can be viewed using the Show Tag Data tool (first 4 lines)

  

Display Drawing Attributes

 Below are the steps to get the attributes displayed in backing sheet.

  1. To get attributes in backing sheet we have to add drawing attributes in Node2da.txt file. See new attributes added in yellow marked below.

    36, checked

    63,UNIT_NAME

    64,STYLE

    1001,00_KEYTAG

    1002,00_POPP_NOM

  2. Open seed file and go to Isoextractor>text node editor.
  3. Text node editor will show newly added attribute. Right click on text node number and click on place text node and place text node on desired location.



  4. Save the seed file.
  5. Generate isometric to verify the result.

See Also

communities.bentley.com/.../18475.dbquery-usage-logging-debugging

communities.bentley.com/.../17953.db-query-for-multimode-project-environment

Comments or Corrections?

Bentley's Product Advantage  Group requests that you please confine any comments you have on this Wiki entry to this Comments or Corrections?" section. THANK YOU!