Applies To Product(s): ProjectWise, AutoPLANT Piping Version(s): 08.11.07.XX Environment: N/A Area: N/A Subarea: N/A Original Author: Richard DeLong, Bentley Product Advantage Group Overview This TechNote is to help in adding custom components into the Component Indexing so that they can be viewed in ProjectWise Explorer. It should not be performed by anyone who is not an Administrator of the Project/ProjectWise and a DBA. Also, be sure to back up all databases and files before proceeding with this. Note that this is a customization and is a very basic guide and for more advanced methods please go through our services group. Below is a break down of what is covered in this TechNote - Adding a custom field into AutoPLANT Catalogs/Specs Project Database Adding the custom field to a View Adding the custom field to ProjectWise Class Editor Results Things to keep in mind Adding a Custom Field into AutoPLANT In order to be able to add a field into the Component Indexing, it helps if we create a custom field to work with. Not only does this field need to be added into the AutoPLANT Database, but it will also need to be added into the Catalogs database, which will in turn bring it into the Specs. We will first cover how to add this field to the Catalogs and then how to add it into the AutoPLANT project database. Adding to Catalogs/Specs In this example, I created a custom value called TEMP for my Valves. I added this value through Catalog Editor by editing the Catalog Schema and adding the column to the VALVE table. This can be done by going to 'Edit>Edit Database Schema…', like below - The values for this field are shown below - To add this field, just press the 'New Field' button on the right. This will bring up a dialog to add in the needed values. After the field is added, the value of "45 degrees F" is placed into the catalog's field to give a value we can look for when testing the Component Indexing. To get this field and value into the specs, just build the specs. Adding it in the database After the value has been added into the Catalog/Specs, the value needs to be placed into the project's database. Since this is a piping component, it needs to be inserted into the PIPING table. One thing to keep in mind is that the Length and Data Type have to match what was used in the Catalog/Spec. In SQL, this can be done by locating the table, right clicking on it and selecting 'Modify' - If you are using SQL, adding the field can be a bit tricky because the type may not match up exactly. In the Catalog, it says that the type is Text, but it needs to be varchar with a size of 20. If the text data type is selected, the size will be grayed out. Adding the field to the View To add the value to the view, the first thing needed is to know what view is being used by the component. The view in this case is called PW_AT_HVALVE, which is found in the ProjectWise Datasource’s Database, and can be modified by right-clicking on the view and selecting Modify. Locate the table that table that points to the table that the value was added to, in this case PIPING, which is using the Alias 'P'. Once the table is located, just check the box next to the value to include it in the view to be displayed. With this done, save the changes and run the view to see if it includes the custom column in it. Adding the Field to ProjectWise Class Editor Now that the View and the field are all setup, we can pull the field through to ProjectWise's Class Editor. Open the ProjectWise Class Editor which is usually located under the Administrative Tools in the ProjectWise folder. When it is first loaded up, it will request that you log into the project. After this is done, it will load up all the data that it currently has about that datasource. From here, there are a few things that need to be done. First, the new field has to be added into the Attributes section. Then the value needs to be added to Classes, under the Component section in the correct Component. To add the value into the Attributes section, just right click on the Attributes folder, or on any of the attributes, and select 'Add Attribute…' This will load the 'Create Attribute' dialog box - Give the Attribute a name, for this example, the name is AT_HVALVE_TEMP (the AT is an AutoPLANT variable that is needed, HVALVE is telling the system what component the value belongs to.) The next to fields are optional but can allow for the display of the value to be more easily understood. I set both values to Temp. Look at some examples in the Class Editor to get an idea of what can be done with these two fields. Once these are set, hit Next to go to how the attribute will be created, with either a DB-Table or a Linkage. With AutoPLANT values, you can simple use the DB-Table and hit Next to display the section the defines the column. Here, just set the values to match what was done in the other columns, but in this case, we will be using String for the Data Type. The 'Display Attributes' decide how ProjectWise will handle this value. To have it displayed, the value needs to be set to either 'Read Only' or 'Visible' (which allows for users to modify the value through PW Explorer). Here is same dialog with all the needed information - The last dialog is just for review and the process is completed by pressing the Finish button. After it is completed, the Attribute will be displayed and some of the values can be modified, such as the Visibility as shown below (notice that it is now set to Visible). Now that the Attribute has been added, the next step is to go into the Classes>Component>AT_HVALVE section to add the value into it so that it appears in PW Explorer. You will also need to hit the Save button at the top left, or if you navigate to a new page, the program will ask if you wish to save, make sure to accept it. There is a number of things that can be changed here, but we will focus on adding the Attribute. To begin this process, the green plus symbol needs to be pressed - This will begin the attention down to the bottom of the Attributes list and display a pull down - Clicking this pull down will display all the Attributes listed in the datasource. Just select the AT_HVALVE_TEMP to add it. Press the Save button at the top left once this is done to save this change to the datasource. Seeing the Results Load up the datasource in ProjectWise Explorer. Once it is loaded, make sure that there is a component in one of the models that has this new field. If there isn't, either create a new model or open an existing on and place the component into it, save it and check the model back in. Once a component is in place into the project, go to the Component Indexing section and navigate to the Component in the tree. In this case, the component is under the following patch, 'Components>Plant Components>Piping>Hand Valves'. Selecting the component, in this case the BV-101, will display the information in the top panel - Things to keep in mind In some cases uses may forget to do either the View in the database or add the value into the Class Editor. If the View is left out but the Attribute is added, then the Component Indexing will not display any of the components under it's tree. It will appear without the plus next to it, like this - To fix this, just add the view or make the needed changes to the view in the database. If the view is setup but the Attributes is not done in the Class Editor, then all that will happen is the value will not be displayed in PW Explorer. Also, keep in mind that the display of the Attributes does not need to be the same name as the value. For example, here the RATING from the first example has been changed to Operating Pressure and the other Operating Pressure and Pressure Class has been removed. See Also External Links Bentley Technical Support KnowledgeBase Bentley LEARN Server 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!
↧