Introduction to Chains

Introduction

Chains were a new feature introduced in V8 of 12d Model and each subsequent version has continued to add more functionality to chains. In this post, I will give a brief introduction to chains- what they do, how to use them, etc- and then show you how to create your first chain.

What are chains?

In its simplest form, a chain is a way of recording and running a set of steps as if they were one process. To quote from the 12d Model Help file:

a Chain is a list of items that are run in the order that they appear in the list.

Prior to chains, many features in 12d Model were functions. The various settings of each function, such as the interval between contours or cross sections, were saved as a function and that function could be easily re-run from the Recalc menu. However, not everything was a function- each panel had to be specifically written to support functions. To assist with this, most panels in 12d Model (even those that support functions) can be saved to a screen layout format, often abbreviate to SLF. The SLF allowed the data entered into a panel to be saved to a file (.slf or .slx) and then loaded at any time from within 12d Model. In this way, any panel that wasn’t a function could be easily saved and re-run, although not as easily as functions.

Chains are a natural extension of the idea of making common and repetitive processes within 12d Model easier to run. Just 1 second of time saved can add up to a lot of time (and money!) saved over the course of a typical project.

What can chains do?

Chains support many different steps and most (though not all) panels inside 12d Model can be captured and used in a chain. Each version of 12d Model also adds more functionality to chains, so I will just list some of the major features supported by chains:

  • Recalculate a function
  • Run other chains
  • Resolve super alignment strings
  • Plot via the Plot Parameter File (PPF)
  • Run most 12d Model panels
  • Run most screen layout files (SLF)
  • Run external commands (e.g. batch file, external .exes)
  • Manage views – create, delete, fit, add/remove models
  • Manage elements – delete strings, models and tins, clean models, create models
  • Manage files – delete and compare files

In addition to these basic features, chains also support more advanced functionality such as:

  • Flow control using if/else conditionals, labels and gotos
  • Parameters – values can be parameterised and changed at run-time without re-writing chains

I will not cover all of the functionality of chains in this introductory post, but will have a follow-up post explaining some more advanced functionality, including parameters.


4 thoughts on “Introduction to Chains

  1. I have a question regarding including delete tin/models in a chain command. If the tin or model to be deleted is shared, does it need to be unshared first before deleting it? Thanks.

    I hope you could reply also through my email.

    • Lovelle,

      Thanks for reading and posting. Yes, models and tins that are shared- either into a project or out from a project- need to be unshared first before they can be deleted. I guess the follow-up question then is how to unshare data in a chain. I’m not sure how that would be approached, but I’ll have a think about it.

      Let me know if you have any more questions about chains.

  2. Hi Matt, can the Chains be applied to the Drainage Network Editor’s Drainage Analysis window to do runs for different storm events? Can it save the results on different models?

    • Chris, sorry for the late reply. Not sure if you’ve already worked out an answer to your question. I’m not sure whether chains could help with your problem. The Drainage Network Editor is a different beast in 12d Model because of its functionality and complexity. However, I seem to recall it just running various macros behind the scenes. Indeed, if you look in the Library folder (e.g. C:\Program Files\12d\12dmodel\14.00\Library), you’ll see many Drainage*.4do files that might do what you’re after (e.g. drainage_run_dynamic_analysis.4do ).

      You’d have to ask your local support or 12d (e.g. via the Forum) whether these can be used separately or in chains. I don’t do any drainage work these days, so I’m not sure about that side of things. It probably couldn’t hurt to have a play around with it, though.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.