AFElement.LoadParents Method
- Last UpdatedNov 18, 2025
- 3 minute read
- PI System
- AF SDK 2024 R2
- Developer
Loads the primary parent of each AFElement specified in the list.
Namespace: OSIsoft.AF.Asset
Assembly: OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182
Syntax
public static AFNamedCollectionList<AFElement> LoadParents( IList<AFElement> elements, int maxLevel, bool fullLoad )
Public Shared Function LoadParents ( elements As IList(Of AFElement), maxLevel As Integer, fullLoad As Boolean ) As AFNamedCollectionList(Of AFElement) Dim elements As IList(Of AFElement) Dim maxLevel As Integer Dim fullLoad As Boolean Dim returnValue As AFNamedCollectionList(Of AFElement) returnValue = AFElement.LoadParents(elements, maxLevel, fullLoad)
public: static AFNamedCollectionList<AFElement^>^ LoadParents( IList<AFElement^>^ elements, int maxLevel, bool fullLoad )
static member LoadParents : elements : IList<AFElement> * maxLevel : int * fullLoad : bool -> AFNamedCollectionList<AFElement>
Parameters
- elements
- Type: System.Collections.GenericIListAFElement
The list of elements to have their primary parent element loaded. If , then this method does nothing. All elements in the list must be from the same PISystem. - maxLevel
- Type: SystemInt32
The maximum number of levels to traverse up the parent hierarchy. - fullLoad
- Type: SystemBoolean
If , then the parent of the elements will be fully loaded. You should fully load the parent if you will be accessing information about the target that is not a simple property value.
Return Value
Type: AFNamedCollectionListAFElementReturns list of parent elements that were loaded. It does not include the elements from the specified list of elements passed into this method.
Remarks
The primary parent elements of the elements in the specified list are loaded. This can improve performance when the parent objects will be needed for example when generating the full path to the element.
The returned list of parent elements can be used with the LoadAttributes method to only load specific attributes of the parent elements.