Update progress bar

Hi everyone! I'm new to Ignition and have had some good luck scripting with it so far, but have ran into an issue.

I have a mouseReleased event on a Button that reads:

window = system.gui.getWindow("Main")
print window.getRootContainer().getComponent("progressBar")

that gladly prints out:

com.inductiveautomation.factorypmi.application.components.PMIProgressBar

However when I try setting the "Value" property of the progress bar, I get:

AttributeError: 'com.inductiveautomation.factorypmi.application.com' object has no attribute 'Value'

This error occurs whether or not I use:

event.source.parent.getComponent("progressBar").Value = 25
{or}
window = system.gui.getWindow("Main")
window.getRootContainer().getComponent("progressBar").Value = 60

Does anyone have any recommendation on how to resolve this issue?

Value should be lowercase

2 Likes

Ughh, that did it. Thanks!

You’re welcome. In the future you can always do something like this to quickly find out a component’s functions:

print dir(window.getRootContainer().getComponent("progressBar"))