bdeAddBlockToDiagram

Adds a block to a diagram. block is of type hwscpHyperBlock.

Syntax

bdeAddBlockToDiagram(diagram, block);

bdeAddBlockToDiagram(diagram, block, x, y);

Inputs

diagram
Diagram to add block to.
Type: diagram
block
Block to add to diagram.
Type: block
x
Location on the x-axis to place block on the diagram.
Type: double
y
Location on the y-axis to place block on the diagram.
Type: double

Examples

Clone the selected block in the current model:

          diagram = bdeGetCurrentDiagram();
          block = bdeGetSelectedBlock(diagram);
          clone = bdeCloneBlock(block);
          bdeAddBlockToDiagram(diagram, clone);
          bdeRedrawDiagram(diagram)
        
Add a super block with 1 input port:

d = bdeGetCurrentDiagram();
block=bdeCreateSuperBlock();
bdeAddBlockToDiagram(d,block);
d=bdeGetBlockDiagram(block);
b1=bdeCreateBlock('system/Ports/Input');
bdeAddBlockToDiagram(d,b1)