bdeReplaceBlock
Replaces blockToReplace with a copy of replacement in diagram. blockToReplace and replacement are of type hwscpHyperBlock.
Syntax
bdeReplaceBlock(blockToReplace, replacement, cutOperation);
Inputs
- blockToReplace
- Block to replace.
- replacement
- The block that will replace blockToReplace.
- cutOperation
- Whether or not the original version of replacement should be cut. If true the original version of replacement will be cut. If false then the blockToReplace will be replaced and the original replacement will stay untouched.
Outputs
- replaced
- The block that replaced blockToReplace.
Examples
Replace a block within a diagram:
diagram = bdeGetCurrentDiagram();
blockToReplace = bdeGetSelectedBlock(diagram);
replacement = bdeCloneBlock(blockToReplace);
bdeAddBlockToDiagram(diagram, replacement);
bdeRedrawDiagram(diagram);
replaced = bdeReplaceBlock(blockToReplace, replacement, true);
bdeRedrawDiagram(diagram)
replaced = hwscpHyperBlock