Hi,
I want to write a script that would change the name of a list of tag inside a folder, and update all the objects in all the windows that are bound to these tag.
In my case, I would change UDT tags name and update template instances. This is what I have done so far:
[code]Window = system.gui.getParentWindow(event)
WindowComponents = Window.getRootContainer().components
for Component in WindowComponents:
if type(Component).name == “TemplateHolder”:
print Component.getProperties()
print Component.getProperties()[0]
print Component.getProperties()[0].value
print type(Component.getProperties()[0].value)[/code]
This is implemented in a button actionPerformed Script Editor. It gets all the component inside the window and keep only those which are template instances.
My UDT is called TestScriptTag and contains a memory tag called String.
My template contains a label bound to the tag name, and has a external property bound to the UDT TestScriptTag.
This is what I get for the print at the end:
array(com.inductiveautomation.factorypmi.application.binding.DynamicPropertyDescriptor, [Test])
Test
TemplateHolder.DelegateUDT[type=,path=]
<type ‘com.inductiveautomation.factorypmi.application.components.template.TemplateHolder$DelegateUDT’>
Here is my question, how can I modify the binding? I want to write write a tag path.