Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AF SDK Reference

AFElement.FindElementsByPath Method (IEnumerable(String), AFObject)

AFElement.FindElementsByPath Method (IEnumerable(String), AFObject)

  • Last UpdatedNov 18, 2025
  • 3 minute read
AFElement.FindElementsByPath Method (IEnumerable(String), AFObject)
Retrieves the AFElement objects identified by the path strings as keyed results.

Namespace:  OSIsoft.AF.Asset
Assembly:  OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182

Syntax

public static AFKeyedResults<string, AFElement> FindElementsByPath(
	IEnumerable<string> paths,
	AFObject relativeFrom
)
Public Shared Function FindElementsByPath ( 
	paths As IEnumerable(Of String),
	relativeFrom As AFObject
) As AFKeyedResults(Of String, AFElement)

Dim paths As IEnumerable(Of String)
Dim relativeFrom As AFObject
Dim returnValue As AFKeyedResults(Of String, AFElement)

returnValue = AFElement.FindElementsByPath(paths, 
	relativeFrom)
public:
static AFKeyedResults<String^, AFElement^>^ FindElementsByPath(
	IEnumerable<String^>^ paths, 
	AFObject^ relativeFrom
)
static member FindElementsByPath : 
        paths : IEnumerable<string> * 
        relativeFrom : AFObject -> AFKeyedResults<string, 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.

Return Value

Type: AFKeyedResultsString, AFElement
Returns a dictionary of results where the key is the specified path and its value is the AFElement resolved from the path.

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.

Important note Important
The elements must be checked in to the server using CheckIn before this method can resolve the path to the object.

Version Information

AFSDK


See Also

In This Topic
TitleResults for “How to create a CRG?”Also Available in