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

AF SDK Reference

AFBaseElement.CreateElementTemplate Method

  • Last UpdatedNov 18, 2025
  • 2 minute read
AFBaseElement.CreateElementTemplate Method
Create an AFElementTemplate based upon the element.

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

Syntax

public AFElementTemplate CreateElementTemplate(
	string name
)
Public Function CreateElementTemplate ( 
	name As String
) As AFElementTemplate

Dim instance As AFBaseElement
Dim name As String
Dim returnValue As AFElementTemplate

returnValue = instance.CreateElementTemplate(name)
public:
AFElementTemplate^ CreateElementTemplate(
	String^ name
)
member CreateElementTemplate : 
        name : string -> AFElementTemplate 

Parameters

name
Type: SystemString
The name for the created element template, which must be unique within the database's ElementTemplates 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.

Return Value

Type: AFElementTemplate
Returns the newly created AFElementTemplate.

Remarks

A new AFElementTemplate is created with the specified name. The configuration of the current element is used to configure the new element template and then removed from the current element.
Important note Important
This will automatically apply the changes to this element and the newly created template to the PI AF Server.

Version Information

AFSDK


See Also

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