Talk:Repository.BlockSim.GetRBDBlockData/Notes
Jump to navigation
Jump to search
DRAFT
Member of: SynthesisAPI.Repository
Returns an RBDBlockData object that represents the characteristics 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)