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

AF SDK Reference

AFEventFrames.Add Method (String, AFElementTemplate, AFReferenceType)

AFEventFrames.Add Method (String, AFElementTemplate, AFReferenceType)

  • Last UpdatedNov 18, 2025
  • 3 minute read
AFEventFrames.Add Method (String, AFElementTemplate, AFReferenceType)
This method is used to create a new AFEventFrame based upon the specified template and reference type.

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

Syntax

public AFEventFrame Add(
	string name,
	AFElementTemplate template,
	AFReferenceType refType
)
Public Function Add ( 
	name As String,
	template As AFElementTemplate,
	refType As AFReferenceType
) As AFEventFrame

Dim instance As AFEventFrames
Dim name As String
Dim template As AFElementTemplate
Dim refType As AFReferenceType
Dim returnValue As AFEventFrame

returnValue = instance.Add(name, template, 
	refType)
public:
AFEventFrame^ Add(
	String^ name, 
	AFElementTemplate^ template, 
	AFReferenceType^ refType
)
member Add : 
        name : string * 
        template : AFElementTemplate * 
        refType : AFReferenceType -> AFEventFrame 

Parameters

name
Type: SystemString
The name for the new AFEventFrame object. The name must be unique within the collection. If the name ends with an asterisk (*), then a unique name will be generated based on the supplied name. See the ValidateName(String, String) method for a description of what is valid when setting the name of the object.
template
Type: OSIsoft.AF.AssetAFElementTemplate
The template that is to be used to create the new AFEventFrame object. If , then the event frame is created without a template and properties normally defined by the template will be defined by the event frame instead.
refType
Type: OSIsoft.AF.AssetAFReferenceType
The AFReferenceType specifies the hierarchical relationship between the newly created event frame and the event frame which own this collection of event frames. The default reference type is the standard Parent-Child reference type.

Return Value

Type: AFEventFrame
Returns the newly added AFEventFrame object.

Remarks

The type of AFEventFrame created by this method is determined by the template's InstanceType property. Currently, the only type supported is AFEventFrame.

When an AFElementTemplate is not specified, properties that are normally defined by the template are defined by the event frame instead. When a template is specified, the default value of the Description property of the new event frame is the same as the description of the template; however, it can be changed by the user. All other properties are defined by the template and cannot be modified without changing the template.

When an AFReferenceType is not specified, the new AFEventFrame is added to this collection using the default AFReferenceType. For the default view, the default AFReferenceType is the standard Parent-Child reference type.

To create a new or existing child event frame of another event frame, use one of the Add Overload methods the event frame's AFEventFrame.EventFrames collection. If the parent event frame is temporary (see IsTemporary), then the new child event frame will also be temporary.

Important note Important

There can only be a single hierarchical relationship between two event frames. This means that you cannot insert an existing event frame into an event frames collection that already contains that event frame.

There is a restriction that allows an event frame to have only two relationships to another event frame and their AFReferenceStrength cannot be Composition. This means that an event frame can have a maximum of two parents.

Version Information

AFSDK


See Also

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