Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AF SDK Reference

AFAttribute.FindEventFrameAttributes Method (AFDatabase, AFSearchMode, Object, Object, AFEventFrame, String, String, String, AFCategory, AFElementTemplate, AFDurationQuery[], String, String, AFCategory, TypeCode, Boolean, AFSortField, AFSortOrder, Int32, Int32)

AFAttribute.FindEventFrameAttributes Method (AFDatabase, AFSearchMode, Object, Object, AFEventFrame, String, String, String, AFCategory, AFElementTemplate, AFDurationQuery[], String, String, AFCategory, TypeCode, Boolean, AFSortField, AFSortOrder, Int32, Int32)

  • Last UpdatedNov 18, 2025
  • 11 minute read
AFAttribute.FindEventFrameAttributes Method (AFDatabase, AFSearchMode, Object, Object, AFEventFrame, String, String, String, AFCategory, AFElementTemplate, AFDurationQuery[], String, String, AFCategory, TypeCode, Boolean, AFSortField, AFSortOrder, Int32, Int32)
Retrieves a paged collection of AFEventFrameAFAttribute objects matching the specified filters.

Namespace:  OSIsoft.AF.Asset
Assembly:  OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182

Syntax

public static AFAttributeList FindEventFrameAttributes(
	AFDatabase database,
	AFSearchMode searchMode,
	Object startTime,
	Object endTime,
	AFEventFrame searchRoot,
	string nameFilter,
	string descriptionFilter,
	string referencedElementNameFilter,
	AFCategory elemCategory,
	AFElementTemplate elemTemplate,
	AFDurationQuery[] durationQuery,
	string attrNameFilter,
	string attrDescriptionFilter,
	AFCategory attrCategory,
	TypeCode attrType,
	bool searchFullHierarchy,
	AFSortField sortField,
	AFSortOrder sortOrder,
	int startIndex,
	int maxCount
)
Public Shared Function FindEventFrameAttributes ( 
	database As AFDatabase,
	searchMode As AFSearchMode,
	startTime As Object,
	endTime As Object,
	searchRoot As AFEventFrame,
	nameFilter As String,
	descriptionFilter As String,
	referencedElementNameFilter As String,
	elemCategory As AFCategory,
	elemTemplate As AFElementTemplate,
	durationQuery As AFDurationQuery(),
	attrNameFilter As String,
	attrDescriptionFilter As String,
	attrCategory As AFCategory,
	attrType As TypeCode,
	searchFullHierarchy As Boolean,
	sortField As AFSortField,
	sortOrder As AFSortOrder,
	startIndex As Integer,
	maxCount As Integer
) As AFAttributeList

Dim database As AFDatabase
Dim searchMode As AFSearchMode
Dim startTime As Object
Dim endTime As Object
Dim searchRoot As AFEventFrame
Dim nameFilter As String
Dim descriptionFilter As String
Dim referencedElementNameFilter As String
Dim elemCategory As AFCategory
Dim elemTemplate As AFElementTemplate
Dim durationQuery As AFDurationQuery()
Dim attrNameFilter As String
Dim attrDescriptionFilter As String
Dim attrCategory As AFCategory
Dim attrType As TypeCode
Dim searchFullHierarchy As Boolean
Dim sortField As AFSortField
Dim sortOrder As AFSortOrder
Dim startIndex As Integer
Dim maxCount As Integer
Dim returnValue As AFAttributeList

returnValue = AFAttribute.FindEventFrameAttributes(database, 
	searchMode, startTime, endTime, searchRoot, 
	nameFilter, descriptionFilter, referencedElementNameFilter, 
	elemCategory, elemTemplate, durationQuery, 
	attrNameFilter, attrDescriptionFilter, 
	attrCategory, attrType, searchFullHierarchy, 
	sortField, sortOrder, startIndex, 
	maxCount)
public:
static AFAttributeList^ FindEventFrameAttributes(
	AFDatabase^ database, 
	AFSearchMode searchMode, 
	Object^ startTime, 
	Object^ endTime, 
	AFEventFrame^ searchRoot, 
	String^ nameFilter, 
	String^ descriptionFilter, 
	String^ referencedElementNameFilter, 
	AFCategory^ elemCategory, 
	AFElementTemplate^ elemTemplate, 
	array<AFDurationQuery>^ durationQuery, 
	String^ attrNameFilter, 
	String^ attrDescriptionFilter, 
	AFCategory^ attrCategory, 
	TypeCode attrType, 
	bool searchFullHierarchy, 
	AFSortField sortField, 
	AFSortOrder sortOrder, 
	int startIndex, 
	int maxCount
)
static member FindEventFrameAttributes : 
        database : AFDatabase * 
        searchMode : AFSearchMode * 
        startTime : Object * 
        endTime : Object * 
        searchRoot : AFEventFrame * 
        nameFilter : string * 
        descriptionFilter : string * 
        referencedElementNameFilter : string * 
        elemCategory : AFCategory * 
        elemTemplate : AFElementTemplate * 
        durationQuery : AFDurationQuery[] * 
        attrNameFilter : string * 
        attrDescriptionFilter : string * 
        attrCategory : AFCategory * 
        attrType : TypeCode * 
        searchFullHierarchy : bool * 
        sortField : AFSortField * 
        sortOrder : AFSortOrder * 
        startIndex : int * 
        maxCount : int -> AFAttributeList 

Parameters

database
Type: OSIsoft.AFAFDatabase
The AFDatabase to search for the requested objects.
searchMode
Type: OSIsoft.AF.AssetAFSearchMode
Determines how the startTime and endTime parameters are treated when searching for event frame objects to be included in the returned collection.
startTime
Type: SystemObject
An object representing the earliest starting time for the event frames to be returned. The value may be an AFTime, DateTime, PITime, String, or numeric. A DateTime (or a DATE will be treated as UTC time if its Kind property is set to Unspecified. Because DATE values from COM or VB6 clients are marshalled as Unspecified, these client applications must convert to UTC prior to marshalling. An integer numeric represents the number of ticks (100-nanosecond intervals) since January 1, 0001. A floating point numeric represents the number of seconds since January 1, 1970 UTC. A String is interpreted as local time, unless it contains a time zone indicator such as a trailing "Z" or "GMT". Strings will be interpreted with the AFTime.Parse Overload methods so that relative formats with intervals ("*", "T+3h", etc.) are also supported. Relative time intervals are based on the object's QueryDate.
endTime
Type: SystemObject
An object representing the latest ending time for the event frames to be returned. When the specified startTime is earlier than the endTime, the items in the resulting list will be indexed in time ascending direction. If the startTime is more recent than the endTime, the items in the resulting list will be indexed in time descending direction. The value may be an AFTime, DateTime, PITime, String, or numeric. A DateTime (or a DATE will be treated as UTC time if its Kind property is set to Unspecified. Because DATE values from COM or VB6 clients are marshalled as Unspecified, these client applications must convert to UTC prior to marshalling. An integer numeric represents the number of ticks (100-nanosecond intervals) since January 1, 0001. A floating point numeric represents the number of seconds since January 1, 1970 UTC. A String is interpreted as local time, unless it contains a time zone indicator such as a trailing "Z" or "GMT". Strings will be interpreted with the AFTime.Parse Overload methods so that relative formats with intervals ("*", "T+3h", etc.) are also supported. Relative time intervals are based on the object's QueryDate.
searchRoot
Type: OSIsoft.AF.EventFrameAFEventFrame
The root object to start the search. If , then the search starts at the AFDatabase.
nameFilter
Type: SystemString
The event frame name filter string used for finding objects.

The query string (or match pattern) can include regular characters and wildcard characters. Regular characters must match exactly the characters specified in the query string. Wildcard characters can be matched with arbitrary fragments of the query string. Wildcard characters can be escaped using the single backslash (\) character. Use a double backslash (\\) to match a single backslash. The syntax of the query string has the following rules:

  • If or empty string, then everything will be matched.
  • If no wildcards, then an exact match on the query string is performed.
  • Wildcard * can be placed anywhere in the query string and matches zero or more characters.
  • Wildcard ? can be placed anywhere in the query string and matches exactly one character.
  • One character in a set of characters are matched by placing them within [ ]. For example, a[bc] would match 'ab' or 'ac', but it would not match 'ad' or 'abd'.
  • One character in a set of characters are not matched by placing them within [! ]. For example, a[!bc] would match 'ad', but it would not match 'ab', 'ac', or 'abd'.
  • A character in a range of characters from first to last are matched using the following syntax: [first - last]. For example, a[a-c] would match 'aa', 'ab', or 'ac', but it would not match 'ad' or 'abc'.

descriptionFilter
Type: SystemString

The element description filter string used for finding objects. Only the first 440 characters of the description will be searched. For servers older than 2.7, a NotSupportedException exception will be thrown if this parameter is specified.

The query string (or match pattern) can include regular characters and wildcard characters. Regular characters must match exactly the characters specified in the query string. Wildcard characters can be matched with arbitrary fragments of the query string. Wildcard characters can be escaped using the single backslash (\) character. Use a double backslash (\\) to match a single backslash. The syntax of the query string has the following rules:

  • If or empty string, then everything will be matched.
  • If no wildcards, then an exact match on the query string is performed.
  • Wildcard * can be placed anywhere in the query string and matches zero or more characters.
  • Wildcard ? can be placed anywhere in the query string and matches exactly one character.
  • One character in a set of characters are matched by placing them within [ ]. For example, a[bc] would match 'ab' or 'ac', but it would not match 'ad' or 'abd'.
  • One character in a set of characters are not matched by placing them within [! ]. For example, a[!bc] would match 'ad', but it would not match 'ab', 'ac', or 'abd'.
  • A character in a range of characters from first to last are matched using the following syntax: [first - last]. For example, a[a-c] would match 'aa', 'ab', or 'ac', but it would not match 'ad' or 'abc'.
referencedElementNameFilter
Type: SystemString
The name filter string of an AFElement in the event frame's ReferencedElements collection. Uses same filtering rules as specified for the nameFilter parameter. To obtain an exact match to a specific element, specify the element's ID using a format that includes the opening and closing braces, such as ID.ToString("B").
elemCategory
Type: OSIsoft.AFAFCategory
Specify that the owner of the returned attributes must have this category. To not filter by element category, then specify for this parameter.
elemTemplate
Type: OSIsoft.AF.AssetAFElementTemplate
Specify that the owner of the returned attributes must have this template or a template derived from this template. To not filter by element template, then specify for this parameter.
durationQuery
Type: OSIsoft.AF.EventFrameAFDurationQuery
An array of duration queries that are ANDed together to find the desired AFEventFrame objects. To not filter by duration, set this parameter to .
attrNameFilter
Type: SystemString

The attribute name filter string used for finding objects.

The query string (or match pattern) can include regular characters and wildcard characters. Regular characters must match exactly the characters specified in the query string. Wildcard characters can be matched with arbitrary fragments of the query string. Wildcard characters can be escaped using the single backslash (\) character. Use a double backslash (\\) to match a single backslash. The syntax of the query string has the following rules:

  • If or empty string, then everything will be matched.
  • If no wildcards, then an exact match on the query string is performed.
  • Wildcard * can be placed anywhere in the query string and matches zero or more characters.
  • Wildcard ? can be placed anywhere in the query string and matches exactly one character.
  • One character in a set of characters are matched by placing them within [ ]. For example, a[bc] would match 'ab' or 'ac', but it would not match 'ad' or 'abd'.
  • One character in a set of characters are not matched by placing them within [! ]. For example, a[!bc] would match 'ad', but it would not match 'ab', 'ac', or 'abd'.
  • A character in a range of characters from first to last are matched using the following syntax: [first - last]. For example, a[a-c] would match 'aa', 'ab', or 'ac', but it would not match 'ad' or 'abc'.
attrDescriptionFilter
Type: SystemString

The attribute description filter string used for finding objects. Only the first 440 characters of the description will be searched. For servers older than 2.7, a NotSupportedException exception will be thrown if this parameter is specified.

The query string (or match pattern) can include regular characters and wildcard characters. Regular characters must match exactly the characters specified in the query string. Wildcard characters can be matched with arbitrary fragments of the query string. Wildcard characters can be escaped using the single backslash (\) character. Use a double backslash (\\) to match a single backslash. The syntax of the query string has the following rules:

  • If or empty string, then everything will be matched.
  • If no wildcards, then an exact match on the query string is performed.
  • Wildcard * can be placed anywhere in the query string and matches zero or more characters.
  • Wildcard ? can be placed anywhere in the query string and matches exactly one character.
  • One character in a set of characters are matched by placing them within [ ]. For example, a[bc] would match 'ab' or 'ac', but it would not match 'ad' or 'abd'.
  • One character in a set of characters are not matched by placing them within [! ]. For example, a[!bc] would match 'ad', but it would not match 'ab', 'ac', or 'abd'.
  • A character in a range of characters from first to last are matched using the following syntax: [first - last]. For example, a[a-c] would match 'aa', 'ab', or 'ac', but it would not match 'ad' or 'abc'.
attrCategory
Type: OSIsoft.AFAFCategory
Specify that returned attributes must have this category. To not filter by attribute category, then specify for this parameter.
attrType
Type: SystemTypeCode
Specify that returned attributes must have this Type. To not filter by attribute type, then specify Empty. If Object is specified, then attributes which do not have a type defined (displayed as Anything in PI System Explorer), will be returned, as well as types which cannot be described by a simpler type code, such as enumeration values, arrays, files, and references to other AF objects.
searchFullHierarchy
Type: SystemBoolean
Specifies if the search should include objects nested further than the immediate children of the searchRoot.
sortField
Type: OSIsoft.AFAFSortField
The field or property of the object used to sort the returned collection. This value should not be changed between calls when attempting to get the next page of items.
sortOrder
Type: OSIsoft.AFAFSortOrder
The order that the returned collection is sorted. This value should not be changed between calls when attempting to get the next page of items.
startIndex
Type: SystemInt32
The starting index (zero based) of the items to be returned.
maxCount
Type: SystemInt32
The maximum number of objects to be returned per call (the page size).

Return Value

Type: AFAttributeList
Returns a collection containing the specified page of AFAttribute objects which match the specified filters.

Remarks

An object matches the search if the specified nameFilter is found in the event frame's Name property and the specified attrNameFilter is found in the attribute's Name property. The returned attributes can be filtered even more by specifying one or more of the following: element category, element template, attribute category, attribute type.
Important note Important
This will NOT return attributes of objects that inherit from AFEventFrame, such as AFTransfer and AFCase. Beginning with PI AF Server 2.6, only event frame element template information that is checked in to the permanent storage will be utilized in the search.

Version Information

AFSDK

Supported in: 3.1.1, 3.1.0, 3.0.2, 3.0.1, 3.0.0, 2.10.11, 2.10.5, 2.10.0, 2.10, 2.9.5, 2.9, 2.8.5, 2.8, 2.7.5, 2.7

See Also

In This Topic
TitleResults for “How to create a CRG?”Also Available in