Automatic tag binding of shapes

So I've been trying to automate tag binding through scripting and didn't succeed, now I'm trying to do it with some automatic external python XML parsing, but to no good result.

The problem is as follows:
Inside window root container I have dozens of shape groups and every shape group has up to maybe ten shapes. What I want to do is add style bindings for every shape inside the window, preferably without using templates - the shapes are .svg created outside of Ignition.

This is the approximate layout of the window for reference.
image

Does anybody have any experience with said problem or is there any other solution other that doing it manually or using external XML parsing and scripting?

Thank you

It is possible, but definitely not simple. Some similar discussions:

https://forum.inductiveautomation.com/search?q=binding%20InteractionController%20%40pturmel%20order%3Alatest

Note: totally unsupported and may break your designer or crash your project irretrievably. Have good backups before experimenting.

2 Likes

Thank you for the link, it looks like it is a topic that has no definite answer. But my solution of manually editing the XML seems to not be a very good idea as I understand it.

out of curiosity, why do you not want to use templates?

2 Likes

Well we are using automaticaly generated SVGs from outside Ignition so what we get is a group of groups of shapes basically.. But I'm open to ideas!

That really isn't much for me to go off of.

Are these SVGS the entire window?

I'm assuming it gets used more than once?

Are these screens really that different?

What benefit do you get generating the SVGs, vs a template?

It can't be speed because you're wasting so much time manually editing XML. And I'm assuming feeding whatever you are to auto generate isn't the easiest as well.

I don't see why a template won't work much easier and quicker.

Yes, sorry, I understand.

The thing is, there is a whole process before we even get to Ignition. The penultimate step is getting data from Autocad into ignition, and that is why we are generating SVGs right now. We tried a lot of things to automate this and this seems like the best way. So the product of the SVG generator from Autocad is a gian SVG containing all components from Autocad represented as shapes. And onto those shapes I need to add bindings, styles, custom props, event handlers, on click handlers etc etc.

Templates would be great for this, but generating templates with our data from the Autocad is very difficult and it doesn't often behave like we would want to.

The goal is for this process to be as automated as possible in the future, so right now we can allocate more time to automate this (hence the XML editing in Python, that is now fully automated)

By the way for those, who might stumble upon this problem like me, I've solved the problem, it might not be supported and recommended, but this is the solution that worked even on Ignition 8.1.

Only thing missing from the mentioned post are the imports, so here they are:

from com.inductiveautomation.vision.api.designer import VisionDesignerInterface
from com.inductiveautomation.ignition.designer import IgnitionDesigner
from com.inductiveautomation.factorypmi.application.binding.interchange import ExpressionBindingConfig
2 Likes