Pass inputBox string on vision window open to parameter in input box

Hello. I am working on a project where an employee can scan a label and a corresponding window will open to show them what color/specification said part should be. Additionally there is a GUID attached to this scan that I need to log in SQL. My thought is I’ll have an input box come up when vision client is opened stating "Scan part "; When scanned it will pass that text through to the vision window when opened. I can get the input box to come up before vision window opens with : system.gui.inputBox("Scan Part ", “”) However, it’s not passing the value through. I know I’m doing this wrong, I’m not very good with scripting yet and just need to figure out how to pass what’s been scanned into the input box, into the parameter I set on the vision window itself titled “scan”. Can anyone assist?

You should check out system.nav.openWindow(). Parameters are passed by way of a dictionary to properties in the Root Container of the target window. Put some custom properties on the target window and use them in your openWindow script. Something like:

scanIn = system.gui.inputBox("Scan Part ", "")
if scanIn != None:
  # parse parameters and guid, and whatever else out of the scan.
  #That part is up to you. ;)
  parameter1 = 'parameter1info'
  guid = 'guidInfo'
  system.nav.openWindow("SomeWindowName", {"parameter1PropertyName": parameter1, "guidPropertyName":guid})
1 Like

Thank you for the reply, I’ll plug it in and see what happens haha! thanks!