Upload
jimalt67
View
15
Download
3
Embed Size (px)
Citation preview
Plant 4D Athena SP2
C u s t o m i z a t i o n M a n u a l ( B a s i c )
Version 1.2
© Copyright 1996-2007 CEA Technology B.V., The Netherlands
Table of contents
1. Introduction.......................................................................................21.1. Legal notice ......................................................................................................... 21.2. About Plant-4D .................................................................................................... 2
2. Customization...................................................................................42.1. How to Customize Plant-4D .................................................................................42.2. Customization and program updates .................................................................... 52.3. Creating a new project .........................................................................................52.4. Creating new specification and component databases.......................................... 52.5. Overriding the layer setting for specific components ............................................. 62.6. Setting the standard text style in AutoCAD ...........................................................72.7. Customizing default drawing settings.................................................................... 7
2.7.1. Editing the Settings table directly ...............................................................................82.7.2. Editing entries with the Settings form .........................................................................9
2.8. Customizing Tag definition ...................................................................................92.8.1. Setup Tag definition ..................................................................................................92.8.2. Alternative tagnumber separators ............................................................................112.8.3. Showing existing values ..........................................................................................122.8.4. Pull down tag fields .................................................................................................132.8.5. Customize Tag annotation.......................................................................................14
2.9. Modifying Data dialogs....................................................................................... 182.10. Using additional solodata and commondata fields........................................... 202.11. A note about groupIDs.................................................................................... 21
2.11.1. Color, layer and linetype definitions.........................................................................21
3. P&ID Customizing ..........................................................................243.1. Process and instrument lines ............................................................................. 24
3.1.1. Grouping process and instrument lines ....................................................................253.1.2. Adding a new line type and creating your Process Lines list .....................................253.1.4. Default data values of lines......................................................................................27
3.2. Adding your own P&ID components ................................................................... 273.2.1. Components created from scratch ...........................................................................283.2.4. Own components created from existing CAD drawings.............................................293.2.5. Adding components to a Specification .....................................................................293.2.6. Placement of new Components without menus ........................................................303.2.9. Making bitmaps for menus ......................................................................................313.2.10. Adding commands to menus ..................................................................................32
3.3. Placement command summary .......................................................................... 353.4. Setting your Customized Project as your source database ................................. 38
4. PIPE customization ........................................................................39
Plant 4D Athena SP2 ê Customization Manual (Basic)
1 Introduction ê Legal notice Page 2 of 41
1. Introduction
1.1. Legal noticeThis publication or parts thereof, may not be reproduced in any form, by any method, for any purpose
without the express written consent of CEA Technology.
CEA Technology makes no warranty of any kind with regard to this material, including, but not limited to,
the implied warranties of merchantability and fitness for a particular purpose.
CEA Technology, or any of its subsidiaries, shall not be liable for errors contained herein or for incidental
or consequential damages in connection with the furnishing, performance, or use of this material.
The information contained in this document is subject to change without notice. The name Plant-4D® is a
registered trademark of CEA Technology B.V., The Netherlands.
If you have any questions during the installation or operation, please contact your local Plant-4D dealer or
visit the CEA website for more information:
© Copyright 1996-2007 CEA Technology B.V., The Netherlands
1.2. About Plant-4DPlant-4D is a modern database-driven and object-oriented CAD system intended for the production of
P&ID and Piping drawings as well as the complete maintenance of the data related to all aspects of the
project work.
Database-driven means that both all graphics and primitives as well as data are stored in a relational
database (RDBMS). This approach has the following advantages:
¡ The program can be run on a network by a group of engineers, or a single user can work with it on a
stand-alone machine.
¡ The program can run simultaneously on AutoCAD and Microstation. Part of the drawing can be made
in Microstation, be revised in AutoCAD by another party, the drawing can be finished in Microstation,
and be delivered to the customer as an AutoCAD drawing, for instance. The CAD program is only
used to display the drawings, to serve as an interface where the drafting occurs, and to enter the
data through data entry windows. In other words, Plant-4D is CAD platform independent.¡ The drawing can be completely created or reworked by manipulating the data in the database.
¡ Interfaces to simulation programs, such as ChemCAD exist.
¡ Interfaces to instrumentation systems such as INtools exist.
¡ Translation tools to import existing CAD drawings from non-database systems exist.
¡ Interfaces to other database-driven CAD systems are feasible.
¡ Interfaces to Plant Management systems are feasible.
¡ Reporting is highly customizable through a variety of database reporting tools.
¡ Object oriented means that the elements used for drawing (for instance symbols or lines) are stored
in the database as objects:
Plant 4D Athena SP2 ê Customization Manual (Basic)
1 Introduction ê About Plant-4D Page 3 of 41
Creating your own symbols is extremely easy, and can be done from the CAD program or at the
database level
There is no graphical storage. A large drawing or a model doesn’t need to be saved, as every
object is saved to the database at the moment it is inserted in CAD. Any possible crash of
Windows or lack of power supply will not affect the work done so far.
Objects can inherit properties. For instance, a control valve can inherit process and mechanical
data from the pipe it is located on. This means that less work is needed to complete all
necessary data.
The object-oriented concept makes it easy to transfer the data and do the reporting.The Plant-
4D Componentbuilder
Plant 4D Athena SP2 ê Customization Manual (Basic)
2 Customization ê How to Customize Plant-4D Page 4 of 41
2. Customization
There are several possibilities to customize Plant4D. These can be for decorative reasons but also to add
functionality. The methods used for this can range from fairly complex, requiring specialized knowledge, to
simple where general knowledge of how to use computers and Plant4D is enough.
Many of the possibilities will be discussed in this document. It is largely set up as a hands-on learning
experience so most subjects are discussed through examples and exercises.
The exercises will be done in an Access environment but it’s also possible to do all this in one of the other
databases supported by Plant4D.
2.1. How to Customize Plant-4D There are several different methods for customizing Plant4D:
¡ By editing the project database indirectly using programs which are supplied with Plant4D. For
instance the dialog editor.
¡ By editing the project database directly with a database manager program. Plant4D has the Access
based datamanager for this purpose.
¡ By editing Plant4D configuration files.
¡ By editing CAD configuration files.
Changes to the project database are largely independent of the software using it. So, if you make changes
for the CAD application (like in the dialogs) these will be available for both Autocad and Microstation. In
some cases it will be necessary to change some settings to make use of the changes.
This type of customization is system wide, and any changes made to the project database will be
immediately available to all users of Plant-4D using that database. A refresh may be needed in the CAD
programs to see the changes.
Modifications made to a project database will only affect the current project. To make sure customizations
are included in all subsequent projects, they should be made to the project databases which are used as
templates. In the standard set-up this is ‘Prj_prot’ but it is always possible to use another project or several
projects for this. You can for instance use one template per client.
Changes to configuration files may be CAD platform dependent. The CAD menu files are for instance
platform dependent while most of the ini files are not. The ini files are installed on the client computers and
therefore only available locally. So customized configuration files will have to be copied to each client
computer.
Plant 4D Athena SP2 ê Customization Manual (Basic)
2 Customization ê Customization and program updates Page 5 of 41
2.2. Customization and program updates The many possibilities to customize Plant4D gives a lot of freedom to users to adapt it to their wishes but
this also has the consequence that there is no guarantee that future versions of Plant4D will work as
expected.
If you customize Plant4D you should create a detailed record of the changes you made. After you update
Plant4D you should check if all added functionality still works. And you should also check if all new
functionalities from the new Plant4D version are present. Many customizable files are “protected” but some
will be overwritten or ignored.
If some customizations do not work any more it’s best to copy the modified sections to the new Plant4D
files. These new files may have new entries, corrections and other modifications which would be lost if you
simply copy the old files into the new installation.
2.3. Creating a new projectFor the exercises in this guide you should create a new project, named Customization Project. This
project should have access to the MYCOMPPID component database and the Specification table
PID_TOTAL#PID of the MYSPEC specification table. For details on creating a new project: see the Plant-
4D manual.
Note: The project has the default database name of ‘Prj_ID’, where ‘ID’ is the value given by the database. If the project you created has an ID: 18 then the project database name will be Prj_18. When using Access the database file is located in:
1 \\Plant-4D\Projects\Prj_18 \18.mdb
The subdirectory ‘Prj_18’ is automatically created. The projectname as it appears in 4D explorer will be
what was entered in the field description of the PCE database record for this project.
Select the Customization Project from the 4D explorer Projects list, and create a new P&ID drawing
named Test drawing.
2.4. Creating new specification and component databasesAll these databases should have the same database structure as the original ones. The best way to
ensure this is by copying the original databases and modifying the copies. To do this:
2.4.1. Step 1: Copy project database
¡ In Access:
Copy the specification and component databases which you find in \CEA\Projects. For these
exercise we need ‘Spec.mdb’ and ‘COMPPID.mdb’.
For the exercise you can the copy of ‘Spec.mdb’ to ‘Myspec.mdb’.
And rename the copy of ‘COMPPID.mdb’ to ‘MYCOMPPID.mdb’.
¡ IN SQL server and Oracle:
Copy these databases following the standard procedure for these database types.
Rename the copy the ‘Spec’ database to ‘Myspec’.
Plant 4D Athena SP2 ê Customization Manual (Basic)
2 Customization ê Overriding the layer setting for specific components Page 6 of 41
Rename the copy of ‘COMPPID’ to ‘MYCOMPPID’.
2.4.2. Step 2: Add them to the PCE database. This can be done manually but also through the Plant-4D explorer:
¡ Through the explorer:
Open the ‘system administration’ tab of 4D explorer and the databases tree.
Right click specifications and click new database.
Enter the name of the new database.
Do the same for the component database.
¡ Manually:
Open the PCE database and open the table databases.
Create a new record by copying the record of an existing specification entry and modify this. For
example:
Check if you can access both databases from the 4D explorer.
Note: the name of the new databases should never contain any spaces. Underscores are allowed.
2.5. Overriding the layer setting for specific componentsComponents are placed on layers depending on the value of the field Componentcode2 in the
specification table:
¡ Empty: the component is placed on the layer with the same Plant-4D layer number as their groupID
or layer 0 if this layer does not exist.
¡ Layernumber: the component is placed on the layer indicated in this field.
The layer information is stored in the Components table of the project database.
DATABASE ID
RIGHTGROUP ID DBNAME DB GROUP DESCRIPTION DIRECTORY
18 1 MySPEC SPEC Specification database %PROJDIR%
DBTYPE DBLOCATION CONNECTIONSTRING STATUS
ACCESS %PROJDIR% DRIVER={Microsoft Access Driver (*.mdb)};DBQ=[DBLOCATION]\[DBNAME].mdb 1
Plant 4D Athena SP2 ê Customization Manual (Basic)
2 Customization ê Setting the standard text style in AutoCAD Page 7 of 41
1. Example. We will set a DIN valve so it’s place on layer 10.
2. Select DIN_Total as the specification table for the project.
3. Open a drawing and place a Valve.
4. Check the data using . The screen shows that the component is on layer 1 since this valve has a
groupID number 1.
5.6. Open the specification database and open the PID_TOTAL#PID table. Look for the record for the
component ABSPALLG and find the field ComponentCode2.
COMPONENTINDEX
COMPONENTDESCRIPTION
SHORTCOMPONENTDESCRIPTION
GROUPIDCOMPONENTCODE2
ABSPALLG -------------------------------------------------
Absperrarmatur allgemein Absperrarmatur 1
7. Enter ‘10’ in the field ComponentCode2 and close the specification database.
8. Place a new valve of the same type and check the data again.
9.
The new component was placed automatically on layer 10.
Note: previously placed components remain on the layer they were originally placed on.
2.6. Setting the standard text style in AutoCADThis can be set for the PIPE and P&ID module through the file Plant-4D.dwt. Check in the acad\pid\bin or
acad\pip\bin directory if it’s available. If not, create a new drawing from Plant-4D and save it as a ‘Drawing
template (*.dwt)’.
Do note: multiple text styles are not possible.
2.7. Customizing default drawing settingsThese settings are found in the project table Settings which contains values for lines, tagnumbers,
drawings settings, etc. You can edit these in the Plant-4D Access database in two ways:
¡ Directly
Find the appropriate rows in the Settings table of the project database and modify the settings
there.
¡ Access form
Plant 4D Athena SP2 ê Customization Manual (Basic)
2 Customization ê Customizing default drawing settings Page 8 of 41
This form appears when starting the database manager and connects to the appropriate table in
the project database. The form makes filtering and editing rows easier for less inexperienced
Access users.
Whichever method is used, the user must know what to look for and where to look in the database. The
Settings table has four fields:
¡ Root: indicates to what program part or function the record belong. For instance PID, PIPE and Tag.
¡ Section: the subgroup of related records a record belongs to.
¡ KeyName: the name of the setting.
¡ Value: the value of the setting.
2.7.1. Editing the Settings table directly
1. Right click a project in the 4D-Explorer projects tab and click open datamanager. MS Access will
open the project database and start with the Data Manager screen.
2. Minimize the Data Manager screen, select the Tables tab and open the Settings table.
3. Filter the records to see all those related to P&ID drawings. You can use Filter by Selection for
this.
To filter on a field, for instance PID, place the cursor in a Root field which has the value PID and
double click with the Left-hand mouse button. When the field is highlighted select the filter
button. Do this also for the Section 'Drawing' as an additional filter.
sdsdfsdfsdfsdfsdf
Root Section KeyName Value
PID DRAWING Diameters
15mm, 20mm, 25mm, 32mm,
40mm, 50mm, 65mm,80mm,
90mm,100mm,125mm,150mm,
200mm,250mm,300mm,350mm,
400mm,450mm,500mm,550mm,
600mm
PID DRAWING ReducedDiameter 15mm
PID DRAWING Diameter 40mm
PID DRAWING ReferenceLevel 50
PID DRAWING NewWindowTitle Plant-4D [DRAWINGNAME] - MicroStation 95/SE
PID DRAWING p4dUnitPerMaster 1
PID DRAWING LTSCALE 1.000000
PID DRAWING LIMMAX 420.000000,297.000000
PID DRAWING LIMMIN 0.000000,0.000000
PID DRAWING SNAPUNIT 5.00000,5.00000
PID DRAWING ORTHOMODE ON
PID DRAWING SNAPMODE ON
PID DRAWING GRIDUNIT 10.000000,10.000000 Keynames:
LTSCALE, LIMMAX, LIMMIN, SNAPUNIT, ORTHOMODE, SNAPMODE, and GRIDUNIT all
refer to AutoCAD settings commands.
NewWindowTitle, ReferenceLevel, and p4dUnitPermaster refer to MicroStation settings.
4. Edit the values where needed. Click on another record to make sure the new values have been
entered.
Plant 4D Athena SP2 ê Customization Manual (Basic)
2 Customization ê Customizing Tag definition Page 9 of 41
5. Exit Access, you do not need to save the changes to the design of the table.
For the new settings to be implemented, exit and restart Plant-4D
Note: make sure that the CAD program is not running while you are doing this since several setting are
(re)set by it when closing a drawing.
2.7.2. Editing entries with the Settings form
1. Open the database as before
2. Click the Settings button on the Plant-4D Data Manager menu.
3. Select main group (root): PID, sub group (section): DRAWING. The filter will automatically be
done:
4. Edit the values where needed.
5. Exit Access. You don’t need to save the changes to the design of the table.
6. For the new settings to be implemented exit Plant-4D and restart the program.
Note: make sure that the CAD program is not running while you are doing this since several setting are (re)set by it when closing a drawing.
2.8. Customizing Tag definitionTagnumbers are often modified by users since every company has its own numbering methods. Up to six
tag fields can be used to form a tagnumber.
2.8.1. Setup Tag definitionThe tag definitions are set per groupID and stored in the Settings table of the project database. This is an
extract:
ROOT SECTION KEYNAME VALUE
TAG COMP_024 List Tag_Trim,Tag_N1
TAG COMP_024 Required N
TAG COMP_024 TagType Trim Tag
TAG COMP_024 Unique Y
TAG COMP_DEF List Tag_Def,Tag_N2
TAG COMP_DEF Required N
TAG COMP_DEF TagType Default tag
Plant 4D Athena SP2 ê Customization Manual (Basic)
2 Customization ê Customizing Tag definition Page 10 of 41
TAG COMP_DEF Unique Y
TAG Pump Length 5
TAG Pump Name Type
TAG Pump Type S
TAG Pump Value PThis table shows 2 types of tag settings. Those with a section name starting with COMP set the structure
of a TagNumber while the others hold individual TagNumber field settings. The number behind COMPrefers to the groupID the tagnumber definition belongs to.
The COMP_024 rows are for the component with groupID 24. If there is no tag definition for a specific
groupID then COMP_DEF will be used. The Pump records are used as definition for the tag field with that
name.
The best way to set a tag for a certain component type/groupID is through the settings editor of the Plant-
4D Data Manager. For example:
1. Click the Setting button from the Plant-4D Data Manager main menu.
2. Set the main group (root) combo box to TAG.
3. Enter COMP_002 (which is the group id for pumps) in the Sub group (Section) edit box.
4. Each tag structure setting must have the following four keys:
a) Unique (Y/N): specifies whether the Tag should be unique. If this is set the virtual tag function
and the checking of tagnumbers for uniqueness is active. This setting should not be changed
during a project since this can cause problems with other (virtual) tagnumbers.
b) Required (Y/N): is not used any more by the program.
c) TagType: the label shown in the tag dialog (Type and Number in the example).
Plant 4D Athena SP2 ê Customization Manual (Basic)
2 Customization ê Customizing Tag definition Page 11 of 41
d) List: the actual structure of the tagnumber. It can contain up to six tag fields (comma
separated). In the example the tag consists of two sections Pump and Tag_N1. This means
that the tagdialog will show two fields which show the data in SoloData fields TAG1 and TAG2.
Pump and Tag_N1 refer to tag field definitions.
Note: tagnumbers containing numerical field will be automatically numbered. Prior to Athena SP2 only the
rightmost field was used for this while from Athena SP2 on the rightmost numerical field is used. This will
be set to such a value that it’s one higher than the highest value found in similar tagnumbers. So if a
tagnumber is P-01(loc)/0067-AA the next number will be P-01(loc)/0068-AA.
The tag field setting sections definitions are also accessible through the datamanager settings editor. Enter
the name of the tag field in ‘Sub group’. In this case ‘Pump’.
For tag field Tag_N1 this is:
Name: fieldname and the label that will be shown for the relevant tag part in the tag dialog.
¡ Type: specifies whether the field is a number or a string (N/S). Number fields will show a 0 value if
left empty. At least one tagnumber field is needed when tag numbers are set automatically.
¡ Length: length of the field in characters. If the type is numerical then zeros will be appended until the
given length is reached (example: 0041). From Athena SP2 on you can also set the length to zero.
No zeros will then be appended.
¡ Value: for a string field this is the default value which is entered in the field and for a numerical field
this is the increment value with which each field value is increased.
2.8.2. Alternative tagnumber separatorsThe field SoloData.TagNumber is generated by Plant-4D through concatenating the TAG1 to TAG6 fields
and separating them by a symbol. Its value is used by Plant-4D to check if there are already other
components with the same tagnumber. It’s also used to display in both the data- and tagnumber dialogs as
well as the standard tagnumber annotation.
The tagnumber layout is defined in the record with the Keyname List. For instance:
ROOT SECTION KEYNAME VALUE
Plant 4D Athena SP2 ê Customization Manual (Basic)
2 Customization ê Customizing Tag definition Page 12 of 41
TAG COMP_001 List Area1,Tag_HV,Tag_N1
TAG COMP_001 Required N
TAG COMP_001 TagType Valve Tag
TAG COMP_001 Unique YIn this example the tagnumber sections will be separated by dashes, for instance '1-HV-0028'.
Not all users have dashes in their tagumbers so from Athena SP2 onwards it’s possible to use alternative
separators which can be symbols, texts or even be left empty. This is done by adding brackets with the
desired separator in them between the sections. For instance:
ROOT SECTION KEYNAME VALUE
TAG COMP_001 List Area1,[\],Tag_HV,[*],Tag_N1 The list above would result in <TAG1>\<TAG2>*<TAG3>, for instance ‘1\HV*0028’. The list
Area1,[],Tag_HV,[_],Tag_N1 results in ‘1HV_0028’.
Both the pre- and post SP2 methods can be used on individual TAG number definitions. The two methods
should not be mixed within the same tagnumber though. I.e. something like Area1,Tag_HV,[_],Tag_N1
should not be used.
2.8.3. Showing existing valuesTagnumber fields can be set to show a pull down menu which contains all values that have already been
used for components with the same groupID. This can be useful when entering tagnumbers where
sections are common for all tagnumbers.
All you need to do for this option is to set the record with the keyname Editor to ‘C’.
ROOT SECTION KEYNAME VALUE
TAG Tag_N1 Editor C
TAG Tag_N1 Type N
TAG Tag_N1 Length 4
TAG Tag_N1 Name Number
TAG Tag_N1 Filter Y
TAG Tag_N1 Value 1The default behavior is to fill the list with all previously used values for the specified TagNumber field
(filtered using the GroupID).
The default setting is an Editbox. If the Keyname record exists you can enter ‘E’ of this instead of ‘C’ If this
record is unavailable the routine should default to an EditBox.
Plant 4D Athena SP2 ê Customization Manual (Basic)
2 Customization ê Customizing Tag definition Page 13 of 41
2.8.4. Pull down tag fields From Athena SP2 on it’s also possible to include pull down fields with set values. For instance:
This is set using two optional records in the tagfield definition.
SETTINGS
ROOT SECTION KEYNAME VALUE
TAG Tag_HV Editor C
TAG Tag_HV Filter Y
TAG Tag_HV Length 5
TAG Tag_HV List @MyTable.Value
TAG Tag_HV Name Type
TAG Tag_HV Type S
TAG Tag_HV Value HV
1. Editor: should be set to ‘C’ for combobox.
2. List: This overrides the default ComboBox behavior and fills it with a list. There are two possible
sources:
e) Comma separated list. These should start with ‘#’. In the example above this would be:
‘#HV,CV,SPV,Other’.
f) @TableName.ColumnName refers to another table for its values. In the example above this is
the column Value of the table Mytable.
MyTable
ID Value
1 HV
2 CV
3 SPV
4 OtherNote: in both cases you have to make sure the values do not exceed the maximal length of the tag field
(10). It will appear in the pull-down list but when selected it will cause problems when written to the
individual TAG fields.
The values in the list will be ordered in alphanumeric order. In a future version of Plant4D it will be possible
to set a specific order though by using a table reference syntax like ‘@Table.Valuecolumn.Sortingcolumn’.
For instance ‘@MyTable,Value,ID’. This will make the list appear in the same order as listed in the table
MyTable.
Warning: Tagnumber are defined for a whole project. For that reason we do not recommend changing tag definitions in the middle of a project. This could change the appearance of previously made drawings. We recommend the customization takes place before adding any objects to the project.
Plant 4D Athena SP2 ê Customization Manual (Basic)
2 Customization ê Customizing Tag definition Page 14 of 41
2.8.5. Customize Tag annotationThe most important occurrence/presentation of the tag format is the annotation, because these are shown
in the drawings. These should meet company requirements and standards.
In the following example we will create a custom annotation. You start by creating a new annotation
component:
1. Start an AutoCAD drawing from the 4D-Explorer.
2. Add a text to this drawing using the standard AutoCAD text command. Use any text you like as long
as the appearance is what you need for the tagnumber.
3. Select this text and create a new P4D component by selecting Write Component from the Plant-4D
pull down menu.
4. Give the new component a name. For example ‘MYTAG’.
5. Select point of origin for the component. This is usually the left lower corner (similar to the original
insertion point of the text). It is advisable to use a common point as origin to prevent mistakes when
using/positioning your component.
Next you have to append this component to a specification:
6. Open the specification database.
7. Open the table corresponding with the specification you will append it to (e.g. PID_NEW#PID). Note
that you have to add the entry to a specification table of the corresponding component type (i.e. PID
or PIPE). Although an annotation is just a single text, every component is designed either for PID or
PIPE and it has to be present in the specification used in the drawing.
8. Add a new record to the specification. The easiest method is to copy an existing annotation record
and modify it. Make sure you specify a new (unique) name in the ComponentIndex-field and refer to
your new component in the ComponentName-field.
Now you can change the text value to a reference to database fields. You can do this either by editing the
database entries directly in the database or the component builder function from the CAD application.
Direct database editing:
9. Open the appropriate database (MYCOMPPID). This should be done through the Access interface
so you get the special forms. Open the database through the 4D explorer ‘administration tab’.
Plant 4D Athena SP2 ê Customization Manual (Basic)
2 Customization ê Customizing Tag definition Page 15 of 41
10. You will then get the ‘CompInput’ form. Search for the newly created component ‘MyTAB’ using the
search function (select the Name-field and press ‘CTRL+F’). Make sure the Match field is set to ‘Any
part of field’.
11. This component will only have a text as a primitive, so the component will only have one record.
Click the ‘…’-button behind the string-parameter to open the ‘build’ form.
12. Now you can enter the format of you tags as you like, using static texts and the list of available
Plant-4D data fields. Use for example the format as shown above.
Plant 4D Athena SP2 ê Customization Manual (Basic)
2 Customization ê Customizing Tag definition Page 16 of 41
13. Click OK to apply changes.
14. Close the ‘CompInput Form’ and close the component-database.
Another approach for editing the new component is by editing it from your AutoCAD environment:
15. Start a Plant-4D drawing or use an existing open drawing. Note that you open a 2D drawing in case
of PID annotation and a 3D model in case of a PIPE-annotation. For the exercise this is the PID
annotation.
16. Insert your new component by using the by using the Plant4D/AutoCAD command:
‘PL_P4D_ANNOTATION’ or use the menu if this has already been defined. You can enter the name
of the component as you named it in your specification (not the name of the Plant-4D component).
17. Select the Component Builder from the tool menu of the Plant-4D menu-bar and select the
annotation component.
18. This will open the Component builder screen and show the settings for this component.
Plant 4D Athena SP2 ê Customization Manual (Basic)
2 Customization ê Customizing Tag definition Page 17 of 41
19. Open the text record of the component.
20. Select the String-parameter and edit the text of this parameter by clicking the right mouse button.
Choose ‘Edit’ from the popup menu.
21. Now you can edit the tag format as you want in the Formula editor.
22. Enter the formula as shown above. Click OK to apply changes.
23. Close the Component Builder.24. Click on the Redraw button to update the existing tag.
Test the annotation by placing the component and linking it to a line.
Like it is discussed in the section ‘Adding commands to menus ‘, you can add this command to any Plant-
4D toolbar or menu to provide this annotation-function in a more user friendly way.
Note that by this you have only modified the presentation of this annotation in drawings. It should also be
modified in the 4D explorer and PIPE if this tagnumber presentation is to appear in these.
Also note that you are making these changes in the component database which means that it’s changed
for any project using this particular component database. So, while it’s safe to add new components, you
should be careful to modify existing ones as this can lead to undesired effects in existing drawings.
Plant 4D Athena SP2 ê Customization Manual (Basic)
2 Customization ê Modifying Data dialogs Page 18 of 41
2.9. Modifying Data dialogs It is of little use to make new fields in your database if you cannot access them from Plant-4D. However
there is a handy utility called the Plant-4D Dialog editor which you can use to modify and create data
dialogs.
1. Go to the ‘System Administration’ tab and right click the project in which you changed the SoloData
in the previous section. Select ‘Miscellaneous’ and click ‘Edit dialogs’: This starts the dialog editor.
2. Select LINE_DEF and click Edit.
3. Click the left mouse button once in the gray space between the ‘OK’ and ‘Cancel’ buttons and you
will see the ‘Edit Dialog’ dialog box. This can be used to change the size of the dialog form and the
number of columns and rows on it. The text in the field Caption will be displayed on the datadialog
form.
4. Click the ‘New Item’ button to open the ‘Change Layout’ form.
Plant 4D Athena SP2 ê Customization Manual (Basic)
2 Customization ê Modifying Data dialogs Page 19 of 41
5. Enter the data as shown below and click OK. This will create both a new tab and a new field.
a) TabSheet: enter the name of a new tabsheet or reuse an existing tab by entering an existing
name.
b) Object Type: type of dialog box.
c) Row and Column: position of the dialog field in the form.
d) Width and Height: determine over how many rows and columns the object will span.
e) Caption: the title of the dialog field.
f) Hint: tooltip that will be displayed when you move the mouse cursor over the object.
g) Table.Field: this refers to CommonData or SoloData when a valid field name is entered.
h) SQL: enables you to enter lists of values for ComboBoxes and ListBoxes. Such definitions must
begin with # and the values need to be separated by commas. It’s also possible to use SQL
commands to refer to other tables.
i) Infolevel: user access rights required to access this part of the dialog. The value 6 is used for
reference fields like the tagnumber since no user can access it.
6. Click the new ‘Process Data’ tab. You will see the new field ‘Dens’.
Plant 4D Athena SP2 ê Customization Manual (Basic)
2 Customization ê Using additional solodata and commondata fields Page 20 of 41
7. Repeat actions 4 and 5, entering the following data (use CEXTA2 if the field Dens_u has not yet
been created):
8. Click OK and observe the change in the dialog preview.
9. Click OK. Close the Edit dialog program by closing its window with . The 4D EXPLORER
Selection Menu reappears.
Now you can go to the drawing and see how the changes made to the process line dialog look in reality.
1. Open a drawing.
2. Draw a process line. Use Edit Data to view the dialog. Add data if in the new fields to check the
functionality.
3. Exit CAD program.
Note. Diameter lists in the dialogs SQL field should have ‘#’ in front of it. The setting table also contains lists of diameters which will also have to be adapted in such cases but these have no ‘#’ in front of them.
2.10. Using additional solodata and commondata fieldsSolodata and commondata have several predefined fields, like manufacturer and commodity, which can be
used to register additional data on components. But it’s always possible that you need a field which does
not yet exist. In that case you can choose to use a predefined field which is not used for anything else but
you can also use fields which have been specially created for this:
¡ Solodata:
Extn… for numeric values
Exta… for alphanumeric values
¡ Commondata:
Cextn… for numeric values
Cexta… for alphanumeric values
These fields can be used in the same ways as any other field.
Plant 4D Athena SP2 ê Customization Manual (Basic)
2 Customization ê A note about groupIDs Page 21 of 41
2.11. A note about groupIDsAs you have seen the groupIDs are important for the settings of tagnumbers and datadialogs. They are
also used for other purposes like filtering components for the purpose of display in 4Dexplorer and reports.
Because of that reason the definitions are spread throughout Plant4D which makes creating new groupIDs
risky without a proper knowledge of the mechanics of the Plant4D program. It’s best to store new
components in existing groups whenever possible.
2.11.1. Color, layer and linetype definitions
2.11.2. MicroStation
Color, Level, Style, and Weight keys relate directly to MicroStation definitions.
Line styles are created with the line style library of MicroStation. This function is described in the
MicroStation Administrator Guide
2.11.3. AutoCAD
The Weight key defines the line thickness. The specified value is based on the units (metric or inches) set
and used in the CAD-system.
Color, Level and Style are all mapped to AutoCAD definitions through configuration text files. Changes to
these text files (described later) take effect the moment the CAD interface is started through the 4D
explorer.
Plant-4D color numbers are mapped onto AutoCAD colors using the file CEA\Plant-4D\ACAD\PID\BIN\COLOR.DAT. You can redefine color mappings when necessary. The format of
COLOR.DAT file is:
PLANT-4D_COLOR,AUTOCAD_COLOR
Logical color AutoCAD color number (ACI) Actual color
0 7 white/black
1 5 blue
2 3 green
3 1 red
4 2 yellow
5 6 magenta
6 2 yellow
7 4 cyan
8 7 white/black
9 9 light gray
10 1 red
11 3 green
12 4 cyan
13 6 magenta
14 8 gray
15 5 blue
256 1 red
Plant 4D Athena SP2 ê Customization Manual (Basic)
2 Customization ê A note about groupIDs Page 22 of 41
AutoCAD provides several standards for specifying color numbers: ACI, True Color or Color Books
(Pantone based). These Plant-4D settings are (only) based on the ACI-standard.
ACI colors are the standard colors used in AutoCAD. Each color is identified by an ACI number, an integer
from 1 through 255. Standard color names are available only for colors 1 through 7. The colors are
assigned as follows: 1 Red, 2 Yellow, 3 Green, 4 Cyan, 5 Blue, 6 Magenta, and 7 White/Black.
¡ AutoCAD also provides some special colors. These are the following:
¡ ByBlock = 0 (Plant4D code ‘-1’)
¡ ByLayer = 256 (Plant4D code ‘-2’)
The Level or layer is mapped onto AutoCAD layers through the
\Plant-4D\ACAD\PID\BIN\LAYER.DAT file:
Level Layer name Layer color (P4D code)
0 Standard 1
1 Valves 1
2 Pumps 1
3 Vessels 1
4 Heaters 1
5 Exchangers 1
6 Filters 1
7 Separators 1
8 Centrifuges 1
9 Dryers 1
10 Breakers 1
11 Mixers 1
12 Presses 1
13 Transporters 1
14 Instruments 1
15 Nozzles 1
16 Reducers 1
17 Control_valves 1
18 Drivers 1
19 Connectors 1
Plant 4D Athena SP2 ê Customization Manual (Basic)
2 Customization ê A note about groupIDs Page 23 of 41
20 Actuators 1
21 Process_parts 1
22 Arrows 1
99 Lines 1
23 Misc. 1
24 Trims 1
25 Dampers 1
63 Lines 1The default setting for layers is that components are placed on the layer with the same Plant-4D number
(see column ‘level’ above). Components that have groupIDs without corresponding layers are placed on
layer 0.
The linetype Style is mapped onto AutoCAD line type by the \Plant-4D\ACAD\PID\BIN\LTYPE.DAT file:
Style AutoCAD Line Type
1 DASHED
2 DASHED
3 DASHED
4 DASHDOT
5 DASHED
6 CENTER
7 CENTER
101 PNEUMATIC_LINE
102 PNEUMATIC_BINARY_LINE
103 HYDRAULIC_LINE
104 CAPPILAR_LINE
105 ELECTRICAL_LINE
106 ELECTRICAL_BINARY_LINE
107 MECHANICAL_LINE
108 SOFTWARE_LINE
109 SONIC_LINE
110 UNDEFINED_LINETYPE
111 HOSE_LINE
112 TRACED_LINE
113 JACKET_LINEThe range of styles from 101 to 113 is Plant-4D specific styles. These styles are defined in the file \Plant-4D\ACAD\PID\BIN\ Plant-4D.lin. The file type .lin is a plain text file storing AutoCAD Linetype definitions.
For more information about the used syntax see the ‘AutoCAD User’s Guide’.
Plant 4D Athena SP2 ê Customization Manual (Basic)
3 P&ID Customizing ê Process and instrument lines Page 24 of 41
3. P&ID Customizing
3.1. Process and instrument linesProcess and Instrument Lines are defined in the Settings table of the project database. You can edit these
settings directly in Access or via the Settings tool of Plant-4D Data Manager. A line type is linked to a
code, which is listed in the section field of the Settings table. The default settings are:
Root Section KeyName Value
PID LnMIP Description Minor Process Line
PID LnEMAP Description Existing Major Process Line
PID LnEMIP Description Existing Minor Process Line
PID LnNMAP Description New Major Process Line
PID LnCWater Description Cool Water
PID LnVentDrain Description Vent/Drain
PID LnSteam Description Steam
PID LnFuel Description Fuel
PID LnTrace Description Trace
PID LnMAP Description Major Process line
PID LnDef Description Default Instrument Line
PID LnPn Description Pneumatic Line
PID LnPnB Description Pneumatic Binary Line
PID LnH Description Hydraulic Line
PID LnC Description Cappilar Line
PID LnE Description Electrical Line
PID LnEB Description Electrical Binary Line
PID LnM Description Mechanical Line
PID LnS Description Software Line
PID LnSnc Description Sonic Line
PID LnNMIP Description New Minor Process Line
PID LnVisible Description Visible
PID LnIHose Description Hose
PID LnITrace Description Trace
PID LnIJacket Description Jacket
PID LnHidden Description Hidden
PID LnCenter Description Center
Every line definition consists of a number of keys.Root Section KeyName Value
PID LnCWater Description Cool Water
PID LnCWater Color 1
PID LnCWater Level 63
PID LnCWater Style 0
PID LnCWater Weight 0.2
PID LnCWater Class
PID LnCWater LineMaterial
PID LnCWater Specification
Plant 4D Athena SP2 ê Customization Manual (Basic)
3 P&ID Customizing ê Process and instrument lines Page 25 of 41
In this example Class, LineMaterial and Specification are empty by default. Users can set these to a
standard value if they need to. Once a value is set it will be inherited by any new line of this type. You can
use this property to define default values for CommonData field.
You can create your own line types, but before you do so you should understand how the keys define the
appearance of the line.
3.1.1. Grouping process and instrument linesThere are two groups of lines in Plant-4D: Process Lines and Instrument Lines. When placing process
lines and instruments you will be asked to choose a linetype from a menu.
As you see, each shows its own set of linetypes. These groups are set in the sections PID-instrument lines
and PID-Process lines from the settings table.
Root Section KeyName Value
PID Instrument Lines List LnDef, LnPn, LnPnB, LnH, LnC, LnE, LnEB, LnM, LnS, LnSnc, LnIHose, LnITrace
PID Process Lines List
LnMAP, LnMIP, LnEMAP, LnEMIP, LnNMAP, LnNMIP, LnCWater, LnVentDrain, LnSteam, LnFuel, LnTrace, LnIHose, LnITrace, LnIJacket, LnVisible, LnHidden, LnCenter
To add or remove a linetype you can simply modify the list in the field ‘Value’. You can freely compose lists
of Instrument and Process Lines, taking into account the Microsoft Access limit of 255 characters for the
Value field.
3.1.2. Adding a new line type and creating your Process Lines list To add new lines to a Plant-4D project, you will need to edit the database directly. Here is an example:
1. Right click a project in 4D explorer and start Datamanager.
2. Close the menu and open the Settings table.
3. Using the filter by selection button for ‘PID’ in the Root column. Click anywhere in the Section
field, right-click and filter for ‘LnEMAP’.
Root Section KeyName Value
PID LnEMAP Specification -
PID LnEMAP LineMaterial Ss
PID LnEMAP Class 2
PID LnEMAP Weight 0.7
PID LnEMAP Style 6
PID LnEMAP Level 63
PID LnEMAP Color 2
Plant 4D Athena SP2 ê Customization Manual (Basic)
3 P&ID Customizing ê Process and instrument lines Page 26 of 41
PID LnEMAP Description Existing Major Process Line
4. Copy all the rows/keys you need, and paste them into an Excel sheet. Edit the name by changing
LnEMAP to LnHPS (High Pressure Steam). Copy the rows from Excel and paste them in the setting
table.
5. Use the last row marked by for this.
6. Edit other data as follows:
Root Section KeyName Value
PID LnEMAP Specification -
PID LnEMAP LineMaterial Ss
PID LnEMAP Class 2
PID LnEMAP Weight 0.7
PID LnEMAP Style 6
PID LnEMAP Level 63
PID LnEMAP Color 2
PID LnEMAP Description Existing Major Process Line
PID LnHPS Specification
PID LnHPS LineMaterial
PID LnHPS Class
PID LnHPS Weight 0.5
PID LnHPS Style 1
PID LnHPS Level 63
PID LnHPS Color 3
PID LnHPS Description High Pressure Steam
7. Remove filtering, and filter for Root: PID, Section: Process Lines now. Edit the Value field to be
exactly:
Root Section KeyName Value
PID Process Lines List LnMAP, LnMIP, LnCWater, LnHPS
This will allow the user to insert only lines of four types as defined above, including your new type.
8. Exit Access.
3.1.3. AutoCAD
We would like to make the Style = 1 to be AutoCAD Continuous line type. Open file \Plant-4D\ACAD\PID\BIN\LTYPE.DAT with Notepad and change the first row to read: 1,Continuous.
1. Save the file.
Now, you can open the Test Drawing with your CAD interface and try inserting lines. You will notice that
the Process Lines dialogs now look similar to these:
Plant 4D Athena SP2 ê Customization Manual (Basic)
3 P&ID Customizing ê Adding your own P&ID components Page 27 of 41
Note: These settings are used as a template for new lines. Modifications in colors, layers, linetypes, etc. would only affect the lines drawn after these changes and not make any changes to existing lines.
3.1.4. Default data values of linesMost records in the line descriptions are values which are copied into the COMMONDATA or PRIMITIVES
table when a new line is copied. Standard records are:
3.1.5. PRIMITIVES
¡ Weight - linewidth
¡ Style - linestyle
¡ Level - layer
¡ Color - linecolour
These determine the appearance of the line.
3.1.6. COMMONDATA:
¡ Specification
¡ LineMaterial
¡ Class
These can be given any default value. One application is for users who use dedicated lines and colors for
specific commodities. For example, the line type LnEMAP is used for water. All you need to do is add the
following line to the settings table. All new lines of this type will then contain the value ‘water’ in the field
commodity. This can be done with all COMMONDATA datafields.
SETTINGS
ROOT SECTION KEYNAME VALUE
PID LnEMAP Commodity water
3.2. Adding your own P&ID componentsBefore any changes are made, it is strongly advised that you make backup copies of all relevant
databases.
Copy these original databases to a safe location:
Plant 4D Athena SP2 ê Customization Manual (Basic)
3 P&ID Customizing ê Adding your own P&ID components Page 28 of 41
¡ The components database: CompPID¡ The specification database: Spec
You can also copy these and rename the copies to create your personal databases.
3.2.1. Components created from scratchPlant-4D P&ID components can only be made using the following primitives:
¡ box
¡ circle
¡ circle_arc
¡ ellipse
¡ ellipse_arc
¡ line
¡ rectangle
¡ text
The reason that no other primitives can be used is because Plant-4D has to be able to address multiple
CAD systems. So anything which is not shared by all systems can not be used.
The Plant-4D Write Component function will take a group of graphic primitives from your CAD program and
write a mathematical description of the symbol to the COMPPID.mdb database.
For the exercise we will create a non-standard valve symbol now.
Note: About the Component Name. This is the name used in the component database to refer to the component. It can be up to ten characters long but it’s recommended to only use eight. In this way the Component Name can also be used in the Component Index. If you enter a shorter name, such as VALVSPEC, Plant-4D will automatically pad the name with dashes to make up to 10 characters. Thus, the internal Component Name will become VALVSPEC--.
It is critical that you remember the name you have given the component.
3.2.2. AutoCAD
¡ Open your Test Drawing. Draw the following symbol using the AutoCAD LINE command:
(50,150) ð@5,-2.5 ð@0,2.5 ð@-5,-2.5 ð@0,2.5
then add a line: (52.5,150) ð@0,-2.5
¡ Use Plant-4DðWrite Component command from the menu. Select your new objects by window.
There should be 5 objects. Enter as name of the component: VALVSPEC. Define the origin so it’s
exactly in the middle of the valve symbol (52.5,148.75)
When you have finished, Plant-4D will report that the component has been successfully placed in
the database.
Plant 4D Athena SP2 ê Customization Manual (Basic)
3 P&ID Customizing ê Adding your own P&ID components Page 29 of 41
3.2.3. MicroStation
¡ Open your Test Drawing from THE 4D EXPLORER. Draw the following symbol using MicroStation
Place Line command:
(50,150) ð +5,-2.5 ð 0,+2.5 ð -5,-2.5 ð 0,+2.5
then add a line: (52.5,150) ð 0,-2.5
¡ Select the primitives using a fence. Use the Write Component ( ) command from the Plant-4D
Modify toolbox. Enter the name of the component: VALVSPEC and the coordinates of the origin into
the dialog box. Enter the origin as the middle of the component (52.5, 148.75), and click Store
Component.
When you have finished, Plant-4D reports that the component has been successfully placed in the
database.
3.2.4. Own components created from existing CAD drawingsIf you have existing P&ID drawings created with AutoCAD or MicroStation, you still can use the drawn
items to create Components in Plant-4D.
1. Open an empty Plant-4D drawing.
2. Add the existing CAD drawing through the reference command.
3. Explode the referenced drawing in Plant-4D. If your symbol is a block (cell), then explode it (drop it)
to get a set of primitives.
4. Use the Write Component command as described in previous section to write the graphical
representation of the symbol to the component database.
3.2.5. Adding components to a Specification A component is merely a graphical representation of a symbol including parameters. Plant-4D can insert a
component only if it is also referenced in a specification table. This Customization Project uses
PID_TOTAL#PID which contains all items that can be used with standard Plant-4D P&ID.
1. Open the \Plant-4D\Projects\Spec.mdb database with Access. Open PID_TOTAL#PID table for
editing.
2. Use Format >> Font command from menu to apply the Courier New font. This will display the data
in more organized, aligned manner.
3. Expand the ComponentIndex field so you can see the whole field. A ComponentIndex consists of:
a) A name that is exactly 8 characters long and can be similar to, or even quite different to the
Component Name. If code is shorter than 8 characters then it should be padded with dashes.
b) 18 space characters
c) 49 dashes (minus signs)
Plant 4D Athena SP2 ê Customization Manual (Basic)
3 P&ID Customizing ê Adding your own P&ID components Page 30 of 41
A complete Component Index must be exactly 75 characters wide. The reason for Component Index
being so complex is that it is used universally in both the P&ID and PIPE modules of Plant-4D. The PIPE
module uses more parameters than P&ID does and so we need spaces and dashed in P&ID.
The last field, Component Name, must be exactly the same as the Component Name found in the
component database.
Component Description and Short Component Description can be used in reports and can also be
displayed by intelligent components.
Group ID defines which component group the component is assigned to. The full list of Group ID’s is found
in the file \Plant-4D\Common\Dlg\group-id.txt. For instance, manual valves have a group ID of 1.
None of the other fields are required, but if data is entered in them they can be used in reports and
intelligent components can make use of the data.
4. Create a new data record, using the button at the bottom of the table or copy a similar record to
this line. For the exercise we will do the later.
5. Copy the record for ZERKALLG and paste it as a new record.
6. Press the [Insert] key to switch to overtype mode and replace ZERKALLG with ‘MYVALVE-’. Don’t
forget to include the dash, so our code will be 8 characters wide.
7. In the ComponentDescription field enter My Special Valve, and in ShortComponentDescription field
type Valve.
8. In GroupID field enter 1.9. In the last field, ComponentName, enter ‘VALVSPEC--’.10. Close the table window and exit Access.
3.2.6. Placement of new Components without menus To be able to use a new symbol with your CAD program, you can enter commands directly in the CAD
interface. In AutoCAD, you can enter appropriate command at the command prompt. In MicroStation, you
use a key-in.
3.2.7. AutoCAD
¡ Before you can enter a command, you need to edit the SHORTCUT.GRS file. This file contains
shortcuts which refer to a Plant-4D command with the required parameters filled in.
Open the file \Plant-4D\Acad\Pid\Bin\shortcut.grs with Notepad and add the command shown here in
bold type:
'**************************
'* ANSI *
'**************************
P4D_P_VALVE15, VALVE,ANSI5---,1,3,1
.........
P4D_P_VALVE25,p4d_pl_VALVE,ISA6601H,1,3,1
P4D_P_VALVE26,p4d_pl_VALVE,MYVALVE-,1,2.5,1'*****************************************
Plant 4D Athena SP2 ê Customization Manual (Basic)
3 P&ID Customizing ê Adding your own P&ID components Page 31 of 41
¡ P4D_P_VALVE26 is the new command name;
¡ p4d_pl_VALVE is the name of internal Plant-4D command to place inline valves;
¡ MYVALVE- are the first 8 characters of the ComponentIndex in the specification database;
¡ 4th parameter defines the valve’s connection behavior:
1=normal
2=angle
3=3-way
4=4-way
¡ 5th parameter defines half of the gap width that is created on a process line when the valve is
inserted. As our valve’s width is 5 mm, half of the gap width would be 2.5 mm;
¡ 6th parameter tells Plant-4D whether the Tag Number dialog should be displayed.
1=Yes
0 = No.
(Other Plant-4D placement commands are explained later in this manual.)
¡ Save the file and exit Notepad.
¡ Start ‘Test Drawing’ from the 4D EXPLORER with AutoCAD. Draw a process line.
¡ Ensure your specification is set to PID_TOTAL#PID.
¡ Enter the following command at the command prompt:
p4d_p_valve26
¡ Finish inserting the valve as per normal.
¡ Exit AutoCAD.
3.2.8. MicroStation
1. Start ‘Test Drawing’ from the 4D EXPLORER with MicroStation. Place a Process Line.
2. Open the Key-in dialog with Utilities ð Key-in menu. Enter the following:
3.2.9. Making bitmaps for menusAlthough it is not necessary to produce menu bitmaps for new Components (a ‘happy face’ icon would be
displayed instead), it is useful to have your own buttons in Plant-4D. Here’s one way of preparing bitmaps:
1. Start Windows Paint (Paintbrush). In Image ð Attributes set the picture size to be 16x16 pixels.
2. Draw your symbol using Paint tools:
3. You can also open and rename an existing bitmap and modify it.
4. Save the file as: \Plant-4D\Common\Bmp\32_myval.bmp and 16_myval.bmp. Older graphic cards
still needed an actual 32x32 bitmap but his is not required any more.
Plant 4D Athena SP2 ê Customization Manual (Basic)
3 P&ID Customizing ê Adding your own P&ID components Page 32 of 41
3.2.10. Adding commands to menus It is best to add a new command for the new component to menu toolbars or toolboxes.
3.2.11. AutoCAD
AutoCAD should not be running while you do this.
1. Make a backup copy of P4D_PID.MNU.
2. Open P4D_PID.MNU with Notepad. Enter these changes:
**TB_ANSI_VALVES
[_Toolbar(‘ANSI Valves’, _Floating, _Hide, 185, 196, 12)] E
[_Button(‘Gate Valve’, 16_00143.bmp, 32_00143.bmp)]^C^C_p4d_p_valve15
……
[_Button(‘Hand Control Valve’, 16_01401.bmp, 32_01401.bmp)]^C^C_p4d_p_valve25
[_Button(‘My Special Valve’, 16_myval.bmp, E 32_myval.bmp)]^C^C_p4d_p_valve26
Don’t forget to change number 11 to 12 in the Toolbar row. This tells AutoCAD how many buttons it should
place in the toolbar. The last line defines our new button. You specify button label, bitmaps and the new
command as defined in SHORTCUTS.GRS file.
3. If the AutoCAD version is lower than 2005;Navigate to the \Plant-4D\Acad\Pid\Bin folder with and
delete the files P4D_PID.MNR, P4D_PID.MNC, and P4D_PID.MNS.
4. Start the Test Drawing from the 4D EXPLORER with AutoCAD and the menus will automatically
recompile and you will see the new button in ANSI Toolbar:
In newer versions you have to use the menuload command. This will open:
Select ‘P4D’ in the window for the menu groups and click ‘Unload’.
Note: make sure that the menu group is highlighted as this command will otherwise remove all entries.
5. Click ‘Browse’ and select the P4d_pid.mnu file.
Plant 4D Athena SP2 ê Customization Manual (Basic)
3 P&ID Customizing ê Adding your own P&ID components Page 33 of 41
6. Click ‘Load’ and then ‘Close’.
If the modified menu does not appear you will need to redo the Browse and Load sequence once
again.
7. Test inserting your new valve using the toolbar.
The technique of editing mnu-files has changes since the introduction of AutoCAD2006. This version
introduces ‘Customize User Interface’, which is a much more user-friendly approach of customizing your
AutoCAD environment. It provides a graphical representation of the menu structures, toolbars, shortcuts,
etc. This functionality is based on an XML-file structure (cui-files) and future-ready: in future upgrades of
AutoCAD versions, existing user preferences will be adopted in the new environment.
Although the AutoCAD2006 provides backwards compatibility for mnu/mnr-files, this version (and higher)
requires an additional step (between step 4 and 5) to append the new toolbar button:
The new mnu-file must be re-attached from the ‘Customize User Interface’. This interface is started by
entering ‘CUI’ at the AutoCAD commandline.
Disconnect the partial CUI file ‘P4D’ and reopen it afterwards. AutoCAD have to be restarted to apply
these changes.
Alternately it is possible to skip the editing of mnu-files and directly edit from the CUI-environment.
Plant 4D Athena SP2 ê Customization Manual (Basic)
3 P&ID Customizing ê Adding your own P&ID components Page 34 of 41
3.2.12. MicroStation
A flexible menu definition routine has been added for MicroStation that allows menus to be defined and
modified using a text file.
MicroStation should not be running while you do this.
1. Navigate to the \CEA\Plant-4D\Settings\ustation folder with My Computer or Explorer. Make
backup copy of the PID.MNU file.
2. Open PID.MNU with Notepad. Apply these changes and save the file:
[TOOLBAR41]
ToolBarName=ANSI Valves
IconNormalWidth=22
IconNormalHeight=22
IconLargewidth=32
IconLargeheight=32
InitialLocationX=100
InitialLocationY=100
SizeWidth=12 E
SizeHeight=1
1=p4d place valve ANSI5--- 1 3,16_00143.BMP,’Gate Valve’
................
11=p4d place valve ISA6601H 1 3,16_01401.bmp,’Hand Control Valve’
12=p4d place valve MYVALVE- 1 2.5,16_myval.bmp,’My Special Valve’Don’t forget to specify 12 as SizeWidth.
Plant 4D Athena SP2 ê Customization Manual (Basic)
3 P&ID Customizing ê Placement command summary Page 35 of 41
3. Start the Test Drawing from 4D explorer with MicroStation. The menus will load on the fly and you
will be able to find the new button in the ANSI Toolbar:
4. Practice inserting your new valve using the toolbar. Undo all changes when finished.
3.3. Placement command summary
3.3.1. AutoCAD
These commands are used for the placement of components in the Plant4D CAD environment. They can
be used as a part of another command defined in a file like shortcut.grs (Autocad) or be used from the
CAD system’s command line as part of such a command of directly.
Note: Athena SP2 does not accept these commands when entered from the command line. This will be solved in future versions.
3.3.2. AutoCAD
The commands can be entered in the Shortcut.grs file to create specific commands for the placement of
components. These commands can then be executed from the command prompt or be used in the menu
file.
Regular components (like equipment)
¡ P4D_P_COMMAND,P4D_PL_COMP,COMPINDEX,x1
COMMAND: new command name that you define
P4D_PL_COMP: internal command to place a regular component
COMPINDEX: 8 character code as defined in Component Index in the Specification.
x1: Display Tag Dialog? 1=yes, 0=no.
¡ These have independent Solodata and Commondata fields.
Inline components: (placed on a line like valves)
¡ P4D_P_COMMAND,P4D_PL_VALVE,COMPINDEX,x1,x2,x3
COMMAND: new command name that you define.
P4D_PL_VALVE: internal command to place an inline component.
COMPINDEX: 8 character code as defined in Component Index in Specification.
x1: Component configuration: 1=normal, 2=angle, 3=3-way, 4=4-way.
x2: Half width of the gap that would be placed on a process line.
x3: Display Tag Dialog? 1=yes, 0=no.
¡ These components link to the Commondatarecord of the processline if placed inline. It’s retains its
own Solodata record.
¡ Note, other codes exist for the component configuration. These were used for special components
like databreaks, reducers and page connectors. In the current version these functions have been
taken over by the more effective plug-in menu.
Plant 4D Athena SP2 ê Customization Manual (Basic)
3 P&ID Customizing ê Placement command summary Page 36 of 41
Instruments:
¡ P4D_P_COMMAND,P4D_PL_INSTRUMENTS,COMPINDEX
COMMAND: new command name that you define.
P4D_PL_INSTRUMENTS: internal command to place an instrument.
COMPINDEX: 8 character code as defined in Component Index in the Specification.
¡ Instruments link to the Commondata and Solodata if added to a component. This is similar to
annotations but these get an extra balloon with instrument line and details
Annotations:
¡ P4D_P_COMMAND,P4D_PL_ANNOTATION,COMPINDEX
COMMAND: new command name that you define.
P4D_PL_ ANNOTATION: internal command to place an annotation.
COMPINDEX: 8 character code as defined in Component Index in Specification.
¡ Annotations link to Commondata and Solodata if added to a component which will also become the
parent of the annotation.
Child components: (of instance a nozzle to a vessel).
¡ P4D_P_COMMAND,P4D_PL_CHILD,COMPINDEX
COMMAND: new command name that you define.
P4D_PL_CHILD: internal command to place a component as a child of another component.
COMPINDEX: 8 character code as defined in Component Index in the Specification.
¡ This will create a parent-child link to the component it’s linked to. Solodata and Commondata are not
linked so the child components will for instance have their own tagnumbers.
Outdated commands: These commands are outdated but are listed here in case you find it in an older menu. Please use the
plug-in version instead.
Off-Page connectors:
¡ P4D_P_COMMAND,P4D_PL_OFFPAGE,COMPINDEX1, COMPINDEX2
COMMAND: new command name that you define
P4D_PL_OFFPAGE: internal command to place an off-page connector
COMPINDEX1: 8 character code as defined in Component Index in Specification for off-page
component
COMPINDEX2: 8 character code as defined in Component Index in -Specification for matching
on-page component
On-Page connectors:
¡ P4D_P_COMMAND,P4D_PL_ONPAGE,COMPINDEX
COMMAND: new command name that you define
Plant 4D Athena SP2 ê Customization Manual (Basic)
3 P&ID Customizing ê Placement command summary Page 37 of 41
P4D_PL_ONPAGE: internal command to place an on-page connector
COMPINDEX1: 8 character code as defined in Component Index in Specification for on-page
component
COMPINDEX2: 8 character code as defined in Component Index in Specification for matching
off-page component
3.3.3. MicroStation
These commands can be executed directly from Key-in or can be entered in PID.MNU. If these are
entered to the menu file, the parameter for displaying the tag dialog should be omitted.
Regular components: (that are not placed inline)
¡ p4d place component compindex x1
compindex: 8 character code as defined in Component Index in Specification
x1: Display Tag Dialog? 1=yes, 0=no
Inline components:
¡ p4d place valve compindex x1 x2 x3
compindex: 8 character code as defined in Component Index in Specification
x1: Component configuration: 1=normal, 2=angle, 3=3-way, 4=4-way
x2: Half width of the gap that would be placed on a process line
x3: Display Tag Dialog? 1=yes, 0=no
Instruments:
¡ p4d place instrument compindex x1
compindex: 8 character code as defined in Component Index in Specification
x1: Diameter of the instrument circle
3.3.4. Outdated commands:
These commands are outdated but are listed here in case you find it in an older menu. Please use the
plug-in version instead.
Off-Page connectors:
¡ p4d place offpage conoff compindex1 compindex2
compindex1: 8 character code as defined in Component Index in Specification for matching on-
page component
compindex2: 8 character code as defined in Component Index in Specification for off-page
component
On-Page connectors:
¡ p4d place offpage conon compindex1 compindex2
compindex1: 8 character code as defined in Component Index in Specification for matching off-
page component
compindex2: 8 character code as defined in Component Index in Specification for on-page
component
Plant 4D Athena SP2 ê Customization Manual (Basic)
3 P&ID Customizing ê Setting your Customized Project as your source database Page 38 of 41
3.4. Setting your Customized Project as your source databaseAs soon as you are finished with customization, you can make your customization Project to be a template
for all new projects.
¡ Copy Plant-4D\Projects\PROJ_PROT.mdb t0 some safe location:
¡ Copy the customized database/file (e.g. Plant-4D\Projects\PRJ_2\Prj_2.mdb) to Plant-4D\Projects\PROJ_PROT.mdb, overwriting the existing file.
Note: you can also give the template a different name than ‘PROJ_PROT’. As it is, you can use any project as template though you have to keep in mind that drawings, etc. are also copied. Since the number of useable records in some tables (like components) is limited it’s not recommended to continually base new projects on older finished projects.
You should ensure that the following files, if modified, are available:
¡ Component database files like \Plant-4D\Projects\COMPPID.MDB.
¡ Specification database files like \Plant-4D\Projects\SPEC.MDB.
¡ All user-defined bitmaps in \Plant-4D\Common\Bmp folder, if required.
¡ AutoCAD drawing frame in \Plant-4D\Common\Sheets, if required.
Same with the following AutoCAD files in \Plant-4D\Acad\Pid\Bin:
¡ P4D_PID.MNU
¡ SHORTCUT.GRS
¡ LTYPE.DAT
¡ COLOR.DAT
¡ LAYER.DAT
MicroStation customized file \Plant-4D\Ustation\Pid\Bin\PID.mnu.
Plant 4D Athena SP2 ê Customization Manual (Basic)
4 PIPE customization ê Setting your Customized Project as your source database Page 39 of 41
4. PIPE customization
Instructions on the creation of new PIPE components are found in the component builder manual.