How to Get Updated Revision in Isometrics Drawing Using DBQuery


Applies To 
Product(s):OpenPlant Isometrics Manager
Version(s):08.11.09.xxx (SS5) | 08.11.11.xxx (SS6)
Environment:Windows 7/8.1/10 (64 bit)
Area:Settings/Attributes
Subarea:-
Original Author:Rahul Kumar, Bentley Product Advantage Group

To populate updated Revision field in OpenPlant Isometrics Manager

Background

In OpenPlant Isometrics Manager, isometrics output drawing title block contains revision field but it does not get updated. Below steps will aid user to update the Revision using DB Query inside Textnode.txt file present under style folder. As a prerequisite, user should be aware of SQL and able to create new file and must be knowing version compatibility and relevant terms like creating table and assigning datatype etc.Below steps explained on 32 bit machine. 

Steps to Accomplish

  1. Create a new mdb file, say Revision.mdb here & locate the same in working isometric style folder. See below path to store it.

    %\Project root\%WorkSpace\Projects\OPModeler_Metric\DataSet\Isometrics\ Styles\Check\Config
  2. Create a Table as Iso_Revisions.





  3. Go to Design View and create Field Name “FileName” & “Revision” with suitable Datatype selection. See images below.





  4. In Datasheet view, see image below.



  5. Close the file.

  6. To write db query, user need to write the statement inside “textnodes.txt” file which is present under styles folder.

  7. Write query in file as mentioned below:

    # The database DSN

    myDsn = Driver={Microsoft Access Driver (*.mdb)};Dbq=$(IE_CONF)revision.mdb

    # this creates a table in the database and puts a unique index on the filename field
    @a0 = DBQUERY ($(myDsn), Create Table iso_revisions (filename varchar(255), revision int))
    @a1 = DBQUERY ($(myDsn), Create UNIQUE index index1 on iso_revisions (filename))

    # This inserts a row for the filename if not yet there and initializes the revision to 1
    @a2 = DBQUERY ($(myDsn), Insert into iso_revisions (filename, revision) VALUES ('$(NAME)', 1))

    # this gets the current revision number for the table
    @Rev =  DBQUERY ($(myDsn), Select revision from iso_revisions where filename = '$(NAME)')

    # this increments the revision table number (for the next time)
    @a3 = DBQUERY ($(myDsn), Update iso_revisions set revision = $(rev)+1 where filename = '$(NAME)')

    REV_MAIN=$(Rev)

  8. This will look like below image.



  9. Save & Close the file.

  10. Launch OpenPlant Isometrics Manager.

  11. Select correct style where files has been stored to get the changes.

  12. Generate Isometrics and verify results. 



  13. Also check “Show Drawing Tag” dialog, where REV_MAIN listed.



  14. In MDB file user can check all the list of iso drawing with incremented revisions going to populate in isometrics. See image below.

See Also

communities.bentley.com/.../adding-data-from-the-process-table-to-isometric-backing-sheet-drawing-frame-seed-file  

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

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!