Contents 1 Introducing LEXICON ... ................................................................................ ..11 1.1 What Does LEXICON Do? ... ....................................................................................... .. 11 1.2 Lexicon... ....................................................................................................................... .. 11 1.3 Who Should Read This Manual... .................................................................................. . 11 2 The LEXICON Database... ............................................................................. ..21 2.1 The Database Hierarchy ... ........................................................................................... .. 21 3 Creating and Using UDAs ... .......................................................................... .31 3.1 Getting Started ... .......................................................................................................... .. 31 3.2 Creating New UDAs ... ................................................................................................. ... 31 3.3 Copying UDA Definitions... ........................................................................................... .. 32 3.4 Example UDAs... .......................................................................................................... .. 32 3.5 UDAs in User Elements... .............................................................................................. . 34 3.5.1 Introduction ... ..................................................................................................... . 35 3.5.2 Setting and Changing UDAs in User Elements... .............................................. . 36 3.5.3 Querying UDAs in User Elements... ................................................................. ... 36 3.6 Use of GOTO ... ............................................................................................................. . 36 3.6.1 Effect on UDA Instances if Definition is Changed... ......................................... ... 37 3.6.2 Purging UDA Instances... ................................................................................... . 37 3.6.3 Expressions and Rules ... .................................................................................. . 37 3.7 Handling of UDAs in Reports and Expressions... .......................................................... . 37 3.8 Handling of UDAs in Data Output Macros... ................................................................ ... 38 3.9 Handling of UDAs in Project Reconfiguration... ............................................................. . 39 Appendix A. Command Syntax Diagrams... ......................................................... ..1 A.1. Introduction... .................................................................................................................. .. 1 A.2. Conventions ... .............................................................................................................. ... 1 A.3. Command Arguments... .................................................................................................. . 2 A.4. The Syntax Diagrams... ................................................................................................... . 3 A.4.1. Compiling the Element List and Reference List ... ............................................ . 3 A.4.2. Copying a UDA ... ............................................................................................. .. 3 Appendix B. Error Messages ... .............................................................................. .1
Contents 1 Introducing LEXICON 1-1 1.1 What Does LEXICON Do? 1-1 1.2 Lexicon 1-1 1.3 Who Should Read This Manual . 1-1 2 The LEXICON Database 2-1 2.1 The Database Hierarchy 2-1 3 Creating and Using UDAs .3-1 3.1 Getting Started 3-1 3.2 Creating New UDAs 3-1 3.3 Copying UDA Definitions 3-2 3.4 Example UDAs 3-2 3.5 UDAs in User Elements . 3-4 3.5.1 Introduction . 3-5 3.5.2 Setting and Changing UDAs in User Elements . 3-6 3.5.3 Querying UDAs in User Elements 3-6 3.6 Use of GOTO . 3-6 3.6.1 Effect on UDA Instances if Definition is Changed 3-7 3.6.2 Purging UDA Instances . 3-7 3.6.3 Expressions and Rules . 3-7 3.7 Handling of UDAs in Reports and Expressions . 3-7 3.8 Handling of UDAs in Data Output Macros 3-8 3.9 Handling of UDAs in Project Reconfiguration . 3-9 Appendix A. Command Syntax Diagrams 1 A.1. Introduction 1 A.2. Conventions 1 A.3. Command Arguments . 2 A.4. The Syntax Diagrams . 3 A.4.1. Compiling the Element List and Reference List . 3 A.4.2. Copying a UDA 3 Appendix B. Error Messages .1 PDMS LEXICON Contents-i Contents Contents-ii PDMS LEXICON 1 Introducing LEXICON 1.1 What Does LEXICON Do? LEXICON enables the PDMS system administrator to add new attributes to any element in the Design, Catalogue and Drafting databases of a project. These User Defined Attributes (UDAs) are created as elements in Lexiconinside the PDMS project. Because LEXICON databases are project-specific, it is possible to define attributes to suit individual project requirements or company standards. Once defined, UDAs may be accessed in much the same way as normal attributes, including setting values, querying and reporting upon these values. Utilities such as the Data Output and Project Reconfiguration functions treat UDAs as they would any other attribute. UDAs can also be used in expressions. 1.2 The LEXICON Database Before a project can use UDAs, a DICTIONARY database must be created. This is done by using the ADMIN module in the same way as for any other type of database. UDAs may be changed or deleted during the course of a project. The dictionary will contain all the UDA definitions for a project and if data is to be transferred between PDMS projects the dictionary must be transferred as well. The data output and project reconfiguration functions can be used to do this. 1.3 Who Should Read This Manual This Reference Manual assumes that you are familiar with using PDMS at a System Administrator level. Access to LEXICON is normally restricted to FREE users only. PDMS LEXICON 1-1 Introducing LEXICON 1-2 PDMS LEXICON 2 The LEXICON Database Before they can be used, user-defined attributes must first be defined in the LEXICON database. The definition exists as a UDA element in the database. Attributes of the UDA element include those which define the UDA type (i.e. whether it is to be a number, a word, a logical attribute etc), its default value (if any), and the element types (in other databases) that it is to apply to. 2.1 The Database Hierarchy The hierarchy of elements which makes up Lexiconis shown below. UWRL UGRO UDA UDA Figure 2-1 LEXICON Database Hierarchy UWRL (UDA World) is the top-level administrative element. As well as the standard PDMS attributes, this has a DESC (description) attribute which can contain up to 120 characters of text. A UWRL may hold UGRO (UDA Group) elements or individual UDA (UDA definition) elements. A UGRO has the same attributes as a UWRL. Note that both UWRL and UGRO elements may themselves be given user-defined attributes (see below). The UDA elements themselves have the following attributes (besides the standard ones): UDNAME - the name by which the UDA will be referred to in the PDMS modules that use UDAs. This should not be confused with the standard NAME attribute of the UDA, which is the name of the UDA element within the LEXICON database. The name must be entered as a text attribute with a maximum length of twelve case-independent characters. An example of setting the UDNAME attribute would be: UDNA ’SUPPORT’ UKEY. This is a system attribute. It can be queried but not set directly. It is the number which identifies the UDA and provides the link with the UDA instance in the constructor PDMS LEXICON 2-1 Lexicon database. The UKEY is generated from the UDNAME name by taking the ASCII values of the first four characters, subtracting 32 (or 64 if lowercase) and multiplying them together. If the first four characters are not unique, an increment is applied to the calculated value until a unique value is found. If you intend to include foreign databases or merge projects, you should ensure that the UDNAMEs in each database correspond, and that they are unique. This will ensure that the UKEYs generated are the same. When you compile a Dictionary database, you should include all Dictionary databases for the project in the MDB. This will ensure that any UKEY clashes are resolved when the database is compiled. Alternatively, you could user different naming conventions in different databases. Note that changing the UDNAME will not affect the key. It is possible to copy a UDA, with the copy having the same key as the original - see KEYCOPY command in Chapter 3. ABLEN is the minimum number of characters for a UDNAME abbreviation - default 3. In the default case, the minimum abbreviation for the example UDNAME given above would be SUP. You may not give two or more UDAs the same minimum abbreviation - an error will occur when the UDAs are compiled (see Chapter 3). UTYPE is the UDA type. This can be set to the following: REAL Any numeric value, e.g. 23.5 INTeger Any whole number, e.g. 200 REFerence An element identifier, e.g. /VESS1, =12/99 TEXT Any characters in closing single quotes. e.g. ’BOT_STEEL2’ WORD Any sequence of letters, e.g. ABCD LOGical TRUE or FALSE POSition A position, e.g. E10 N50 U100 DIRection A direction, e.g. E 45 U ORIentation An orientation, e.g. U is E and N is D. The UTYPE defines the type of data that may be entered against the UDA for an element accessed by a user module. POS, DIR and ORI types are particularly useful when used in conjunction with WRT or FROM. For example: Q :POS OF /EQUI-1 WRT /* Note that when WRT is used, the base value is relative to the Owner, not the element itself. Hence this command will extract the values of :POS for EQUI-1, and concatenate the values with the values for the Zone and Site. The result will be relative to the World. ULEN is the maximum number of occurrences of the given UTYPE that may be stored in the UDA. For example, a REAL UDA might be given a ULEN of 3, making it suitable for storing, say, a 3D coordinate array. For TEXT and WORD UTYPEs, ULEN is the maximum number of characters. The default setting of ULEN is 1, the maximum is 120. (Strings longer than 120 characters will be truncated.) RPTX (Report text) is a text attribute used to define the default column heading to be used in reports. RPTX may be up to 20 characters long. UUNIT (UDA units) is used to modify the value contained by the UDA such that it is output in the units specified by the user. For example, if you set distance units to be feet and inches using the FINCH DIST command in DESIGN, the value of the UDA will be output in these units (provided also that UUNIT is set to DIST; see below). 2-2 PDMS LEXICON UUNIT is a word attribute. The available word options are BORE, DISTANCE (minimum abbreviation DIST) or NONE. The default is NONE, which means that the UDA value will be output exactly as it is stored and will not vary according to BORE or DIST unit settings. UUNIT should be set to DIST for POS type UDAs. The UUNIT setting is only used if the UDA type is REAL DFLT (Default). For all UDA types except REF, a default setting may be specified. For UDA types INT, REAL or LOG the default will only be taken if ULEN is 1. DFLT is not a valid attribute for POS, ORI or DIR types. The type of setting entered should correspond to the UTYPE. DFLT may be left unset or set to NONE. In this case the UDA has no default. DESCRIPT is a text attribute which may be used to give a description of the UDA. ELELIST (Element list) contains the list of element types for which the UDA is valid. The elements may exist in the Design, Catalogue or Draft (PADD) databases, or in Lexiconitself. Up to 100 element types may be set. The element list must be assembled using the syntax: ELElist ADD element_type Elements must be removed from the list by using the syntax ELElist REMove element_type For example: ELELIST ADD ZONE PIPE add ZONE and PIPE elements ELE REMOVE PIPE remove PIPE elements ELE REM ALL remove all elements To simplify input the keywords ALLP and PRIM can be used to cover all piping components and all primitives, respectively. REFLIST (Reference list). This is only relevant if UTYPE is REF. It is the list of valid element types that the UDA may reference. For example, if a REF UDA is set in DESIGN to an EQUI element and the UDA element’s REFLIST is set to VALV, then an error will result. If REFLIST is not set, it is assumed that all element types may be referenced. REFLIST is set in a similar way to ELELIST, for example: REFLIST REM PIPE BRAN REF REM ALL REF REM PRIM The REFLIST may have up to 100 members. PDMS LEXICON 2-3 Lexicon 2-4 PDMS LEXICON 3 Creating and Using UDAs 3.1 Getting Started To be able to use LEXICON you must be a FREE user and the project must have a LEXICON (DICT) database. See the VANTAGE PDMS ADMIN Reference Manual for how to create databases. Lexiconmust be part of any multiple database (MDB) which requires access to UDAs. If Lexiconis removed from the current MDB, no UDAs will be recognised. LEXICON is entered from the Modules options displayed from the various application menu bars, or at command level by typing its name (minimum abbreviation LEX). 3.2 Creating New UDAs The first step is to create a LEXICON database hierarchy, as shown in Figure 2-1. Commands used to create, delete and navigate around Lexiconelements are exactly the same as those used for any other database type: see the Plant Design Software Customisation Guide for details. A typical LEXICON session could be as follows: NEW UWRL /UWRL1 NEW UGRO /CENTRE_GRAVITY DESC ’Centre of gravity attributes’ Create UDA World, UDA Group NEW UDA /LENGTH UTYP REAL UDNA ’LENGTH’ ABLEN 3 UUNI DIST DFLT 0.00 Create and name UDA, type REAL Assign ‘user database’ attribute name, Minimum abbreviation LEN Set UDA units as system DISTANCE units Set default UDA value Here, the default value of the UDA has been set to zero, but in a case such as temperature it might be set to be a value of (say) 20.0 to represent an ambient temperature. RPTX ’Length’ Set column heading to be used in reports ELE ADD STRU SUBS Define element types that are to use the UDA COMPILE Implement the UDA definition The COMPILE command (minimum abbreviation COMP, no arguments) causes the UDA to be made available for use by the named element types in the appropriate database. New UDAs, or changes to existing UDAs, will not be accessible in user databases unless the COMPILE command is used. It is not strictly necessary to use the COMPILE command if a UDA is deleted, but this is advisable. PDMS LEXICON 3-1 Creating and Using UDAs Compiled changes will not be implemented if you leave LEXICON by using the QUIT command. 3.3 Copying UDA Definitions When a UDA definition is copied, a new key (a reference number known only to the system) is assigned to the new element. Occasionally you may want to have more than one definition with the same key; for example, to vary the default or UDA length depending on the element types. To do this the key may be copied using the command KEYCOPY name rather than the standard COPY name Where two or more definitions exist with the same key, the definitions must have the same name, minimum abbreviation and type, and different ELELISTS, otherwise an error will occur on compilation. It is advisable to have the same units and RPTX text. Note that project reconfiguration will always copy the key. 3.4 Example UDAs This section gives examples of some of the different UDA types. The commands for creating each UDA type are given, together with a brief discussion of their features. NOTE: When a UDA appears in the attribute list of a user element, its name (i.e. its UDNAME) will be preceded by a colon (:) to distinguish it as a UDA. UDA type REAL NEW UDA /WEIG UTYP REAL UDNA ’WEIGHT’ ULEN 3 UUNI DIST RPTX ’Weight’ ELE ADD STRU SUBS EQUI This is an example of a REAL attribute which could be used to store the weight of an element. 3-2 PDMS LEXICON [...]... remaining sections of this chapter discuss various aspects of UDAs in the user modules 3-4 PDMS LEXICON 3.5.1 Introduction UDAs may be added to the Design, Catalogue and Draft (PADD) databases, as well as to Lexiconitself User modules are therefore DESIGN, DRAFT PARAGON and LEXICON Having defined and compiled a set of UDAs in LEXICON, those elements defined as using UDAs will have the UDA UDNAME, preceded... LEXICON database is reconfigured The normal use of reconfiguration to update projects is unaffected; all UDA instances will be preserved The space taken up by PURGEd UDA instances will be reclaimed PDMS LEXICON 3-9 Creating and Using UDAs 3-10 PDMS LEXICON Appendix A Command Syntax Diagrams A.1 Introduction This appendix contains the legal command and interrogation syntax diagrams relevant to the PDMS. .. | | ‘ + > is any Design, PADDLE, LEXICON, Catalogue or Specification element type: see the appropriate user documentation for lists A.4.2 Copying a UDA See Section 3.3 > - KEYCopy - -> PDMS LEXICON A-3 Command Syntax Diagrams A-4 PDMS LEXICON Appendix B Error Messages This appendix lists those error messages specific to LEXICON All such messages have a message number... into a Design/Drawing/Catalogue module if it contains UDA instances whose definitions are not available on the target project or if the definition is inconsistent with this instance 3-8 PDMS LEXICON 3.9 Handling of UDAs in Project Reconfiguration Project reconfiguration from ADMIN may be used in the normal way for transferring LEXICON database data After being reconfigured, Lexiconwill be compiled automatically... example, GOTO :REF2 [4} 3-6 Go to the 4th reference in the list for UDA :REF2 PDMS LEXICON 3.6.1 Effect on UDA Instances if Definition is Changed In all that follows it should be remembered that no change to a UDA instance (apart from deletion of the UDA definition element) will occur until the COMPILE command has been given in LEXICON Where an instance of a UDA exists, then changes to the definition may... UDAs in Reports and Expressions Elements in Lexiconcan be reported on in the same way as other attributes UDAs may be used to select elements for reporting and to sort elements by the value of a UDA or of a field of an array attribute Reference UDAs may be used in the same manner as normal reference attributes to extract data from the referenced element PDMS LEXICON 3-7 Creating and Using UDAs The DFLT... / | > -* - name -+ -> means that you may type in a list of PDMS names, separated by at least one space A.3 Command Arguments These are inputs which are necessary to qualify command words They are distinguished by appearing in italics Name name refno integer value word text sign equals comma nl Table A-1 A-2 Definition PDMS element name PDMS reference number a positive integer signed number alphabetic... lines) = (in default lines) 20, 40 (for range of values) Press the RETURN key Examples of basic command arguments PDMS LEXICON Command Syntax Diagrams A.4 The Syntax Diagrams Apart from the direct setting of UDA element attributes, the options for which are given in Chapter 2, the only LEXICON commands are COMPILE (syntax COMPile), ELELIST/REFLIST and COPY/KEYCOPY A.4.1 Compiling the Element List and... heading in the report For more information about reports and expressions, see Reporting from PDMS and the Plant Design Software Customisation Guide 3.8 Handling of UDAs in Data Output Macros All or part of a LEXICON database may be listed out using the OUTPUT facility The resulting macros may be read into LEXICON in the normal way As with other attributes, defaults will not appear in the output file... LEXICON 3-9 Creating and Using UDAs 3-10 PDMS LEXICON Appendix A Command Syntax Diagrams A.1 Introduction This appendix contains the legal command and interrogation syntax diagrams relevant to the PDMS LEXICON module These diagrams formalise the precise command sequences which may be used and are intended to supplement the explanations given in the appropriate sections of this manual A.2 Conventions The . Contents 1 Introducing LEXICON 1-1 1.1 What Does LEXICON Do? 1-1 1.2 Lexicon 1-1 1.3 Who Should Read This Manual . 1-1 2 The LEXICON Database 2-1 2.1 The Database Hierarchy. Contents-ii PDMS LEXICON 1 Introducing LEXICON 1.1 What Does LEXICON Do? LEXICON enables the PDMS system administrator to add new attributes. Administrator level. Access to LEXICON is normally restricted to FREE users only. PDMS LEXICON 1-1 Introducing LEXICON