AFElement.FindElementsByPath Method (IEnumerable(String), AFObject, IDictionary(String, String))
- Last UpdatedNov 18, 2025
- 3 minute read
- PI System
- AF SDK 2024 R2
- Developer
Namespace: OSIsoft.AF.Asset
Assembly: OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182
Syntax
public static AFNamedCollectionList<AFElement> FindElementsByPath( IEnumerable<string> paths, AFObject relativeFrom, out IDictionary<string, string> errors )
Public Shared Function FindElementsByPath ( paths As IEnumerable(Of String), relativeFrom As AFObject, <OutAttribute> ByRef errors As IDictionary(Of String, String) ) As AFNamedCollectionList(Of AFElement) Dim paths As IEnumerable(Of String) Dim relativeFrom As AFObject Dim errors As IDictionary(Of String, String) Dim returnValue As AFNamedCollectionList(Of AFElement) returnValue = AFElement.FindElementsByPath(paths, relativeFrom, errors)
public: static AFNamedCollectionList<AFElement^>^ FindElementsByPath( IEnumerable<String^>^ paths, AFObject^ relativeFrom, [OutAttribute] IDictionary<String^, String^>^% errors )
static member FindElementsByPath : paths : IEnumerable<string> * relativeFrom : AFObject * errors : IDictionary<string, string> byref -> AFNamedCollectionList<AFElement>
Parameters
- paths
- Type: System.Collections.GenericIEnumerableString
The collection of paths used to locate the AFElement. Each of the path names may be relative to the specified object or a fully qualified path. The paths may reference elements from a different PISystem or AFDatabase. See Path Syntax for more information. - relativeFrom
- Type: OSIsoft.AFAFObject
Specifies the object that the paths may be relative to. If , then all paths must be fully qualified. - errors
- Type: System.Collections.GenericIDictionaryString, String
If there are any errors finding the specified elements, then this returned dictionary has the path as the key and the corresponding error message as the value.
Return Value
Type: AFNamedCollectionListAFElementReturns the list of AFElement objects resolved from the specified paths.
Remarks
This method can be used to find a list of AFElement objects from a list of object paths. An object path can be obtained by calling one of the GetPath Overload methods. See Path Syntax for a complete description of the path syntax.
The performance of finding elements by path can vary depending on the syntax, server version, path length and hierarchy depth. For best performance, make sure you are using the latest AF Server. Simple relative paths (no substitution or navigation up or across the hierarchy) will perform better. Element paths which exceed a length of 420 characters or a depth of 24 levels will execute slower.
| The elements must be checked in to the server using CheckIn before this method can resolve the path to the object. |