Click or drag to resize
OSIsoft, LLC

AFElementTemplateFindInstantiatedElements Method (Boolean, AFSortField, AFSortOrder, Int32)

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: 2.10.8.440
Syntax
public AFNamedCollectionList<AFBaseElement> FindInstantiatedElements(
	bool includeDerived,
	AFSortField sortField,
	AFSortOrder sortOrder,
	int maxCount
)

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: AFNamedCollectionListAFBaseElement
Returns 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)).

Important note Important
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.

Important note Important
Consider using one of the new AFSearch classes for finding elements instead of using this method.

Version Information

AFSDK

Supported in: 2.10.5, 2.10, 2.9.5, 2.9, 2.8.5, 2.8, 2.7.5, 2.7, 2.6, 2.5, 2.4
See Also
Enabling Operational Intelligence