AFLibraries.Add Method (AFDatabase, String)
- Last UpdatedNov 18, 2025
- 2 minute read
- PI System
- AF SDK 2024 R2
- Developer
Creates a library from the contents of the specified database.
Namespace: OSIsoft.AF
Assembly: OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182
Syntax
public AFLibrary Add( AFDatabase database, string name )
Public Function Add ( database As AFDatabase, name As String ) As AFLibrary Dim instance As AFLibraries Dim database As AFDatabase Dim name As String Dim returnValue As AFLibrary returnValue = instance.Add(database, name)
public: AFLibrary^ Add( AFDatabase^ database, String^ name )
member Add : database : AFDatabase * name : string -> AFLibrary
Parameters
- database
- Type: OSIsoft.AFAFDatabase
The AFDatabase to export as a library. All objects in the database will be exported. The database's description will be used as the default value for the new library's description. - name
- Type: SystemString
The name to be used for the exported library. If the name is or empty, then the name will default to the name of the specified database. See the ValidateName(String, String) method for a description of what is valid when setting the name of the object.
Return Value
Type: AFLibraryReturns the newly created library.
Remarks
Note that all objects in the database, excluding transfers and cases, will be
placed into the library. To update a library that already exists, the existing library
must first be removed and then added back with the new updates.