ExternalReferencesTool

Tool

External references

With External References, you can reference values stored in other files, including Blockpad, Excel, *.csv, and *.json files.

Files can be added as an external reference in Blockpad, and then values inside of them can be referenced in formulas. The values are referenced using dot notation starting with the name of the external reference (xref1, xref2, etc). For Blockpad files, you can also automatically add the full reference name using the copy reference tool.

Manage external references

You can add, remove, change, reload, and rename external references in the external reference manager.

Open external reference manager:
  • Select File>External References in the toolbar.

Using external references

To use an xref, you add it to the file, then reference it in a formula.

Add an external reference:
  1. In the toolbar, select File>External References.
  2. Click the Add button.
  3. Click the Browse button.
  4. Navigate to the file you want to reference and double click.
  5. Click OK.
  6. (Optional) Select the xref and click Rename to change the name.
  7. Close the external references window

To use an external reference, just type the name of the xref into a formula. Accessing the values inside of an external reference file depends on the type of the file.

Also note that you can use regular Blockpad formula names to "rename" these values for use inside other formulas. E.g. CodeResults = DataXref.Sheet1.A1:A1000

Blockpad files:
  • Use dot notation as if you were referencing something in another frame.
    • The dropdown options should show what's there.
  • Examples:
    • L = xref1.Report1.Length
    • Data.Sheet1.A1:A1000
    • Project1.Summary.InputTable.D5
    • F_1 = ExternalAnalysis.Report1.OutputSection.Force
Excel files:
  • Use dot notation to get to the sheet, then use classic cell references.
    • Essentially the same as referencing a Blockpad spreadsheet.
  • Examples:
    • Data = xref1.Sheet3.A1:D100
    • Pressure = ExcelWindCalc.Outputs.D10
CSV files:
  • The *.csv file works like an array.
  • Examples:
    • DataSet = xref1
    • xref2(3)
JSON files:
  • Use dot notation to access the objects and values inside.
  • Example:
    • S_y = Metals.Steels.A36.S_yield
Use the Copy Reference tool for Blockpad file external references:
  1. Go to the value you wish to reference.
  2. Select the value and Right Click>Copy Reference.
  3. Go to the formula you wish to reference the value from (or open a new one).
  4. Paste the reference in.
    • When the reference is pasted in, an xref is automatically created.

In the example below, "Cost_Fence" in right file references "Wood_6ft" from the left file.

Xref_1

Updating External References

If a value is changed in the source file of an external reference, Blockpad doesn't know to update formulas referencing that value. It's important to ensure external reference values are up to date if the source files might change.

Update a value from an external reference:
  1. Save the file the external reference is pointing to.
  2. Navigate back to the file referencing it.
  3. In the toolbar, select File>External References.
  4. Click on the external reference.
  5. Click Reload.
  6. Close the external references window.

Note that when you open a Blockpad file, all external references are automatically "reloaded".

Remove an external reference:
  1. Select File>External References in the toolbar.
  2. Select the external reference you wish to remove.
  3. Click Remove.
  4. Close the External Reference window.
See also:

You can refer to this tool in any formula, macro, module, or other script in Blockpad. You can use either its name or its full path:

  • To refer to it by name, use ExternalReferencesTool (make sure the library Library.Tools.File is included with Include Libaries)
  • To refer to it by its full path, use Library.Tools.File.ExternalReferencesTool

 

See also: