AFAnalyses.Add Method (String, AFAnalysisTemplate)
- Last UpdatedNov 18, 2025
- 2 minute read
- PI System
- AF SDK 2024 R2
- Developer
The Add method creates a new object and adds it to the collection.
Namespace: OSIsoft.AF.Analysis
Assembly: OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182
Syntax
public AFAnalysis Add( string name, AFAnalysisTemplate template )
Public Function Add ( name As String, template As AFAnalysisTemplate ) As AFAnalysis Dim instance As AFAnalyses Dim name As String Dim template As AFAnalysisTemplate Dim returnValue As AFAnalysis returnValue = instance.Add(name, template)
public: AFAnalysis^ Add( String^ name, AFAnalysisTemplate^ template )
member Add : name : string * template : AFAnalysisTemplate -> AFAnalysis
Parameters
- name
- Type: SystemString
The name for the new object, which 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.AnalysisAFAnalysisTemplate
The template that is to be used to create the new AFAnalysis object. If , then the analysis is created without a template and properties normally defined by the template will be defined by the analysis instead.
Return Value
Type: AFAnalysisReturns the newly created object that was added to the collection.
Remarks
The new object will be created with the specified name. All other
properties of the object will be set to their default value.
Version Information
AFSDK
Supported in: 3.1.1, 3.1.0, 3.0.2, 3.0.1, 3.0.0, 2.10.11, 2.10.5, 2.10.0, 2.10, 2.9.5, 2.9, 2.8.5, 2.8, 2.7.5, 2.7, 2.6Obsolete (compiler warning) in 2.5
Obsolete (compiler warning) in 2.4