AFBaseElement.CreateElementTemplate Method
- Last UpdatedNov 18, 2025
- 2 minute read
- PI System
- AF SDK 2024 R2
- Developer
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: AFElementTemplateReturns 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.
| This will automatically apply the changes to this element and the newly created template to the PI AF Server. |