Set and Change Parameter Values in Chains

Step-by-step example

Let’s look at running this panel to change a single parameter.

We want to set a Text-type parameter, Parameter1, value to be “My value”

A macro can be provided with command-line arguments when called from toolbars, menus and chains, but here I’ll use the Run a Macro panel (Utilities→Macros→Run→Run).

  1. Select the macro, chain_custom_values_panel.4do .
  2. In the Macro Arguments field, we need to provide the type of field to display and the value of the field.
  3. Type in: TEXT “My value”
  4. Click the Run button.
Screenshot of running Chain Custom Values to display custom values on a panel
TIP: I often find it useful to either copy and paste the Macro Arguments field to an open text editor or save the Run a Macro panel as an SLX. This saves having to re-write the configuration every time.
Screenshot of Chain Custom Values custom panel

You should now see the Chain Custom Values panel with a single Text field (an Input Box). This is the panel that we need to capture in the chain. You may notice that the field is blank. For reasons explained later, the fields aren’t populated with your specified values until you click the Process button. You can click the Process button, if you’d like to see the value in the field. Keep the panel open.

Chain Custom Values panel showing desired value in field.

In order to capture macro panels in a chain, it is best to use the Option – Manual command. I’ll assume you’ve already created a chain and a corresponding PVF with a single Text-type parameter in it called, for example, “Parameter1”. You don’t need to provide a value, but you can if you want. The name doesn’t really matter, either.

  1. Create a new “Option – Manual” chain command
  2. Click the Capture data button and then click on the Chain Custom Values panel, which should still be open. This saves the macro name and the command-line arguments in the chain (once you click the Write button). If you need to change the panel, you’ll need to re-capture the panel data.
  3. Click the Capture buttons button and click on the Process button on the Chain Custom Values panel.
  4. Click the Capture buttons button again and click on the Finish button on the Chain Custom Values panel.
  5. Un-tick the Automatically close panel tick box.
  6. Tick the Run in interactive mode tick box.
  7. Now’s a good time to Write the chain.
  8. You can also close the Chain Custom Values panel.
Screenshot of using Chain Custom Values in a chain

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.