Data Model Definition Classes
- Last UpdatedJan 28, 2025
- 1 minute read
Data model definition classes allow the metadata to be accessed from User Defined Element Types (UDET) and User Defined Attributes (UDA).
User Defined Element Types (UDET)
UDETs can be used to extend the existing types and redefine the allowed owners and members.
User Defined Attributes (UDA)
UDAs can be used to add attributes to existing types and UDETs and to define pseudo attribute plug-ins.
UDAs are created in LEXICON. Refer to the Lexicon documentation for further information.
Code can be plugged in to calculate the value of pseudo attributes. The code must be registered in the AVEVA module by passing in a C# delegate.
The example displays get UDA code:
DbAttribute uda = DbAttribute.GetDbAttribute(":VOLUME");
The example displays defined UDA delegate code:
static private double VolumeCalculation(DbElement ele, DbAttribute att, DbQualifier qualifier)
{
}
The example displays add UDA delegate code:
DbPseudoAttribute.GetDoubleDelegate dele = new
DbPseudoAttribute.GetDoubleDelegate(VolumeCalculation);
DbPseudoAttribute.AddGetDoubleAttribute(uda, NOUN.EQUI, dele);
The example displays get UDA on an equipment code:
DbElement equi = DbElement.GetElement("/VESS1")
double vol = equi.GetDouble(uda);
Alternatively, the command line can be used:
/VESS1
Q :VOLUME
Events
The example displays database change event code:
DatabaseService.Changes +=new DbChangesEventHandler(DatabaseService_Changes);
static void DatabaseService_Changes(object sender, DbChangesEventArgs e)
{
DbElement[] creations = e.ChangeList.GetCreations();
DbElement[] deletions = e.ChangeList.GetDeletions();
DbElement[] memberChanges = e.ChangeList.GetMemberChanges();
DbElement[] modifications = e.ChangeList.GetModified();
}
Detailed information about PML.NET is available, refer to PML.NET for further information.