AFCase.Layers Property
- Last UpdatedNov 18, 2025
- 2 minute read
- PI System
- AF SDK 2024 R2
- Developer
Namespace: OSIsoft.AF.Analysis
Assembly: OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182
Syntax
public AFLayers Layers { get; }
Public ReadOnly Property Layers As AFLayers Get Dim instance As AFCase Dim value As AFLayers value = instance.Layers
public: property AFLayers^ Layers { AFLayers^ get (); }
member Layers : AFLayers with get
Property Value
Type: AFLayersCollection of AFLayers that keep track of the active layers within the model when a case analysis is run.
Remarks
When the case is created, this collection is initialized to the active layers of the previous case. If the previous case does not exist, then it is initialized to all the layers of the AFModel. Use the AFLayers.Add method to add layers and the AFLayers.Remove Overload methods to remove layers. Only the elements that either do not have any layers defined or have been associated with one of the AFLayer objects specified in this collection are active for the case. This means that an error is returned if the AFAttribute.GetValue Overload method is called (using the case as the context) for an element that is inactive, i.e. not included on any of the specified layers. The only exception is when the model does not have any layers defined. When the model does not have any layers defined, then all elements are considered active.
After adding or removing layers from this collection, you should call the CollectElements method to update the Elements collection of active elements based upon the changes.