Skip to main content

ModelCenter APIs 2025 R2

SaveContext

Last update: 16.07.2025

public class SaveContext : PHXCOMObject

Class for generically saving and loading files in ModelCenter.

Author

Boutwell, 1/2014

Functions

Name Summary
close public close()
***************************************************************************** Closes the save context.
disableGC public disableGC(gc: Boolean)
If true, prevents releaseObjects from doing anything.
getSaveLocation public getSaveLocation(): String
***************************************************************************** Gets the disk location this save context saves.
release public release()
Releases the COM reference to ModelCenter for this object.
releaseObjects public releaseObjects()
This function attempts to release any COM resources left behind from objects which have been finalized but release() was never called on them.
restoreFile public restoreFile(fileID: String, targetLocation: String): Boolean
***************************************************************************** Restores the file by ID to the given location.
restoreFileStream public restoreFileStream(fileID: String): Any
***************************************************************************** Gets a stream that can be used for restoring a file saved into the context with the given ID.
saveFile public saveFile(sourceLocation: String, context: String): Boolean
***************************************************************************** Save a file into the context.
saveFileStream public saveFileStream(context: String): Any
***************************************************************************** Gets a stream that can be used for saving a file to the context.
setReferenceDebugMode public setReferenceDebugMode(on: Boolean)
When set to true, the system will keep a list of active COM objects that are allocated but not yet released since this method was invoked.

Connect with Ansys