AFAttribute.FindAttribute Method (AFBaseElement, Guid)
- Last UpdatedNov 18, 2025
- 2 minute read
- PI System
- AF SDK 2024 R2
- Developer
Retrieves the AFAttribute with the specified unique identifier.
Namespace: OSIsoft.AF.Asset
Assembly: OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182
Syntax
public static AFAttribute FindAttribute( AFBaseElement element, Guid id )
Public Shared Function FindAttribute ( element As AFBaseElement, id As Guid ) As AFAttribute Dim element As AFBaseElement Dim id As Guid Dim returnValue As AFAttribute returnValue = AFAttribute.FindAttribute(element, id)
public: static AFAttribute^ FindAttribute( AFBaseElement^ element, Guid id )
static member FindAttribute : element : AFBaseElement * id : Guid -> AFAttribute
Parameters
- element
- Type: OSIsoft.AF.AssetAFBaseElement
The AFBaseElement to search for the AFAttribute identified by the specified id parameter. This method will return attributes marked as IsHidden or IsExcluded. - id
- Type: SystemGuid
The unique identifier of the desired AFAttribute or the unique identifier of the AFAttributeTemplate of the desired AFAttribute.
Return Value
Type: AFAttributeReturns the AFAttribute identified by the id in the specified element.
Remarks
This method will find the AFAttribute with the specified id
within the attribute hierarchy of the specified element. The specified
id can be the unique identifier of the desired AFAttribute
or the unique identifier of the AFAttributeTemplate of the desired
AFAttribute.