Repository.BlockSim.ImportBlockSimXMLFile: Difference between revisions

From ReliaWiki
Jump to navigation Jump to search
Line 17: Line 17:
  {{APIPrefix|Dim}}Success{{APIPrefix|As Boolean}}={{APIPrefix|False}}
  {{APIPrefix|Dim}}Success{{APIPrefix|As Boolean}}={{APIPrefix|False}}
   Success = MyRepository.[[Repository.ConnectToSQLRepository|ConnectToSQLRepository]]("SQLServerPath", "SQLDatabaseName")
   Success = MyRepository.[[Repository.ConnectToSQLRepository|ConnectToSQLRepository]]("SQLServerPath", "SQLDatabaseName")
{{APIComment|'Set a first available project as current.}}
  MyRepository.Project.SetCurrentProject(0)
   
   
  '{{APIComment|Import the XML File to the Synthesis repository.}}
  '{{APIComment|Import the XML File to the Synthesis repository.}}
  {{APIPrefix|Dim}}SuccessImportXML{{APIPrefix|As Boolean}}
  {{APIPrefix|Dim}}SuccessImportXML{{APIPrefix|As Boolean}}
   SuccessImportXML = MyRepository.BlockSim.ImportBlockSimXMLFile("XMLFilePath")
   SuccessImportXML = MyRepository.BlockSim.ImportBlockSimXMLFile("XMLFilePath")

Revision as of 20:54, 22 May 2015


This Synthesis API allows the programmer to import XML file into a current project of BlockSim. The file must XML format supported by BlockSim.

Syntax

  • ImportBlockSimXMLFile( XMLFile As String ) As Boolean

Parameters

XMLFile: The path for the XML file to import.

Returns True if successful, otherwise returns False.

Usage Example

' Declare a new repository connection class. 
Private WithEvents MyRepository As New Repository

' Connect to the Synthesis repository. 
DimSuccessAs Boolean=False
 Success = MyRepository.ConnectToSQLRepository("SQLServerPath", "SQLDatabaseName")

 'Set a first available project as current. 
 MyRepository.Project.SetCurrentProject(0)

' Import the XML File to the Synthesis repository. 
DimSuccessImportXMLAs Boolean
 SuccessImportXML = MyRepository.BlockSim.ImportBlockSimXMLFile("XMLFilePath")