PISystem.GetObjectCounts Method
- Last UpdatedNov 18, 2025
- 2 minute read
- PI System
- AF SDK 2024 R2
- Developer
Gets the total number of objects by type in the database.
Namespace: OSIsoft.AF
Assembly: OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182
Syntax
public IDictionary<AFIdentity, long> GetObjectCounts( AFDatabase database )
Public Function GetObjectCounts ( database As AFDatabase ) As IDictionary(Of AFIdentity, Long) Dim instance As PISystem Dim database As AFDatabase Dim returnValue As IDictionary(Of AFIdentity, Long) returnValue = instance.GetObjectCounts(database)
public: IDictionary<AFIdentity, long long>^ GetObjectCounts( AFDatabase^ database )
member GetObjectCounts : database : AFDatabase -> IDictionary<AFIdentity, int64>
Parameters
- database
- Type: OSIsoft.AFAFDatabase
The AFDatabase for the object counts to be returned. If , then the object counts for all databases will be returned.
Return Value
Type: IDictionaryAFIdentity, Int64Returns a dictionary of the object counts using the object type's AFIdentity as the dictionary key.
Remarks
This method will return the total number of objects by type regardless of security
settings in the specified database. If no database is specified, then the total number
of objects in all databases will be returned. The counts for system-level objects are only
returned when there is no database specified.