The Simple Forest Model Generator

by Tom Moore , October 16, 2024

Originally written June 29, 2022, Updated September 24, 2025

Raised Image

The ForestModel language is used within Patchworks™ to describe stand dynamics. ForestModel is highly expressive and can represent a broad range of forest conditions, silvicultural practices, and disturbance events. The MatrixBuilder tool combines a ForestModel recipe with a forest inventory input to create an input matrix for the Patchwork model. Due to the complexity of the language elements, writing a ForestModel file by hand can be challenging; however, the Simple Forest Model Generator simplifies this process.

The Simple Forest Model Generator is a Microsoft™ Excel workbook application. The workbook contains a set of pre-formatted worksheets and Visual Basic macros that assist in the entry and partial validation of various modeling data. There are worksheet types for collecting yield data, lookup tables, constants, attributes, succession, and silvicultural treatments and responses.

The workbook application utilizes the best features of Excel: data validation, easy copy and paste, and access to cell formulas for power users. Once the information is filled in, a simple click on a menu item calls a VBA macro to gather the information and write out a ForestModel XML file.

The C5 sample dataset distributed with Patchworks contains a copy of the Simple Forest Model Generator that is populated with a small sample model, and a link to this workbook is provided below. This workbook has been updated with the latest ForestModel features, and is a good starting point for developing your own model.

This workbook will continue to receive updates as new features are added and bugs are fixed. Check back here often for the latest version, especially before starting a new project.

It is possible to upgrade older workbooks to the latest version in order to take advantage of newer features. To do so:

  1. Close all Excel workbooks.
  2. Download and open the latest ForestModel workbook.
  3. Press Alt+F8 to show the "View Macros" dialog.
  4. Select the "UpgradeModel" macro and click the "Run" button.
  5. In the dialog provided, select the name of the workbook that you wish to upgrade, as well as the name for the newly upgraded workbook. The new workbook must not already exist.
  6. Click the "Upgrade" button. The upgrade process may take several minutes; do not click on any windows during this process.
After the upgrade process has completed, save the new workbook and close the other workbooks.

Download Version September 24, 2025

Cumulative update history

DateChange
September 24, 2025External files containing XML fragments can be included at key points in the resulting document. Now, literal XML code can also be entered into the fields to be included in the generated file. Text in the "Files or Fragments" column that starts with the < character will be treated as literal XML data; otherwise, the behaviour is the same as previously.
Raised Image
July 28, 2025Add support for column elements in <yieldtable> definitions. Add support for expressions in the response sheet for absolute or relative adjustments.
Janury 29, 2025Add support for the addprior product attribute
October 16, 2024Better handling of inline yield curves with more than 32K entries
July 17, 2024Add options to specify exec tasks; change input workbook metadata
June 28, 2024Add options to override the default output file names
March 18, 2024Add middle constants section
March 2024Remove hidden named ranges
October 17, 2023Add succession renewal value repeat expression
June 24, 2022Refactor inputs for initial constants and include xml fragment at beginning
June 14, 2022Refactor repeat attribute columns, add repeat for inputs, succession, features, products
June 8, 2022Add select repeat clause around attributes
June 8, 2022Table references with files use the filename instead of an entity
March 2, 2022If treatment name is an expression then do not add quotes
February 27, 2022Fixed upgrade and select repeat clause
January 27, 2022Add treatment repeat clause
January 16, 2022Fixed some issues caused by upgrade macro
November 26, 2021Add upgrade macro