Charles Vance Certified Archestra Developer and Freelance Programmer

Tutorial Complexity


Published August 29, 2019 in Uncategorized - 4 Comments


In the last tutorial we created a simple valve symbol that contained a vertical and horizontal orientation selection using the layering wizard. We didn;t have any scripts and the single value custom property was associated with both so layering wasn’t required for that element. In this tutorial we will add 2 new public custom properties two private custom properties and a few scripts to control the valve status color.

The new complex valve will support a four color status using two inputs one for open and one for close with a status integer set in a script based on input conditions. In addition to open and closed status we will also be able to detect if the valve is traveling between positions or having a trouble condition such as a blocked valve or power outage.

Step 1 is to rename the existing graphic element groups from grpHoriz and grpVert to grpSHoriz and grpSVert for “simple” and the orientation layers from Horizontal and Vertical  to SHorizontal and SVertical as illustrated below.

Step 2 add new custom properties for the complex valve status indication as follows:

Type| Boolean | Name| CloseSW | Default Value | me.CloseSW | Visibility | Public

Type| Boolean | Name| OpenSW | Default Value | me.OpenSW | Visibility | Public

Type| Integer | Name| Status | Default Value | 0 | Visibility | Private

Type| Integer | Name| UpdateStatus | Default Value | False  | Visibility | Private

Step 3 create two new layers CHorizontal and CVertical for “complex” and then make a duplicate of the simple horizontal group which will be modified by adding a truth table to the valve color control as seen below. Create a vertical and horizontal group using this table.


Center all of the valve elements placing the two new complex element groups in the appropriate complex layer. 

The final step is to create the scripting necessary to control the color based on the OpenSW and CloseSW inputs.  

First, create a DataChange script for each of the valve switches OpenSW and CloseSW that will set the UpdateStatus Boolean to true any time the state of the input changes.

This will provide an event triggered method to continuously monitor the state of those two switches.


Each time the UpdateStatus is set to true the Update script executes to test for switches for operational conditions setting the Status integer controlling color of the valve accordingly. Valve state is controlled according to the following truth table

Line 1 of the script is tests to see if the OpenSW is true and the CloseSW is false, if true the status integer is set to 1 otherwise the next if statement evaluates to see if the valve is closed making the status integer a 2 if that condition is met. The logic continues to flow testing every state of the two inputs until the valve state is known and the status integer set to the correct value.

If you are interested in doing a complete walk through with me you can watch the video of this tutorial here.

If you haven't taken the FREE online course you can do that here.

To pe-order the digital version of Step By Step Archestra Scripting go here. (Scheduled for release in October)

Please leave me a comment if you found this useful, I am always looking for new ideas for tutorials feel free to share any frustrations you may be having that you would like to see a tutorial for.

Step-by-Step Archestra Scripting Guide

Subscribe now to receive FREE Tutorials and Scripting Examples

We will never share or sell your email address.

Powered by ConvertKit


benahmed - September 11, 2019 Reply

good work sir .

    Charles Vance - September 11, 2019 Reply

    Thanks for checking us out! let me know if you have an questions or need additional clarification on anything.

DCustard - September 17, 2019 Reply

Helpful. Many thanks.

    Charles Vance - September 18, 2019 Reply

    Thanks for checking out the tutorial! Let me know if I can help in any way!

Leave a Reply: