AFAttributeList.Add Method (IEnumerable(String), AFObject, IDictionary(String, String))
- 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 and returns the list of errors.
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, out IDictionary<string, string> errors )
Public Sub Add ( paths As IEnumerable(Of String), relativeFrom As AFObject, <OutAttribute> ByRef errors As IDictionary(Of String, String) ) Dim instance As AFAttributeList Dim paths As IEnumerable(Of String) Dim relativeFrom As AFObject Dim errors As IDictionary(Of String, String) instance.Add(paths, relativeFrom, errors)
public: void Add( IEnumerable<String^>^ paths, AFObject^ relativeFrom, [OutAttribute] IDictionary<String^, String^>^% errors )
member Add : paths : IEnumerable<string> * relativeFrom : AFObject * errors : IDictionary<string, string> byref -> 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. - errors
- Type: System.Collections.GenericIDictionaryString, String
If there are any errors finding the specified attributes, then this returned dictionary has the path as the key and the corresponding error message as the value.
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. |