Next: , Previous: , Up: Replicating parts of the Diagram   [Contents]


11.6.1 Copying a Block

Using the copy command, you can repeat a previously defined block.

copy <block_name> [as <new_name>] [<attributes>] [<content_update>];

Using the as clause you can give a name to the newly created copy (so that you can reference it later). Specifying any attribute will override the attributes of the original block. The type of the original block cannot be changed. The content of the original block is also copied, including arrows.

After the attributes you can also specify a list of updates to the content of the block in curly braces. Here you can use the following commands.

add [before <block>] <block description>

Add a new block (of any kind) to the end of the content list, or before <block>. The added block can itself have content you can specify. Alternatively, the added block can itself be a copy or even an arrow.

drop <block>

Remove a block from the content list. You can specify a children using nested dot notation, so if the block to copy contains a block inner, which in turn contain a block innermost, you can drop the latter by saying drop inner.innermost. You can also drop several blocks, list them separated by commas.

[recursive] update <block>|blocks|arrows|all <attributes>

Using this commands you can apply changes to the attributes of a block, all blocks, arrows or simply all content of the block under copy. If you add recursive, the attribute update also applies to content of the content recursively. Similar to drop, you can specify a block to update that is not directly the children of the copied block. You can also specify a list of blocks, separated by commas - this applies the change to a specific set of contained blocks.

replace <block> <block description>

This command removes <block> and adds the block specified afterwards in its place. Again, similar to dropping or updating <block> can denote an indirect child.

move [before <block1>] <block2>

This command moves <block2> to the end of the content list or before block <block1>. You can only reorder the content list of the copied block here not that of any children.

use <attributes>
blocks use <attributes>
arrows use <attributes>

These commands (as elsewhere) update the running style impacting block and/or arrows you add or replace subsequently.

Currently there is no way to drop or replace an arrow, but you can add arrows and replace blocks to arrows.


Next: Block Templates, Previous: Replicating parts of the Diagram, Up: Replicating parts of the Diagram   [Contents]