Repository.BlockSim.ExportBlockSimXMLFile: Difference between revisions

From ReliaWiki
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
{{Template:APIClass|Repository Class|Repository}}
{{Template:API}}{{Template:APIBreadcrumb|10|.[[Repository Class|Repository]]}}
This Synthesis API allows the programmer to export XML files out of a current project of BlockSim.


== Syntax  ==
*ExportBlockSimXMLFile( FileName {{APIPrefix|As String}} ) {{APIPrefix|As Boolean}}


Parameters
<onlyinclude>Exports data from a BlockSim project to a new XML file. Returns a '''Boolean''' value; when true, indicates a successful export.</onlyinclude>
:''FileName'': XML file name.
In BlockSim, the XML files include the block properties and information on how the blocks are connected in a reliability block diagram or fault tree diagram. Data on visual aspects, such as diagram style settings, block style settings, etc., are not included.


{{Template:BooleanReturn.Cmt}}
== Syntax ==
'''.BlockSim.ExportBlockSimXMLFile'''(''FileName'')


== Usage Example ==
=== Parameters ===
'{{APIComment|Declare a new repository connection class.}}
''FileName''
  {{APIPrefix|Private WithEvents MyRepository As New Repository}}
:String. The name for the new XML file.
 
 
== Example ==
This example assumes that reliability block diagrams exist in the first available project in the repository.
  '''VBA|VB.NET'''
   
   
  '{{APIComment|Connect to the Synthesis repository.}}
  {{APIComment|'Add code to connect to a Synthesis repository.}}
{{APIPrefix|Dim}}Success{{APIPrefix|As Boolean}}={{APIPrefix|False}}
  {{APIPrefix|Dim}} MyRepository {{APIPrefix|As New}} Repository
  Success = MyRepository.[[Repository.ConnectToSQLRepository|ConnectToSQLRepository]]("SQLServerPath", "SQLDatabaseName")
  {{APIComment|...}}
   
   
  {{APIComment|'Set a first available project as current.}}
  MyRepository.Project.SetCurrentProject(0)
  {{APIComment|'Export the data from project #1 in the repository.}}
 
  MyRepository.Project.SetCurrentProject(1)
'{{APIComment|Export the XML File from the current project.}}
  MyRepository.BlockSim.ExportBlockSimXMLFile({{APIString|"MyBlockSimData.xml"}})
{{APIPrefix|Dim}}SuccessExportXML{{APIPrefix|As Boolean}}
  SuccessExportXML = MyRepository.BlockSim.ExportBlockSimXMLFile("XML_File_Name")

Revision as of 21:17, 21 July 2015

APIWiki.png


Member of: SynthesisAPI10.Repository


Exports data from a BlockSim project to a new XML file. Returns a Boolean value; when true, indicates a successful export.

In BlockSim, the XML files include the block properties and information on how the blocks are connected in a reliability block diagram or fault tree diagram. Data on visual aspects, such as diagram style settings, block style settings, etc., are not included.

Syntax

.BlockSim.ExportBlockSimXMLFile(FileName)

Parameters

FileName

String. The name for the new XML file.


Example

This example assumes that reliability block diagrams exist in the first available project in the repository.

VBA|VB.NET 

 'Add code to connect to a Synthesis repository. 
  Dim MyRepository As New Repository
  ... 


 'Export the data from project #1 in the repository. 
  MyRepository.Project.SetCurrentProject(1)
  MyRepository.BlockSim.ExportBlockSimXMLFile("MyBlockSimData.xml")