How to use more than one type of link template?

We have diagram with electrical elements that looks as following:

As you can see there are thick black lines and some elements that could be connected to these lines. For this type of connection we’ve used your network sample: Network Configuration. But, we need normal link templates if we want, for example, to connect upper parts of elements on the diagram. If you try to use the same link template, you get the result shown on the screen shot below:

In some another sample, you can switch between modes that represent different link templates, but you have to click particular button for particular mode.

Is there automatic way that we can use when we want to connect two ports by using another link template? I mean on way to not to select different link template by clicking button or something similar.

Override LinkingTool.insertLink to first set the category of the LinkingTool.archetypeLinkData object and then call the base method. Note that you can set other properties on that archetype link data object too – whatever you want the new link to have for its data.

There’s an example of that in the System Dynamics sample: System Dynamics