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

AF SDK Reference

AFAnalysis.CreateAnalysisTemplate Method

  • Last UpdatedNov 18, 2025
  • 2 minute read
AFAnalysis.CreateAnalysisTemplate Method
Create an AFAnalysisTemplate based upon the analysis.

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

Syntax

public AFAnalysisTemplate CreateAnalysisTemplate(
	string name
)
Public Function CreateAnalysisTemplate ( 
	name As String
) As AFAnalysisTemplate

Dim instance As AFAnalysis
Dim name As String
Dim returnValue As AFAnalysisTemplate

returnValue = instance.CreateAnalysisTemplate(name)
public:
AFAnalysisTemplate^ CreateAnalysisTemplate(
	String^ name
)
member CreateAnalysisTemplate : 
        name : string -> AFAnalysisTemplate 

Parameters

name
Type: SystemString
The name for the created analysis template, which must be unique within the database's AnalysisTemplates 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: AFAnalysisTemplate
If the analysis is already created from an analysis template, then it will not do anything and just return the already configured Template. Otherwise, the newly created AFAnalysisTemplate is returned.

Remarks

A new AFAnalysisTemplate is created with the specified name. The configuration of the current analysis is used to configure the new analysis template and then removed from the current analysis.

If the analysis is already created from a Template, then this method does not make any changes and just returns the current Template.

Caution note Caution
This will automatically apply the changes to this analysis and the newly created template to the PI AF Server.

Version Information

AFSDK


See Also

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