AFCase Constructor (AFAnalysis, AFTime, AFTime, AFElementTemplate, Boolean)
- Last UpdatedNov 18, 2025
- 3 minute read
- PI System
- AF SDK 2024 R2
- Developer
Initializes a new temporary instance of an AFCase with specified start and end times and
AFElementTemplate.
Namespace: OSIsoft.AF.Analysis
Assembly: OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182
Syntax
public AFCase( AFAnalysis analysis, AFTime startTime, AFTime endTime, AFElementTemplate template, bool isTemporary )
Public Sub New ( analysis As AFAnalysis, startTime As AFTime, endTime As AFTime, template As AFElementTemplate, isTemporary As Boolean ) Dim analysis As AFAnalysis Dim startTime As AFTime Dim endTime As AFTime Dim template As AFElementTemplate Dim isTemporary As Boolean Dim instance As New AFCase(analysis, startTime, endTime, template, isTemporary)
public: AFCase( AFAnalysis^ analysis, AFTime startTime, AFTime endTime, AFElementTemplate^ template, bool isTemporary )
new : analysis : AFAnalysis * startTime : AFTime * endTime : AFTime * template : AFElementTemplate * isTemporary : bool -> AFCase
Parameters
- analysis
- Type: OSIsoft.AF.AnalysisAFAnalysis
The new AFCase is associated with the specified AFAnalysis. - startTime
- Type: OSIsoft.AF.TimeAFTime
The starting time for the case. - endTime
- Type: OSIsoft.AF.TimeAFTime
The ending time for the case. - template
- Type: OSIsoft.AF.AssetAFElementTemplate
The AFElementTemplate that is to be used to create a new instance of the AFCase object. This will override the template specified by the CaseTemplate property of the specified analysis. The specified template must have its InstanceType set to AFCase. If , then the CaseTemplate of the specified analysis will be used. - isTemporary
- Type: SystemBoolean
If , then a temporary AFCase is created. If , then a normal AFCase is created.
Remarks
The new temporary AFCase can be modified just like any other case, but the case cannot be saved. The case's result values are allowed to be published. A temporary case cannot be used to create another temporary case (using the CreateTemporary method) and it will not be returned by any of the FindCases Overload methods.
The case's StartTime and EndTime are initialized by the specified startTime and endTime parameters. The new case is defined to use the specified template.