Repository Class: Difference between revisions

From ReliaWiki
Jump to navigation Jump to search
No edit summary
Line 37: Line 37:
{| {{APITable}}
{| {{APITable}}
|-
|-
| style="width: 240px;"|[[Repository.Model.GetAllModelsInfo|GetAllModelsInfo]]||{{:Repository.Model.GetAllModelsInfo}}
| style="width: 240px;"|[[Repository.Model.GetAllModels|GetAllModels]]||{{:Repository.Model.GetAllModels}}
|-
|[[Repository.Model.GetAllModels|GetAllModels]]||{{:Repository.Model.GetAllModels}}
|-
|-
|[[Repository.Model.AddModel|AddModel]]||{{:Repository.Model.AddModel}}
|[[Repository.Model.AddModel|AddModel]]||{{:Repository.Model.AddModel}}
Line 50: Line 48:
|-
|-
|[[Repository.Model.DeleteModel|DeleteModel]]||{{:Repository.Model.DeleteModel}}[[#Version Information|*]]
|[[Repository.Model.DeleteModel|DeleteModel]]||{{:Repository.Model.DeleteModel}}[[#Version Information|*]]
|-
|[[Repository.Model.GetAllModelsInfo|GetAllModelsInfo]]||This method has been deprecated, but remains as part of the object model for backward compatibility. Do not use it in new applications.
|}
|}



Revision as of 22:20, 24 July 2015

Template:InProgress

APIWiki.png


Member of: SynthesisAPI9


Represents a Synthesis repository. Use any of the first four methods to establish a connection to a Synthesis repository. Once you have a connection, you can use the methods in the Project, Unit, Model, etc. sections to read and write data to the repository.

Methods

Name Description
ConnectToRepository Connects to a standard or enterprise repository. Returns a Boolean value; when true, indicates a successful connection to the repository.
ConnectToAccessRepository Connects to a standard repository (cannot be used to connect to an enterprise repository). Returns a Boolean value; when true, indicates a successful connection to the repository.
ConnectToSQLRepository Connects to a SQL Server repository. Returns a Boolean value; when true, indicates a successful connection to the repository.
ConnectToOracleRepository Connects to an Oracle repository. Returns a Boolean value; when true, indicates a successful connection to the repository.
DisconnectFromRepository Disconnects from the current repository.

Project

Name Description
GetAllProjects Returns an array of NameIDPair objects that represent the name and ID pairs of the projects associated with the Repository object.
GetCurrentProject Returns a NameIDPair object that represents the name and ID pair of the current project.
SetCurrentProject Sets the current (active) project for the repository. Returns a Boolean value; when true, indicates a successful connection to that project.

Unit

Name Description
GetAllUnits Returns an array of UnitInfo objects that represent the units of measurement associated with the Repository object.

Model

Name Description
GetAllModels Returns an array of cModel objects that represent the model resources in the current project.
AddModel Adds a new model resource to the current project. Returns a Boolean value; when true, indicates a successful save.
UpdateModel Updates the properties of a given model resource in the current project. Returns a Boolean value; when true, indicates a successful update.
GetModel Returns a cModel object that represents a given model resource in the current project. Returns nothing if the model does not exist or is not in the current project.*
IsModelUsed Checks whether the model is used by other items in the project. Returns a Boolean value; when true, indicates that the model is in use.*
DeleteModel Deletes an unused model from the current project. Throws an exception if the model is in use. Returns a Boolean value; when true, indicates a successful deletion.*
GetAllModelsInfo This method has been deprecated, but remains as part of the object model for backward compatibility. Do not use it in new applications.

URD

Name Description
GetAllURDs Returns an array of cURD objects that represent the universal reliability definitions (URDs) in the current project.
AddURD Adds a new universal reliability definition (URD) resource to the current project. Returns a Boolean value; when true, indicates a successful save.
UpdateURD Updates the properties of a given URD resource in the current project. Returns a Boolean value; when true, indicates a successful update.
GetURD Returns a cURD object that represents a given URD resource in the current project. Returns nothing if the URD does not exist or is not in the current project.

Variable

Name Description
GetAllVariables Returns an array of cVariable objects that represent the variable resources in the current project.
AddVariable Adds a new variable resource to the current project. Returns a Boolean value; when true, indicates a successful save.
UpdateVariable Updates the properties of a given variable resource in the current project. Returns a Boolean value; when true, indicates a successful update.
GetVariable Returns a cVariable object that represents a given variable resource in the current project. Returns nothing if the variable does not exist or is not in the current project.*

Task

Name Description
GetAllCorrectiveTasks Returns an array of cCorrectiveTask objects that represent the corrective tasks in the current project.
AddCorrectiveTask Adds a new corrective task to the current project. Returns a Boolean value; when true, indicates a successful save.
UpdateCorrectiveTask Updates the properties of a given corrective task in the current project. Returns a Boolean value; when true, indicates a successful update.
GetCorrectiveTask Returns a cCorrectiveTask object that represents a given corrective task resource in the current project. Returns nothing if the task does not exist or is not in the current project.*
GetAllScheduledTasks Returns an array of cScheduledTask objects that represent the scheduled tasks in the current project.
AddScheduledTask Adds a new scheduled task to the current project. Returns a Boolean value; when true, indicates a successful save.
UpdateScheduledTask Updates the properties of a given scheduled task in the current project. Returns a Boolean value; when true, indicates a successful update.
GetScheduledTask Returns a cScheduledTask object that represents a given scheduled task resource in the current project. Returns nothing if the task does not exist or is not in the current project.*
GetAllTaskTypes Returns an array of TaskTypeInfo objects that represent the RCM++ or RBI task types associated with the Repository object.

Crew

Name Description
GetAllCrews Returns an array of cCrew objects that represent the crew resources in the current project.
AddCrew Adds a new crew resource to the current project. Returns a Boolean value; when true, indicates a successful save.
UpdateCrew Updates the properties of a given crew resource in the current project. Returns a Boolean value; when true, indicates a successful save.
GetCrew Returns a cCrew object that represents a given crew resource in the current project. Returns nothing if the crew does not exist or is not in the current project.*

Pool

Name Description
GetAllPools Returns an array of cPool objects that represent the spare part pools in the current project.
AddPool Adds a new spare part pool to the current project. Returns a Boolean value; when true, indicates indicates a successful save.
UpdatePool Updates the properties of a given spare part pool in the current project. Returns a Boolean value; when true, indicates a successful update.
GetPool Returns a cPool object that represents a given spare part pool resource in the current project. Returns nothing if the spare part pool does not exist or is not in the current project.*

Action

Name Description
GetAllActionsDictionary Returns a dictionary object that contains all available action resources in the current project. The dictionary syntax is Dictionary(Of Integer, cAction), where the ID numbers are the keys and the cAction objects that represent the action resources are the associated values. (.NET only) *
GetAllActions Returns an array of cAction objects that represent the action resources in the current project.
AddAction Adds a new action to the current project. The action description or name must be unique. Returns a Boolean value; when true, indicates a successful save.
UpdateAction Updates the properties of a given action resource in the current project. Returns a Boolean value; when true, indicates a successful update.
GetAction Returns a cAction object that represents a given action resource in the current project. Returns nothing if the action does not exist or is not in the current project.*

Control

Name Description
GetAllXfmeaControlsDictionary Returns a dictionary object that contains all available Xfmea controls in the current project. The dictionary syntax is Dictionary (Of Integer, cXfmeaControl), where the ID numbers are the keys and the cXfmeaControl objects that represent the controls are the associated values. (.NET only)*
GetAllXfmeaControls Returns an array of cXfmeaControl objects that represent the Xfmea controls in the current project.*
AddXfmeaControl Adds a new Xfmea control to the current project. Returns a Boolean value; when true, indicates a successful save.*
UpdateXfmeaControl Updates the properties of a given control resource in the current project. Returns a Boolean value; when true, indicates a successful update.*
GetXfmeaControl Returns a cXfmeaControl object that represents a given control resource in the current project. Returns nothing if the control does not exist or is not in the current project.*

BlockSim

Name Description
ImportBlockSimXMLFile Imports data from an XML file into the current BlockSim project. Returns a Boolean value; when true, indicates a successful import.
ExportBlockSimXMLFile Exports data from the current BlockSim project to a new XML file. Returns a Boolean value; when true, indicates a successful export.

Synthesis Data Warehouse

Name Description
SaveRawDataSet Adds a new Synthesis Data Warehouse (SDW) data collection to the associated Repository object. Returns a Boolean value; when true, indicates a successful save.

XFRACAS

Name Description
GetAllXFRACASEntities
ImportXFRACASXML Uploads an import file byte stream for processing and returns the system ID of the uploaded byte array.
ImportXFRACASXMLFile Uploads an import file for processing and returns the system ID of the uploaded XML file.
ImportXFRACASXMLString Uploads an import file string for processing and returns the system ID of the uploaded XML string.
SerializeXMLObjectToByteArray A helper function to create an array of bytes from a serializable XML object.
ProcessXfracasImports Runs the import process.
WriteMessageToDiagnosticsLog Writes a message to the diagnostics log
WriteExceptionToDiagnosticsLog Writes exception information to the diagnostics log
XFRACASCommandTimeout Gets or sets the wait time before terminating the attempt to execute an XFRACAS command. *
AddSystemMetric1 This can be used to insert reported run hours and the date of the reported run hours. *
AddSystemMetric2 This can be used to insert reported run hours, number of starts, and the date. *
AddSystemMetric3 This can be used to insert reported run hours, number of starts, kw run hours, and the date. *

Xfmea

Name Description
GetAllItemsInSystemHierarchyDictionary Returns a dictionary object that contains all available system hierarchy items in the current project. The dictionary syntax is Dictionary(Of Integer, XfmeaItem), where the ID numbers are the keys, and the XfmeaItem objects that represent the system hierarchy items are the associated values. (.NET only) *
GetAllItemsInSystemHierarchy Returns an array of XfmeaItem objects that represent the system hierarchy items in the current project. *
AddItemToSystemHierarchy Adds a new system hierarchy item to the current project. Returns a Boolean value; when true, indicates a successful save. *
UpdateItemInSystemHierarchy Updates the properties of a given system hierarchy item in the current project. Returns a Boolean value; when true, indicates a successful update. *
GetAllXfmeaFunctionsDictionary Returns a dictionary containing all XfmeaFunctions that belong to the item. The keys are the IDs of the XfmeaFunctions. *
GetAllXfmeaFunctions Returns an array containing all XfmeaFunctions that belong to the item. *
GetXfmeaFunction Returns XfmeaFunction with the provided ID. *
AddXfmeaFunction Adds a new XfmeaFunction in the repository. *
UpdateXfmeaFunction Updates the XfmeaFunction in the repository. *
GetAllXfmeaFailuresDictionary Returns a dictionary containing all XfmeaFailures that belong to the function. The keys are the IDs of the XfmeaFailures. *
GetAllXfmeaFailures Returns an array containing all XfmeaFailures that belong to the function. *
GetXfmeaFailure Returns XfmeaFailure with the provided ID. *
AddXfmeaFailure Adds a new XfmeaFailure in the repository. *
UpdateXfmeaFailure Updates the XfmeaFailure in the repository. *
GetAllXfmeaEffectsDictionary Returns a dictionary containing all XfmeaEffects that belong to the failure. The keys are the IDs of the XfmeaEffects. *
GetAllXfmeaEffects Returns an array containing all XfmeaEffects that belong to the failure. *
GetXfmeaEffect Returns XfmeaEffect with the provided ID. *
AddXfmeaEffect Adds a new XfmeaEffect in the repository. *
UpdateXfmeaEffect Updates the XfmeaEffect in the repository. *
GetAllXfmeaCausesDictionary Returns a dictionary containing all XfmeaCauses that belong to the failure. The keys are the IDs of the XfmeaCauses. *
GetAllXfmeaCauses Returns an array containing all XfmeaCauses that belong to the failure. *
GetXfmeaCause Returns XfmeaCause with the provided ID. *
AddXfmeaCause Adds a new XfmeaCause in the repository. *
UpdateXfmeaCause Updates the XfmeaCause in the repository. *

Properties

Name Description
EnforceRENOCompliance Template:InProgress
APIWiki.png


Member of: SynthesisAPI9


Represents a Synthesis repository. Use any of the first four methods to establish a connection to a Synthesis repository. Once you have a connection, you can use the methods in the Project, Unit, Model, etc. sections to read and write data to the repository.

Methods

Name Description
ConnectToRepository Connects to a standard or enterprise repository. Returns a Boolean value; when true, indicates a successful connection to the repository.
ConnectToAccessRepository Connects to a standard repository (cannot be used to connect to an enterprise repository). Returns a Boolean value; when true, indicates a successful connection to the repository.
ConnectToSQLRepository Connects to a SQL Server repository. Returns a Boolean value; when true, indicates a successful connection to the repository.
ConnectToOracleRepository Connects to an Oracle repository. Returns a Boolean value; when true, indicates a successful connection to the repository.
DisconnectFromRepository Disconnects from the current repository.

Project

Name Description
GetAllProjects Returns an array of NameIDPair objects that represent the name and ID pairs of the projects associated with the Repository object.
GetCurrentProject Returns a NameIDPair object that represents the name and ID pair of the current project.
SetCurrentProject Sets the current (active) project for the repository. Returns a Boolean value; when true, indicates a successful connection to that project.

Unit

Name Description
GetAllUnits Returns an array of UnitInfo objects that represent the units of measurement associated with the Repository object.

Model

Name Description
GetAllModels Returns an array of cModel objects that represent the model resources in the current project.
AddModel Adds a new model resource to the current project. Returns a Boolean value; when true, indicates a successful save.
UpdateModel Updates the properties of a given model resource in the current project. Returns a Boolean value; when true, indicates a successful update.
GetModel Returns a cModel object that represents a given model resource in the current project. Returns nothing if the model does not exist or is not in the current project.*
IsModelUsed Checks whether the model is used by other items in the project. Returns a Boolean value; when true, indicates that the model is in use.*
DeleteModel Deletes an unused model from the current project. Throws an exception if the model is in use. Returns a Boolean value; when true, indicates a successful deletion.*
GetAllModelsInfo This method has been deprecated, but remains as part of the object model for backward compatibility. Do not use it in new applications.

URD

Name Description
GetAllURDs Returns an array of cURD objects that represent the universal reliability definitions (URDs) in the current project.
AddURD Adds a new universal reliability definition (URD) resource to the current project. Returns a Boolean value; when true, indicates a successful save.
UpdateURD Updates the properties of a given URD resource in the current project. Returns a Boolean value; when true, indicates a successful update.
GetURD Returns a cURD object that represents a given URD resource in the current project. Returns nothing if the URD does not exist or is not in the current project.

Variable

Name Description
GetAllVariables Returns an array of cVariable objects that represent the variable resources in the current project.
AddVariable Adds a new variable resource to the current project. Returns a Boolean value; when true, indicates a successful save.
UpdateVariable Updates the properties of a given variable resource in the current project. Returns a Boolean value; when true, indicates a successful update.
GetVariable Returns a cVariable object that represents a given variable resource in the current project. Returns nothing if the variable does not exist or is not in the current project.*

Task

Name Description
GetAllCorrectiveTasks Returns an array of cCorrectiveTask objects that represent the corrective tasks in the current project.
AddCorrectiveTask Adds a new corrective task to the current project. Returns a Boolean value; when true, indicates a successful save.
UpdateCorrectiveTask Updates the properties of a given corrective task in the current project. Returns a Boolean value; when true, indicates a successful update.
GetCorrectiveTask Returns a cCorrectiveTask object that represents a given corrective task resource in the current project. Returns nothing if the task does not exist or is not in the current project.*
GetAllScheduledTasks Returns an array of cScheduledTask objects that represent the scheduled tasks in the current project.
AddScheduledTask Adds a new scheduled task to the current project. Returns a Boolean value; when true, indicates a successful save.
UpdateScheduledTask Updates the properties of a given scheduled task in the current project. Returns a Boolean value; when true, indicates a successful update.
GetScheduledTask Returns a cScheduledTask object that represents a given scheduled task resource in the current project. Returns nothing if the task does not exist or is not in the current project.*
GetAllTaskTypes Returns an array of TaskTypeInfo objects that represent the RCM++ or RBI task types associated with the Repository object.

Crew

Name Description
GetAllCrews Returns an array of cCrew objects that represent the crew resources in the current project.
AddCrew Adds a new crew resource to the current project. Returns a Boolean value; when true, indicates a successful save.
UpdateCrew Updates the properties of a given crew resource in the current project. Returns a Boolean value; when true, indicates a successful save.
GetCrew Returns a cCrew object that represents a given crew resource in the current project. Returns nothing if the crew does not exist or is not in the current project.*

Pool

Name Description
GetAllPools Returns an array of cPool objects that represent the spare part pools in the current project.
AddPool Adds a new spare part pool to the current project. Returns a Boolean value; when true, indicates indicates a successful save.
UpdatePool Updates the properties of a given spare part pool in the current project. Returns a Boolean value; when true, indicates a successful update.
GetPool Returns a cPool object that represents a given spare part pool resource in the current project. Returns nothing if the spare part pool does not exist or is not in the current project.*

Action

Name Description
GetAllActionsDictionary Returns a dictionary object that contains all available action resources in the current project. The dictionary syntax is Dictionary(Of Integer, cAction), where the ID numbers are the keys and the cAction objects that represent the action resources are the associated values. (.NET only) *
GetAllActions Returns an array of cAction objects that represent the action resources in the current project.
AddAction Adds a new action to the current project. The action description or name must be unique. Returns a Boolean value; when true, indicates a successful save.
UpdateAction Updates the properties of a given action resource in the current project. Returns a Boolean value; when true, indicates a successful update.
GetAction Returns a cAction object that represents a given action resource in the current project. Returns nothing if the action does not exist or is not in the current project.*

Control

Name Description
GetAllXfmeaControlsDictionary Returns a dictionary object that contains all available Xfmea controls in the current project. The dictionary syntax is Dictionary (Of Integer, cXfmeaControl), where the ID numbers are the keys and the cXfmeaControl objects that represent the controls are the associated values. (.NET only)*
GetAllXfmeaControls Returns an array of cXfmeaControl objects that represent the Xfmea controls in the current project.*
AddXfmeaControl Adds a new Xfmea control to the current project. Returns a Boolean value; when true, indicates a successful save.*
UpdateXfmeaControl Updates the properties of a given control resource in the current project. Returns a Boolean value; when true, indicates a successful update.*
GetXfmeaControl Returns a cXfmeaControl object that represents a given control resource in the current project. Returns nothing if the control does not exist or is not in the current project.*

BlockSim

Name Description
ImportBlockSimXMLFile Imports data from an XML file into the current BlockSim project. Returns a Boolean value; when true, indicates a successful import.
ExportBlockSimXMLFile Exports data from the current BlockSim project to a new XML file. Returns a Boolean value; when true, indicates a successful export.

Synthesis Data Warehouse

Name Description
SaveRawDataSet Adds a new Synthesis Data Warehouse (SDW) data collection to the associated Repository object. Returns a Boolean value; when true, indicates a successful save.

XFRACAS

Name Description
GetAllXFRACASEntities
ImportXFRACASXML Uploads an import file byte stream for processing and returns the system ID of the uploaded byte array.
ImportXFRACASXMLFile Uploads an import file for processing and returns the system ID of the uploaded XML file.
ImportXFRACASXMLString Uploads an import file string for processing and returns the system ID of the uploaded XML string.
SerializeXMLObjectToByteArray A helper function to create an array of bytes from a serializable XML object.
ProcessXfracasImports Runs the import process.
WriteMessageToDiagnosticsLog Writes a message to the diagnostics log
WriteExceptionToDiagnosticsLog Writes exception information to the diagnostics log
XFRACASCommandTimeout Gets or sets the wait time before terminating the attempt to execute an XFRACAS command. *
AddSystemMetric1 This can be used to insert reported run hours and the date of the reported run hours. *
AddSystemMetric2 This can be used to insert reported run hours, number of starts, and the date. *
AddSystemMetric3 This can be used to insert reported run hours, number of starts, kw run hours, and the date. *

Xfmea

Name Description
GetAllItemsInSystemHierarchyDictionary Returns a dictionary object that contains all available system hierarchy items in the current project. The dictionary syntax is Dictionary(Of Integer, XfmeaItem), where the ID numbers are the keys, and the XfmeaItem objects that represent the system hierarchy items are the associated values. (.NET only) *
GetAllItemsInSystemHierarchy Returns an array of XfmeaItem objects that represent the system hierarchy items in the current project. *
AddItemToSystemHierarchy Adds a new system hierarchy item to the current project. Returns a Boolean value; when true, indicates a successful save. *
UpdateItemInSystemHierarchy Updates the properties of a given system hierarchy item in the current project. Returns a Boolean value; when true, indicates a successful update. *
GetAllXfmeaFunctionsDictionary Returns a dictionary containing all XfmeaFunctions that belong to the item. The keys are the IDs of the XfmeaFunctions. *
GetAllXfmeaFunctions Returns an array containing all XfmeaFunctions that belong to the item. *
GetXfmeaFunction Returns XfmeaFunction with the provided ID. *
AddXfmeaFunction Adds a new XfmeaFunction in the repository. *
UpdateXfmeaFunction Updates the XfmeaFunction in the repository. *
GetAllXfmeaFailuresDictionary Returns a dictionary containing all XfmeaFailures that belong to the function. The keys are the IDs of the XfmeaFailures. *
GetAllXfmeaFailures Returns an array containing all XfmeaFailures that belong to the function. *
GetXfmeaFailure Returns XfmeaFailure with the provided ID. *
AddXfmeaFailure Adds a new XfmeaFailure in the repository. *
UpdateXfmeaFailure Updates the XfmeaFailure in the repository. *
GetAllXfmeaEffectsDictionary Returns a dictionary containing all XfmeaEffects that belong to the failure. The keys are the IDs of the XfmeaEffects. *
GetAllXfmeaEffects Returns an array containing all XfmeaEffects that belong to the failure. *
GetXfmeaEffect Returns XfmeaEffect with the provided ID. *
AddXfmeaEffect Adds a new XfmeaEffect in the repository. *
UpdateXfmeaEffect Updates the XfmeaEffect in the repository. *
GetAllXfmeaCausesDictionary Returns a dictionary containing all XfmeaCauses that belong to the failure. The keys are the IDs of the XfmeaCauses. *
GetAllXfmeaCauses Returns an array containing all XfmeaCauses that belong to the failure. *
GetXfmeaCause Returns XfmeaCause with the provided ID. *
AddXfmeaCause Adds a new XfmeaCause in the repository. *
UpdateXfmeaCause Updates the XfmeaCause in the repository. *

Properties

Name Description
EnforceRENOCompliance Template loop detected: Repository.EnforceRENOCompliance


Version Information

Methods and properties marked with an asterisk (*) require Synthesis API Version 10 or greater.

Important: If you have upgraded from Version 9 and have existing code written using Synthesis API version 9, you should modify your code. In Version 9, all methods existed in the Repository class, in Version 10 they were moved into sections, according to the object type they apply to. For instance, Repository.GetAllModels is now Repository.Model.GetAllModels; Repository.ImportBlockSimXMLFile is now Repository.BlockSim.ImportBlockSimXMLFile etc. The Version 9 methods still exist so your code is not broken, but they are deprecated and may be removed in future versions of the API.

Example

In this example, the API is used to connect to a repository, open the first available project in that repository, and then get the first available model in the project. It then calculates the reliability at a specified time, based on that model.

 'Declare a new repository connection object. 
 Dim MyRepository As New Repository
 
 'Connect to a Synthesis repository. 
 Dim Success As Boolean = False
 Success = MyRepository.ConnectToRepository("C:\Users\Name\Documents\ReliaSoft\Files\repository.rsr10")
 
 'Get a list of the names/IDs of projects in the connected repository. 
 Dim ListOfProjects() As NameIdPair
 ListOfProjects = MyRepository.Project.GetAllProjects()
 
 'Open the first project in the list. 
 MyRepository.Project.SetCurrentProject(ListOfProjects(0).ID)
 
 'Get a list of the names/IDs of models in the current project. 
 Dim ListOfModels() As NameIdPair
 ListOfModels = MyRepository.Model.GetAllModelsInfo()
 
 'Retrieve the first model in the list. 
 Dim AModel As cModel
 AModel = MyRepository.Model.GetModel(ListOfModels(0).ID)
 
 'Calculate the reliability at time = 50 and save the result. See Reliability. 
 Dim Rel As Double
 Rel = AModel.Reliability(50)
 
 'Disconnect from the repository. 
 MyRepository.DisconnectFromRepository()


Version Information

Methods and properties marked with an asterisk (*) require Synthesis API Version 10 or greater.

Important: If you have upgraded from Version 9 and have existing code written using Synthesis API version 9, you should modify your code. In Version 9, all methods existed in the Repository class, in Version 10 they were moved into sections, according to the object type they apply to. For instance, Repository.GetAllModels is now Repository.Model.GetAllModels; Repository.ImportBlockSimXMLFile is now Repository.BlockSim.ImportBlockSimXMLFile etc. The Version 9 methods still exist so your code is not broken, but they are deprecated and may be removed in future versions of the API.

Example

In this example, the API is used to connect to a repository, open the first available project in that repository, and then get the first available model in the project. It then calculates the reliability at a specified time, based on that model.

 'Declare a new repository connection object. 
 Dim MyRepository As New Repository
 
 'Connect to a Synthesis repository. 
 Dim Success As Boolean = False
 Success = MyRepository.ConnectToRepository("C:\Users\Name\Documents\ReliaSoft\Files\repository.rsr10")
 
 'Get a list of the names/IDs of projects in the connected repository. 
 Dim ListOfProjects() As NameIdPair
 ListOfProjects = MyRepository.Project.GetAllProjects()
 
 'Open the first project in the list. 
 MyRepository.Project.SetCurrentProject(ListOfProjects(0).ID)
 
 'Get a list of the names/IDs of models in the current project. 
 Dim ListOfModels() As NameIdPair
 ListOfModels = MyRepository.Model.GetAllModelsInfo()
 
 'Retrieve the first model in the list. 
 Dim AModel As cModel
 AModel = MyRepository.Model.GetModel(ListOfModels(0).ID)
 
 'Calculate the reliability at time = 50 and save the result. See Reliability. 
 Dim Rel As Double
 Rel = AModel.Reliability(50)
 
 'Disconnect from the repository. 
 MyRepository.DisconnectFromRepository()