Blocks give you more power over your documents, and can help you to automate boring tasks.
Really, it's best to answer this question with examples of different things blocks can do.
In short though, blocks are mini-apps that generate content inside a document, typically as a calculation module, and they can be connected to the rest of the document using formulas.
You can create these mini-apps with normal Blockpad equations, or with programming for more complex tasks.
Let's walk through a simple example.
Congratulations on using your first block!
All of the calculations you see are automatically done using the length and width inputs and the block definition stored in the Examples library.
You can access the results of these calculations in a formula, and continue any calculations.
If the block inputs change, these output references are updated accordingly.
Note that this is similar to accessing a value in a sub-frame.
You can change the name of a block instance, so that the outputs have more sensible reference names.
To edit the inputs, double click the block, change the inputs, and click update block.
The inputs to a block can be a formula (like a formula in a spreadsheet cell), so you can reference values that are defined in the document.
In the example below, length_1 and width_1 are calculated in the document, and then referenced in the block as inputs.
You can view a block as a table of inputs and outputs, instead of the full view with equations, drawings, and intermediate steps.
The table view is better for compact information, when seeing the steps isn't necessary.
You can insert that example rectangle block multiple times in the document, and each one can have different inputs (even inputs from other rectangle blocks). Just follow the steps outlined above.
This really shows the power of blocks. Blocks allow you to seperate the how of a calculation from the implementation of that calculation.
The how, or the block definition, is stored in the library, just once. The implementations, or the block instances, are used in multiple places and multiple files. All of these block implementations have different inputs, but all have the same definition for how the inputs are used.
What's more, if you change the how for the calculations in the block definition, all of the instances can be updated to show that change. You don't have to anxiously copy-paste the change throughout your documents.
The rectangle block above was made using regular Blockpad equations and drawing. More complex blocks are possible using scripts, like the RectangleBuilder block in the Examples library.
Follow the steps to insert the rectangle block above, but choose RectangleBuilder.
For this block, you can build a composite shape that consists of rectangles by adding rectangles of various sizes. The properties of the final shape are calculated, and you can use them in calculations, just like above.
You don't need to know scripts to create complex blocks though. The buckling example block was made using only Blockpad calculations.
Blockpad charts are actually blocks written using Blockpad scripting.
When you insert a chart, you're really just inserting a special kind of block.
The table of contents tool is also actually a script block that reads the header information from a frame and creates a table of contents.
So how do you make your own block to use? Moreover, how do you know when to make your own block?
Blocks are all about making repeated work easier, so the answer to "when to make a block?" is when you or your team is doing something over and over again.
Below are some concrete situations where you might want to make a block
Once you've decided to make a block, the first step is to create the calculation itself in Blockpad.
You want a complete section of calculations where you can specify inputs and get outputs, without any human help along the way.
For the sake of this walk-through, we'll use the calculations shown below, essentially a simple version of the example rectangle block.
When you finish the steps above, you should be taken to a web page where you can see your block online. You can edit the inputs on this page and see how it affects the block displayed on the right.
You can always come back to this web calculator using the url, or navigate to it from the online Library interface. You can also share the url with others, and they can use it if you set the permissions.
The block you just made is saved in your personal online library. You (and anyone you give permission to) can now access it from any of your documents.
Note that accessing a block requires internet access. However, once a block is used in a file, the file continues to work with or without internet access.
To insert the block, follow the steps above for inserting a block, using the library you stored the block in.
Below are the generalized steps for creating a block from equations.
Block definitions can be changed, and when they are, all blocks using that definition can be updated to reflect it.
To do so, you overwrite the existing block with a new one. Follow the same steps as creating a block, but instead of a new name and library assignment, use the name and library of the block you wish to update.
We are still working on the documentation for this feature.
If you are interested, please contact us or send an email to ej at blockpad dot net, and we will be happy to work with you.
Note: if a file that uses the block is open, select Formulas>Update All in the toolbar to update the block instances in the file.
Block tables are many different instances of a block all in one table. The block instance is the row, and the inputs and outputs are the columns.
With block tables, you can easily turn a regular Blockpad calculation into a table of different scenarios without ever re-doing the calculations.
Block tables probably sound useful, but when are good times to actually use them?
Use block tables when you want to see many instances of a calculation all in one place, in a table format. Compared to multiple blocks in a file, this is much more compact, but you lose the clarity of seeing the equations.
Some times you might consider block tables:
Block tables are pretty straightforward to create once you have a block.
Note: to use block tables, the Blockpad add-in must be installed for Excel.
For blockpad calculations that aren't a block, first make a block following the instructions above.
In the Excel file that opens, you can change the inputs, and the outputs will change according to the block definition.
You can use regular Excel formulas to define the different rows of inputs, and you can extend the rows like you would normally in Excel.