AFAttributeList.Add Method (IEnumerable(String), AFObject)
- Last UpdatedNov 18, 2025
- 3 minute read
- PI System
- AF SDK 2024 R2
- Developer
Retrieves the AFAttribute objects identified by the path strings and
adds them to the collection.
Namespace: OSIsoft.AF.Asset
Assembly: OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182
Syntax
public void Add( IEnumerable<string> paths, AFObject relativeFrom )
Public Sub Add ( paths As IEnumerable(Of String), relativeFrom As AFObject ) Dim instance As AFAttributeList Dim paths As IEnumerable(Of String) Dim relativeFrom As AFObject instance.Add(paths, relativeFrom)
public: void Add( IEnumerable<String^>^ paths, AFObject^ relativeFrom )
member Add : paths : IEnumerable<string> * relativeFrom : AFObject -> unit
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. - 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
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.
| 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. |
| The ShowExcludedAttributes setting will determine if excluded attributes are returned when finding attributes by path. |
| 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. |