Hello Skydiver,
so it took me some time, but I got a result.
I made a smart rotary valve with the following features.
- It is a group shape with connection points. The shape is set to not accept connections to its sub-shapes, so to make sure to always connect to the group shape.
- The connection pairs are subshapes, arranged radially and shown/hidden, depending on the number of pairs set in the parent shape (the group).
- The colour of a connection pair is set manually. To do so select the group, then click on a pair to sub-select it and format it as desired.
- This colour is transfered by shapesheet formulas to the parent shape and depends on the state of the parent (ON/OFF)
- The solution does unfortunately not work without macros. The macro writes the dependencies of the connectors to the rotary valve connection point. So the connectors must be prepared by selecting them, then running the macro "setupConnector"
- You'll notice that a connector connected to two rotary valve connection points will display the colour of the endpoint. This is caused by the nature of your request - the rotary valve defining the colour of the connected pipe. A more realistic model would involve colouring of the sources instead of the valves.
- the stencil "RotaryValve" needs to be loaded to get the desired functionality. Once the connections are made they work without stencil (ON/OFF), but rearranging and modifying the number of pairs works only with the macros.
What else?
The rotary valve is a group, so if you need some embellishments, open the group and add what ever enhances the shape.
In the drawing you uploaded, all the connections were made of single line segments. My solution will not work with these segments. You need to use proper connectors. Please google the right way to use and adjust Visio connectors.
Bill: 5 digital beers, please.
HTH,
Y.
Explanations: It was easier to me to implement the solution than to explain how to make it by yourself, due to the complexity of the shape.
Keys:
- Have a rotary valve with adjustable number of connection pairs
biggest work: have a sub-shape that rearranges itself depending on its number.
- Have connection points in the parent shape, rather than its sub-shapes. Couldn't find a way to deactivate them, so moved them instead in the center of the parent. You'll notice this behaviour when connecting a connector and reducing the number of pairs.
- The values (colours) of the connection points got written in the scratch section. They depend on the sub-shapes and the state of the parent. The macro sets this value to the line colour of the connected connector.
- An additional issue resulting from the adjustable number of pairs, was getting the colour of the last displayed pair. I solved this issue by an additional CALLTHIS in the parent shape.