Overview
The is a quick and effective program object that will clone objects (components) from location to many locations.

Photocopier.bog (17.8 KB)
How to use the Photocopier?
It’s really simple. First paste the bog that contains the program object somewhere in your station. The location really isn’t very important, just make sure you know where to find it later!
Self-Sign the Photocopier
If you’re using a version greater than 4.8 you will be required to sign all program object before they can be executed in the station.
Right-Click -> Views -> Program Editor

Next click the save and compile icon and follow the prompts.
I am not covering creating self-signed certificates in this guide, this will come in the form of its own guide soon.

If successful, you will now see a green dot

Photocopier Configuration
It is very simple, there are two ord slots:
-
compToCopy: In this slot enter the ord of the component you’d like to copy. A component is anything that extends
BComponentand therefore is not limited to a single point. In fact the best usecase for the Photocopier is copying an entire folder of logic to many folders.- By Default, when the
compToCopyis duplicated all incoming links are retained. You could disable this by editing this lineparams.add("keepAllLinks", (BValue) BBoolean.make(true));and setting the BBoolean to false.
- By Default, when the
-
copyTo: In this slot enter the
OrdorBQL Queryof where you want to copy thecompToCopytoo.- Note: If the
useQueryboolean is set false, thecopyTo Ordmust be the absolute ord of the target. In most cases you will be bulk copying logic from on location to many and will be using BQL to return the target ords.useQuerymust be set true in order for BQL to work.
- Note: If the
Once you have configured the photocopier, Right-click and invoke the action photocopy.
Example
In this example I have 6 Air Handling Unit folders and a Template folder. The template folder is a duplicate of the Air Handling folder. In here I’m going to introduce some new logic that I want to copy to all my other Air Handlers.
Right-click and open image in new tab to view the gif in full screen.

As simple as that we have copied a folder of logic to many folders! Notice that the position of the of the component on the wiresheet is also duplicated.
Now you’re probably asking yourself. @Giantsbane this is great, but the logic is pretty useless if nothing is linked to it.
Well kids, I have a program for automating the linking too which I’ll link here once I’ve written a guide.
