AFAttribute.FindElementAttributes Method (AFDatabase, AFElement, String, String, AFCategory, AFElementTemplate, AFElementType, String, String, AFCategory, TypeCode, Boolean, AFSortField, AFSortOrder, Int32, Int32, Int32)
- Last UpdatedSep 18, 2024
- PI System
- AF SDK 2024
- Developer
Namespace: OSIsoft.AF.Asset
Assembly: OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.0.1156
Syntax
public static AFAttributeList FindElementAttributes( AFDatabase database, AFElement searchRoot, string nameFilter, string descriptionFilter, AFCategory elemCategory, AFElementTemplate elemTemplate, AFElementType elemType, string attrNameFilter, string attrDescriptionFilter, AFCategory attrCategory, TypeCode attrType, bool searchFullHierarchy, AFSortField sortField, AFSortOrder sortOrder, int startIndex, int maxCount, out int totalCount )
Public Shared Function FindElementAttributes ( database As AFDatabase, searchRoot As AFElement, nameFilter As String, descriptionFilter As String, elemCategory As AFCategory, elemTemplate As AFElementTemplate, elemType As AFElementType, 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, <OutAttribute> ByRef totalCount As Integer ) As AFAttributeList Dim database As AFDatabase Dim searchRoot As AFElement Dim nameFilter As String Dim descriptionFilter As String Dim elemCategory As AFCategory Dim elemTemplate As AFElementTemplate Dim elemType As AFElementType 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 totalCount As Integer Dim returnValue As AFAttributeList returnValue = AFAttribute.FindElementAttributes(database, searchRoot, nameFilter, descriptionFilter, elemCategory, elemTemplate, elemType, attrNameFilter, attrDescriptionFilter, attrCategory, attrType, searchFullHierarchy, sortField, sortOrder, startIndex, maxCount, totalCount)
public: static AFAttributeList^ FindElementAttributes( AFDatabase^ database, AFElement^ searchRoot, String^ nameFilter, String^ descriptionFilter, AFCategory^ elemCategory, AFElementTemplate^ elemTemplate, AFElementType elemType, String^ attrNameFilter, String^ attrDescriptionFilter, AFCategory^ attrCategory, TypeCode attrType, bool searchFullHierarchy, AFSortField sortField, AFSortOrder sortOrder, int startIndex, int maxCount, [OutAttribute] int% totalCount )
static member FindElementAttributes : database : AFDatabase * searchRoot : AFElement * nameFilter : string * descriptionFilter : string * elemCategory : AFCategory * elemTemplate : AFElementTemplate * elemType : AFElementType * attrNameFilter : string * attrDescriptionFilter : string * attrCategory : AFCategory * attrType : TypeCode * searchFullHierarchy : bool * sortField : AFSortField * sortOrder : AFSortOrder * startIndex : int * maxCount : int * totalCount : int byref -> AFAttributeList
Parameters
- database
- Type: OSIsoft.AF.AFDatabase
The AFDatabase to search for the requested objects. - searchRoot
- Type: OSIsoft.AF.Asset.AFElement
The root object to start the search. If null, then the search starts at the AFDatabase. - nameFilter
- Type: System.String
The element 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 null 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: System.String
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 null 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'.
- elemCategory
- Type: OSIsoft.AF.AFCategory
Specify that the owner of the returned attributes must have this category. To not filter by element category, then specify null for this parameter. - elemTemplate
- Type: OSIsoft.AF.Asset.AFElementTemplate
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 null for this parameter. - elemType
- Type: OSIsoft.AF.Asset.AFElementType
Specify that the element of the returned attributes must have this Type. To not filter by element type, then specify AFElementType.Any for this parameter. - attrNameFilter
- Type: System.String
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 null 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: System.String
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 null 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.AF.AFCategory
Specify that returned attributes must have this category. To not filter by attribute category, then specify null for this parameter. - attrType
- Type: System.TypeCode
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: System.Boolean
Specifies if the search should include objects nested further than the immediate children of the searchRoot. - sortField
- Type: OSIsoft.AF.AFSortField
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.AF.AFSortOrder
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: System.Int32
The starting index (zero based) of the items to be returned. - maxCount
- Type: System.Int32
The maximum number of objects to be returned per call (the page size). - totalCount
- Type: System.Int32
The total number of objects that match the search criteria.
Return Value
Type: AFAttributeListReturns a collection containing the specified page of AFAttribute objects which match the specified filters.
Remarks
![]() |
---|
If a searchRoot is specified and the searchFullHierarchy parameter is true, then any added or removed element references that have not been checked in will be ignored when searching the hierarchy. Beginning with PI AF Server 2.6, only element template information that is checked in to the permanent storage will be utilized in the search. |