.NET Customisation
User Guide
.NET Customisation
:
Database Interface
:
Element Access
: Navigation
Navigation
There are basic methods to navigate the primary hierarchy. for example, consider the following hierarchy:
If we are sitting at Zone2, we can navigate as follows:
using
NOUN=Aveva.Core.Database.DbElementTypeInstance;
DbElement zone = DbElement.GetElement("/Zone1")
DbElement temp=zone2.Next(); // temp is now Zone3
temp=zone2->Previous(); // temp is now Zone1
temp=zone2->Owner(); // temp is now Site1
temp=zone2->FirstMember(); // temp is now Pipe1
DbElement pipe1=temp;
temp=zone2->LastMember(); // temp is now Equi1
DbElement temp=pipe1.Next(NOUN.EQUIPMENT); // temp is Equi1
DbElement temp=pipe1.Previous(); // temp is ‘null’ as there is no previous element. This can only be tested using the ‘IsNull’ method
Scanning the database is a very common operation. For this reasons there are additional iterator and filter classes that ease this task. These are described in the section on Filters/Iterators.
Pseudo Attributes Relating to Element Navigation
Attribute Name
Data Type
Qualifier
Description
ALLELE
DbElement[])
DbElementType
All elements in the MDB of a particular type
CONNECTIONS
DbElement[]
Connections
CONNECTIONSH
DbElement[]
Connections for all descendants
CONNER
String
Int
Connection error message
DDEP
Int
Database depth within hierarchy (World is 0)
FRSTW
DbElement
String
Reference of first world of given DB type in current MDB
MAXD
Int
DB hierarchy depth of lowest level item beneath element
MBACK
DbElement[]
*DbElementType
Members in reverse order
MCOU
Int
*DbElementType
Number of Element Members of Given type
MEMB
DbElement[]
*DbElementType
All members, or members of specific type
OWNLST
DbElement[]
Owning hierarchy
PARENT
DbElement
*DbElementType
Reference of ascendant element of specified type
SEQU
Int
Sequence Position in Member List
TYSEQU
Int
Type Sequence Number
'*'- qualifier is optional
Secondary Hierarchies
Standard navigation methods do not work for descending a secondary hierarchy. Pseudo attribute SMEMB must be used, for example: to get the design elements below a GPSET, you must query the SMEMB attribute on the GPSET.
Pseudo attributes relating to secondary hierarchies are:
Attribute Name
Data Type
Description
GPPRXS
DbElement[]
Group proxy items referring to element
GROUPS
DbElement[]
GPSETs in which element occurs
SEXPND
DbElement[]
Recursive expansion of SMEMB
SITEM
DbElement
Reference from secondary hierarchy
SMEMB
DbElement[]
Immediate members in secondary hierarchy
The difference between SMEMB and SEXPND is that SEXPND allows for recursive secondary hierarchies. Where there are no recursive possibilities, SMEMB and SEXPND will be the same. The following example illustrates the difference between SMEMB and SEXPND:
In the example there are two secondary nodes S1 and S2. S1 holds element A and C, and S2 holds S1, D and G.
For S1,
SMEMB returns A,C
SEXPND returns A,C
For S2,
SMEMB returns S1,D, G
SEXPND returns A,C, D, G
1974 to current year.
AVEVA Solutions Limited and its subsidiaries. All rights reserved.