How to retrieve all properties (regular and custom) for all components in a window using scripting in Ignition?

Hello everyone,

I'm working on a project in Ignition and need to retrieve all properties (both regular and custom) of all components within a window. For example, properties like text, data, background, and font, not just the custom properties.

Currently, I am using the following code to get all the components of the window:

win = system.gui.getWindow("Screen Name Data Entry")
comps = win.getRootContainer().getComponents()

However, when I use a for loop and .getProperties(), it only returns the custom properties and not the standard ones like text or data.

Does anyone know how I can list all properties, including both regular and custom, for each component in a window using scripting?

Consider trying the techniques shown in the introspect() function of my inspect.py script module.

More fundamentally, you need to know that jython properties of components are a combination of jython's native "NetBeans" interpretation of java getter and setter methods, plus the custom properties exposed by Ignition's PyComponentWrapper.

But that usually yields more properties than are exposed by the designer, since the designer relies on the component author providing a BeanInfo class in designer scope that provides necessary metadata for design purposes. If the inspect.py functionality doesn't get you what you need, please share more about why you need to do this.

2 Likes

In this case I want to compare windows and components between different sites. For this I want to obtain all the windows of all the projects (where I have not been able to find a solution either) and once I have all the windows I also want to obtain all their components with all their properties and bindings. For the bindings I can use the interactionController.getPropertyAdapter function but I have not been able to find how to obtain all the properties of each component.

Unfortunately, you have an extremely difficult task. The closest you can get to this is to use the designer's shift-right-click menu to copy each window as XML, then use diff or similar tools to compare files.

While this is the best currently possible, it isn't great, as the XML is an undocumented format that is not deterministically ordered (changing bindings changes everything). There is hope that this will improve with v8.3, but there haven't been any IA promises. (Might get the XML as the on-disk resource format. Unlikely to get the content re-ordered sanely.)

Sorry.

{ Edit: already an option to have the XML on-disk. }

Thank you so much for your time.