Next: Repeating a Block Many Times, Previous: Copying a Block, Up: Replicating parts of the Diagram [Contents]

#### 11.6.2 Block Templates

In addition to copy blocks that were previously added to the diagram, you can also define templates of blocks. Block Templates are fully defined blocks (of any kind), that are not part of the diagram. They do not appear and cannot be referenced (e.g., for alignment or arrows). They, however, can serve as a basis of other blocks, that do appear.

To define a template, simply add `template` in front of any block. The name of the block becomes the name of the template.78 The template captures the default styles and running styles at the location of definition and replaying it will not be impacted by a later change to them.

To create an actual box from the template use the `copy <template>` command. Add `as <name>` if you want the block created to have a different name. Note that the `copy` command can also be used to copy existing blocks. If you have a template and a block of the same name, `copy` will use the template. When creating a box from a template, you can change attributes and content of the template, similar to the case of copying an existing block, see Copying a Block.

Templates are part of the chart and do not disappear after closing the scope (at the closing brace). Template definitions cannot be made part of design specifications, but can be part of procedures. In the latter case replaying the procedure will result in the definition of the template at the location of the replay. You can also create a modification of a template by copying it. Simply type `template` before a `copy` command and the result will not be a block that appears but a template. This construct is also suitable to create a template (possibly with modifications) from an exitsing block - simply type `template copy <block_name> as <template_name>`.

#### Footnotes

##### (78)

If you have defined the template inside another block (wierd), the full name of the block becomes the name of the template.

Next: Repeating a Block Many Times, Previous: Copying a Block, Up: Replicating parts of the Diagram [Contents]