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

AF SDK Reference

AFAttribute.FindAttributesByPath Method (IEnumerable(String), AFObject)

AFAttribute.FindAttributesByPath Method (IEnumerable(String), AFObject)

  • Last UpdatedNov 18, 2025
  • 4 minute read
AFAttribute.FindAttributesByPath Method (IEnumerable(String), AFObject)
Retrieves the AFAttribute 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, AFAttribute> FindAttributesByPath(
	IEnumerable<string> paths,
	AFObject relativeFrom
)
Public Shared Function FindAttributesByPath ( 
	paths As IEnumerable(Of String),
	relativeFrom As AFObject
) As AFKeyedResults(Of String, AFAttribute)

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

returnValue = AFAttribute.FindAttributesByPath(paths, 
	relativeFrom)
public:
static AFKeyedResults<String^, AFAttribute^>^ FindAttributesByPath(
	IEnumerable<String^>^ paths, 
	AFObject^ relativeFrom
)
static member FindAttributesByPath : 
        paths : IEnumerable<string> * 
        relativeFrom : AFObject -> AFKeyedResults<string, AFAttribute> 

Parameters

paths
Type: System.Collections.GenericIEnumerableString
The collection of paths used to locate the AFAttribute. Each of the path names may be relative to the specified object or a fully qualified path. The paths may reference attributes 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 or a path to a dynamic attribute that will not be associated with an AFDatabase.

Return Value

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

Remarks

This method can be used to find a list of AFAttribute objects from a list of object paths.

A path to the AFAttribute can be obtained by calling one of the GetPath Overload methods.

This method is similar to the FindObject(String) method, but will only resolve object paths to an AFAttribute. When the path only indicates a path to an element, this routine will return the DefaultAttribute of that element. See Path Syntax for a complete description of the path syntax.

Note Notes to Callers
If the specified path is a dynamic PIPoint path, this method will validate that the PIPoint exists. The AFAttribute(AFDatabase, String) constructor with a path parameter will not validate that the PIPoint exists.
Note Notes to Callers
The ShowExcludedAttributes setting will determine if excluded attributes are returned when finding attributes by path.

The performance of finding attributes 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 an element depth of 24 levels will execute slower.

Important note Important
The elements which own the attributes 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