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

AF SDK Reference

AFAttribute Constructor (String)

  • Last UpdatedNov 18, 2025
  • 2 minute read
AFAttribute Constructor (String)
Dynamically create an AFAttribute that is not associated with an AFBaseElement or PISystem and has an AFDataReference configured from the specified dynamic attribute path.

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

Syntax

public AFAttribute(
	string path
)
Public Sub New ( 
	path As String
)

Dim path As String

Dim instance As New AFAttribute(path)
public:
AFAttribute(
	String^ path
)
new : 
        path : string -> AFAttribute

Parameters

path
Type: SystemString
A string containing the dynamic attribute path used to specify the AFDataReference and its configuration. If , then the DataReferencePlugIn and ConfigString properties can be configured to obtain values using the DataReference.

Remarks

The dynamically created AFAttribute is not associated with an AFBaseElement or AFDatabase. Therefore, the DefaultPISystem will be used to load the DataReferencePlugIn specified by the path. A dynamically created AFAttribute cannot be persisted to the server.

See AFAttribute(AFDatabase, String) for more information.

Caution note Caution
A dynamically created attribute should not contain any substitution strings in its configuration that are relative references to the attribute. For example, %ELEMENT%, %\ELEMENTID%, and |%ATTRIBUTE% will all return an empty string. Also, %ATTRIBUTEID% will return the dynamically generated ID of the attribute and will probably not be the desired value.
Note Notes to Callers
If the specified path is a dynamic PIPoint path, this method will NOT validate that the PIPoint exists. The FindAttribute(String, AFObject) method with a path parameter will validate that the PIPoint exists.

Version Information

AFSDK


See Also

In This Topic
TitleResults for “How to create a CRG?”Also Available in