UDTs - Bind Parameters to Properties Using Scripting

I’m trying to use an Ignition script to change the binding of a property using scripting.

I’m using this script:

a = system.tag.getConfiguration('[default]FV_102/FullStall/Ack')
x = (a[0]['opcItemPath'])
print('opcItemPath: ', x)
print('Type: ', type(x))

The result is this:

('opcItemPath: ', {bindType=parameter, binding={OPC_Item_Path}.{TagName}})
('Type: ', <type 'com.inductiveautomation.ignition.common.config.BoundValue'>)

My issue is that I do not know how to create / modify the BoundValue datatype. Setting the opcItemPath equal a string of the desired path does not work. I have to manually go back into the UDT and apply the change.

The information that I found on the BoundValue is this: http://files.inductiveautomation.com/sdk/javadoc/ignition80/8.0.0-beta/com/inductiveautomation/ignition/common/config/BoundValue.html

The system.tag.configure document doesn’t have an example on using parameters (it does for setting parameters). https://docs.inductiveautomation.com/display/DOC80/system.tag.configure

Is it possible to bind a parameter to a property via scripting?

There’s not any way to construct bindings in scripts, for any part of Ignition. You would have to instantiate an expression parser with a carefully constructed execution context, and none of the necessary pieces are exposed, not even in the SDK. It is theoretically possible, though. But totally unsupported.

The closest you can get would be to programmatically construct a file in tag export format and use system.tag.importTags() to pull it in.