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.
- block
- Block to add to diagram.
- x
- Location on the x-axis to place block on the diagram.
- y
- Location on the y-axis to place block on the diagram.
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)