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

AF SDK Reference

AFAttributeList Constructor (IEnumerable(String), AFObject)

AFAttributeList Constructor (IEnumerable(String), AFObject)

  • Last UpdatedNov 18, 2025
  • 3 minute read
AFAttributeList Constructor (IEnumerable(String), AFObject)
Initializes a new instance of the AFAttributeList collection with the items identified by the path strings.

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

Syntax

public AFAttributeList(
	IEnumerable<string> paths,
	AFObject relativeFrom
)
Public Sub New ( 
	paths As IEnumerable(Of String),
	relativeFrom As AFObject
)

Dim paths As IEnumerable(Of String)
Dim relativeFrom As AFObject

Dim instance As New AFAttributeList(paths, relativeFrom)
public:
AFAttributeList(
	IEnumerable<String^>^ paths, 
	AFObject^ relativeFrom
)
new : 
        paths : IEnumerable<string> * 
        relativeFrom : AFObject -> AFAttributeList

Parameters

paths
Type: System.Collections.GenericIEnumerableString
The collection of AFAttribute paths used to initialize this list. Each of the path names may be relative to the specified object, a fully qualified path, or a dynamic attribute path. See Path Syntax for more information.
relativeFrom
Type: OSIsoft.AFAFObject
Specifies the object that the paths may be relative to. For dynamic attributes, this parameter must indicate an AFDatabase or the dynamic attribute will not be associated with an AFDatabase.

Remarks

This collection is a user-defined list of attributes which can contain a mixture of AFAttribute objects from different elements. This is useful for efficient gathering of attribute values. The list is initialized with the list of AFAttribute 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