Repository.BlockSim.ExportBlockSimXMLFile: Difference between revisions

From ReliaWiki
Jump to navigation Jump to search
mNo edit summary
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Template:API}}{{Template:APIBreadcrumb|.[[Repository Class|Repository]]}}
{{Template:API}}{{Template:APIBreadcrumb|.[[Repository Class|Repository]]}}


<onlyinclude>Exports data from a BlockSim project to a new XML file. Returns a '''Boolean''' value; when true, indicates a successful export.</onlyinclude>
 
<onlyinclude>Exports data from the current BlockSim project to a new XML file. Returns a '''Boolean''' value; when true, indicates a successful export.</onlyinclude>
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.
 
 
'''Remarks''': The XML file can 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 supported.


== Syntax ==
== Syntax ==
Line 17: Line 19:
  '''VBA|VB.NET'''  
  '''VBA|VB.NET'''  
   
   
  {{APIComment|'Add code to connect to a Synthesis repository.}}
  {{APIComment|'Declare a new Repository object and connect to a Synthesis repository.}}
   {{APIPrefix|Dim}} MyRepository {{APIPrefix|As New}} Repository
   {{APIPrefix|Dim}} MyRepository {{APIPrefix|As New}} Repository
  {{APIComment|...}}
  MyRepository.ConnectToAccessRepository({{APIString|"C:\RSRepository1.rsr10"}})
 
  {{APIComment|'Export the data from project #1 in the repository. Name the file "MyBlockSimData.xml" and save it in the C: drive.}}
  {{APIComment|'Export the data from project #1 in the repository. Name the file "MyBlockSimData.xml" and save it in the C: drive.}}
   MyRepository.Project.SetCurrentProject(1)
   MyRepository.Project.SetCurrentProject(1)
   MyRepository.BlockSim.ExportBlockSimXMLFile({{APIString|"C:\MyBlockSimData.xml"}})
   MyRepository.BlockSim.ExportBlockSimXMLFile({{APIString|"C:\MyBlockSimData.xml"}})

Latest revision as of 20:31, 18 August 2016

APIWiki.png


Member of: SynthesisAPI.Repository


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


Remarks: The XML file can 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 supported.

Syntax

.BlockSim.ExportBlockSimXMLFile(FileName)

Parameters

FileName

Required. String. The save location and 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 

 'Declare a new Repository object and connect to a Synthesis repository. 
  Dim MyRepository As New Repository
  MyRepository.ConnectToAccessRepository("C:\RSRepository1.rsr10")
 
 'Export the data from project #1 in the repository. Name the file "MyBlockSimData.xml" and save it in the C: drive. 
  MyRepository.Project.SetCurrentProject(1)
  MyRepository.BlockSim.ExportBlockSimXMLFile("C:\MyBlockSimData.xml")