Copy SimBiology Blocks

When building models interactively in the Diagram view of the SimBiology app, you can copy and paste blocks using Ctrl + C and Ctrl + V. You can also use the context (right-click) menu.

  • Using Ctrl + V works only if there is enough space near the original blocks. The app does not automatically increase the compartment size if there is not enough space.

  • Using the context menu gives you a better control of where you want the copied blocks to appear. The app uses the current location of the mouse pointer to place the new blocks. You must still make sure that there is enough space at the new location.

Generally, only selected blocks are copied and blocks connected to the selected blocks are not copied. However, there are a few different behaviors depending on the block type as explained next.

Compartment Blocks

If you select a compartment and copy it, the desktop copies the compartment block and any blocks that are inside the compartment, even if they are not visible or selected explicitly. You can display all hidden blocks within a compartment by right-clicking inside the compartment and selecting Show Hidden Blocks and Lines in Compartment. The app does not copy any blocks that lie outside the compartment, even if they are connected to the blocks within it.

Species Blocks

If you copy a species block that is dosed, the associated dose is not copied. You can add a dose to the copied species manually using the Browser or create a duplicate dose from the dose table and update its target name.

Reaction Blocks

If you select a reaction block, the app copies only the reaction block and does not copy the associated species participating in the reaction. The reaction string is null -> null and its reaction rate is set to empty.

Parameter Blocks

Parameters can be model-scoped or reaction-scoped.

  • If you select and copy an entire reaction (that is, the reaction block, the reactant species, and product species), the reaction-scoped parameter (such as a forward rate parameter) is also copied even though the parameter is not visible or selected explicitly.

  • However, if the parameter is model-scoped, the newly copied reaction uses the original parameter (that is, both the original reaction and copied reaction share the parameter). If you paste the entire reaction to a different model, then the app does not copy the parameter, and you must create one for the reaction rate in that model.

Rule and Events Blocks

If you copy a rule or event block, the app uses the original rule or event string for the copied block. In other words, the copied rule or event has the connections to the same blocks as the original block.

If you copy a rule (or event) block and its right-hand-side (RHS) species block, the app does not update the rule (or event) string to include the newly copied species block. The copied rule continues pointing to the original RHS species block.

As an example, suppose that you have a rule (rule_1) defined as s1 = 10 * s2. You select rule_1 and its RHS species block s2 and copy them. After pasting, rule_2 and s3 are created, but rule_2 continues pointing to the original s2 block. The newly copied species s3 is unused.