Repository.BlockSim.GetRBDBlockData: Difference between revisions
Jump to navigation
Jump to search
Kate Racaza (talk | contribs) No edit summary |
Kate Racaza (talk | contribs) No edit summary |
||
Line 1: | Line 1: | ||
{{Template:API}}{{Template:APIBreadcrumb}} | {{Template:API}}{{Template:APIBreadcrumb|.[[Repository Class|Repository]]}} | ||
{{ | |||
<onlyinclude>Returns an '''[[RBDBlockData Class|RBDBlockData]]''' object that represents the properties of a BlockSim block.</onlyinclude> | |||
== Syntax == | |||
'''.BlockSim.GetRBDBlockData'''(''DiagramID'', ''BlockID'') | |||
===Parameters=== | |||
''DiagramID'' | |||
:Required. Integer. The numeric ID of the reliability block diagram (RBD) or fault tree. | |||
''BlockID'' | |||
:Required. Integer. The numeric ID of the block. | |||
==Example== | |||
'''VBA''' | |||
{{APIComment|'Connect to a Synthesis repository.}} | |||
{{APIPrefix|Dim}} MyRepository {{APIPrefix|As New}} Repository | |||
MyRepository.ConnectToAccessRepository({{APIString|"C:\RSRepository1.rsr10"}}) | |||
{{APIComment|'Connect to a project that contains a BlockSim diagram.}} | |||
MyRepository.Project.SetCurrentProject(1) | |||
{{APIComment|'Declare an RBDBlockData object.}} | |||
{{APIPrefix|Dim}} ABlock {{APIPrefix|As}} RBDBlockData | |||
{{APIComment|'Get block #1 from diagram #21 in the project.}} | |||
{{APIPrefix|Set}} ABlock = MyRepository.BlockSim.GetRBDBlockData(21, 1) | |||
{{APIComment|'Display the block's properties.}} | |||
{{APIPrefix|Dim}} BlockID {{APIPrefix|As}} Integer | |||
{{APIPrefix|Dim}} BlockType {{APIPrefix|As}} BlockDataType | |||
{{APIPrefix|Dim}} DiagramID {{APIPrefix|As}} Integer | |||
{{APIPrefix|Dim}} DisplayName {{APIPrefix|As}} String | |||
{{APIPrefix|Dim}} URDID {{APIPrefix|As}} Integer | |||
BlockID = ABlock.BlockID | |||
BlockType = ABlock.BlockType | |||
DiagramID = ABlock.DiagramID | |||
DisplayName = ABlock.DisplayName | |||
URDID = ABlock.URDID | |||
MsgBox({{APIString|"Block ID: "}} & BlockID & vbNewLine & _ | |||
{{APIString|"Block Type: "}} & BlockType & vbNewLine & _ | |||
{{APIString|"Diagram ID: "}} & DiagramID & vbNewLine & _ | |||
{{APIString|"Display Name: "}} & DisplayName & vbNewLine & _ | |||
{{APIString|"URD ID: "}} & URDID) | |||
'''VB.NET''' | |||
{{APIComment|'Connect to a Synthesis repository.}} | |||
{{APIPrefix|Dim}} MyRepository {{APIPrefix|As New}} Repository | |||
MyRepository.ConnectToAccessRepository({{APIString|"C:\RSRepository1.rsr10"}}) | |||
{{APIComment|'Connect to a project that contains a BlockSim diagram.}} | |||
MyRepository.Project.SetCurrentProject(1) | |||
{{APIComment|'Declare an RBDBlockData object.}} | |||
{{APIPrefix|Dim}} ABlock {{APIPrefix|As}} RBDBlockData | |||
{{APIComment|'Get block #1 from diagram #21 in the project.}} | |||
ABlock = MyRepository.BlockSim.GetRBDBlockData(21, 1) | |||
{{APIComment|'Display the block's properties.}} | |||
MsgBox({{APIString|"Block ID: "}} & ABlock.BlockID & vbNewLine & | |||
{{APIString|"Block Type: "}} & ABlock.BlockType & vbNewLine & | |||
{{APIString|"Diagram ID: "}} & ABlock.DiagramID & vbNewLine & | |||
{{APIString|"Display Name: "}} & ABlock.DisplayName & vbNewLine & | |||
{{APIString|"URD ID: "}} & ABlock.URDID) |
Latest revision as of 23:30, 6 September 2016
Member of: SynthesisAPI.Repository
Returns an RBDBlockData object that represents the properties of a BlockSim block.
Syntax
.BlockSim.GetRBDBlockData(DiagramID, BlockID)
Parameters
DiagramID
- Required. Integer. The numeric ID of the reliability block diagram (RBD) or fault tree.
BlockID
- Required. Integer. The numeric ID of the block.
Example
VBA 'Connect to a Synthesis repository. Dim MyRepository As New Repository MyRepository.ConnectToAccessRepository("C:\RSRepository1.rsr10") 'Connect to a project that contains a BlockSim diagram. MyRepository.Project.SetCurrentProject(1) 'Declare an RBDBlockData object. Dim ABlock As RBDBlockData 'Get block #1 from diagram #21 in the project. Set ABlock = MyRepository.BlockSim.GetRBDBlockData(21, 1) 'Display the block's properties. Dim BlockID As Integer Dim BlockType As BlockDataType Dim DiagramID As Integer Dim DisplayName As String Dim URDID As Integer BlockID = ABlock.BlockID BlockType = ABlock.BlockType DiagramID = ABlock.DiagramID DisplayName = ABlock.DisplayName URDID = ABlock.URDID MsgBox("Block ID: " & BlockID & vbNewLine & _ "Block Type: " & BlockType & vbNewLine & _ "Diagram ID: " & DiagramID & vbNewLine & _ "Display Name: " & DisplayName & vbNewLine & _ "URD ID: " & URDID)
VB.NET 'Connect to a Synthesis repository. Dim MyRepository As New Repository MyRepository.ConnectToAccessRepository("C:\RSRepository1.rsr10") 'Connect to a project that contains a BlockSim diagram. MyRepository.Project.SetCurrentProject(1) 'Declare an RBDBlockData object. Dim ABlock As RBDBlockData 'Get block #1 from diagram #21 in the project. ABlock = MyRepository.BlockSim.GetRBDBlockData(21, 1) 'Display the block's properties. MsgBox("Block ID: " & ABlock.BlockID & vbNewLine & "Block Type: " & ABlock.BlockType & vbNewLine & "Diagram ID: " & ABlock.DiagramID & vbNewLine & "Display Name: " & ABlock.DisplayName & vbNewLine & "URD ID: " & ABlock.URDID)