AFElementTemplate.FindInstantiatedElements Method (Boolean, AFSortField, AFSortOrder, Int32)
- Last UpdatedNov 18, 2025
- 3 minute read
- PI System
- AF SDK 2024 R2
- Developer
This method returns a non-paged collection of AFBaseElement objects that were
created with this template.
Namespace: OSIsoft.AF.Asset
Assembly: OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182
Syntax
public AFNamedCollectionList<AFBaseElement> FindInstantiatedElements( bool includeDerived, AFSortField sortField, AFSortOrder sortOrder, int maxCount )
Public Function FindInstantiatedElements ( includeDerived As Boolean, sortField As AFSortField, sortOrder As AFSortOrder, maxCount As Integer ) As AFNamedCollectionList(Of AFBaseElement) Dim instance As AFElementTemplate Dim includeDerived As Boolean Dim sortField As AFSortField Dim sortOrder As AFSortOrder Dim maxCount As Integer Dim returnValue As AFNamedCollectionList(Of AFBaseElement) returnValue = instance.FindInstantiatedElements(includeDerived, sortField, sortOrder, maxCount)
public: AFNamedCollectionList<AFBaseElement^>^ FindInstantiatedElements( bool includeDerived, AFSortField sortField, AFSortOrder sortOrder, int maxCount )
member FindInstantiatedElements : includeDerived : bool * sortField : AFSortField * sortOrder : AFSortOrder * maxCount : int -> AFNamedCollectionList<AFBaseElement>
Parameters
- includeDerived
- Type: SystemBoolean
If , then all elements created from this template and any template that is derived from this template will be included in the returned collection. If , then only elements created from this template will be included. - sortField
- Type: OSIsoft.AFAFSortField
The field or property of the object used to sort the returned collection. - sortOrder
- Type: OSIsoft.AFAFSortOrder
The order that the returned collection is sorted. - maxCount
- Type: SystemInt32
The maximum number of objects to be returned.
Return Value
Type: AFNamedCollectionListAFBaseElementReturns the collection of the first page of AFBaseElement objects that were created with this template or one of its derived templates if includeDerived is .
Remarks
This method can be used to return the collection of AFBaseElement objects that have been created or instantiated from this template. By setting the includeDerived parameter, the collection will also contain all elements that have been created from an AFElementTemplate derived from this template (see FindDerivedTemplates(Boolean, AFSortField, AFSortOrder, Int32)).
| Only elements of the type specified by the InstanceType property will be returned. Any other type of elements created from this template will not be included in the returned collection. |
| Consider using one of the new AFSearch classes for finding elements instead of using this method. |