AFAttributeTemplate.FindAttributeTemplate Method (String, AFObject)
- Last UpdatedNov 18, 2025
- 2 minute read
- PI System
- AF SDK 2024 R2
- Developer
Retrieves the AFAttributeTemplate object identified by the path string relative to
the specified object.
Namespace: OSIsoft.AF.Asset
Assembly: OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182
Syntax
public static AFAttributeTemplate FindAttributeTemplate( string path, AFObject relativeFrom )
Public Shared Function FindAttributeTemplate ( path As String, relativeFrom As AFObject ) As AFAttributeTemplate Dim path As String Dim relativeFrom As AFObject Dim returnValue As AFAttributeTemplate returnValue = AFAttributeTemplate.FindAttributeTemplate(path, relativeFrom)
public: static AFAttributeTemplate^ FindAttributeTemplate( String^ path, AFObject^ relativeFrom )
static member FindAttributeTemplate : path : string * relativeFrom : AFObject -> AFAttributeTemplate
Parameters
- path
- Type: SystemString
A string containing a pathname that is relative to the specified AFAttributeTemplate, or a fully qualified path. See Path Syntax for more information. - relativeFrom
- Type: OSIsoft.AFAFObject
Specifies the object that the path was retrieved from. The query date of this object will be used where applicable. If this parameter is an AFElementTemplate and a relative path is specified, then the BaseTemplate is also searched.
Return Value
Type: AFAttributeTemplateReturns the AFAttributeTemplate identified by the path.
Remarks
A path to the AFAttributeTemplate can be obtained by calling one of the GetPath Overload methods.
This method is similar to the FindObject(String) method, but will only return an AFAttributeTemplate. When the path only indicates a path to an element template, this routine will return the DefaultAttribute of that element template (or its base template).
Note that unlike the AFAttributeTemplates collection of an AFElementTemplate, this routine will find attribute templates that are defined in base ElementTemplate(s) of the specified relativeFrom parameter.