# Set Property Binding via Scripting

**URL:** <https://forum.inductiveautomation.com/t/set-property-binding-via-scripting/37568>\
**Category:** Ignition\
**Tags:** scripting\
**Created:** [August 10, 2020, 7:51pm UTC](https://forum.inductiveautomation.com/t/set-property-binding-via-scripting/37568 "2020-08-10T19:51:09Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![David\_F](https://avatars.discourse-cdn.com/v4/letter/d/d2c977/32.png) [@David\_F](https://forum.inductiveautomation.com/u/David_F)\
**Post date:** [August 10, 2020, 7:51pm UTC](https://forum.inductiveautomation.com/t/set-property-binding-via-scripting/37568/1 "2020-08-10T19:51:09Z")

</div>

My company is working on an iFix to Ignition migration procedure and we are trying to automate as much of that process as possible through scripting. We have scripts that automatically configure the drivers, build our tags and place all the components in a window. I am now attempting to automate the creation of component property bindings. I have a table that identifies the tags that should be bound to each component property but as far as I can tell there is no way to create this binding via scripting. I can write to the component properties via scripting, but the bindings are not exposed in this way. Am I missing something? We are trying to avoid having to manually bind thousands of component properties across hundreds of pictures if at all possible.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [August 10, 2020, 8:21pm UTC](https://forum.inductiveautomation.com/t/set-property-binding-via-scripting/37568/2 "2020-08-10T20:21:33Z")

</div>

Well, nothing documented or supported, but if you [start here](http://files.inductiveautomation.com/sdk/javadoc/ignition80/8.0.10/com/inductiveautomation/factorypmi/application/binding/PropertyAdapter.html), and study the various implementing classes, you’ll get an idea how bindings work. Note that they are stored in the Window’s InteractionController, not in the component. Be sure to use the component’s own AppContext to construct the binding or relative references won’t work.

Fair warning: you will be in a maze of twisty passages, all alike.

---

<div class="post-metadata">

**Author:** ![jlandwerlen](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen)\
**Post date:** [August 10, 2020, 9:10pm UTC](https://forum.inductiveautomation.com/t/set-property-binding-via-scripting/37568/3 "2020-08-10T21:10:36Z")

</div>

One thing to note, don’t get hung up on how to make something work like you are used to in another platform. Maybe there is a better way of doing things. I’m at a loss and can’t visualize you binding thousands of component properties across hundreds of pictures. That sounds silly to me on any platform.

---

<div class="post-metadata">

**Author:** ![damien.boissat](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@damien.boissat](https://forum.inductiveautomation.com/u/damien.boissat)\
**Post date:** [March 22, 2021, 9:35am UTC](https://forum.inductiveautomation.com/t/set-property-binding-via-scripting/37568/4 "2021-03-22T09:35:36Z")

</div>

Hi David,

Did you manage it? We also are looking for similar example/materials to bind properties through scripting, we created some modules but it is not documented either so we are falling back to use scripting too.

If you could share what you’ve discovered it would great.

Thanks, Damien

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [March 22, 2021, 1:06pm UTC](https://forum.inductiveautomation.com/t/set-property-binding-via-scripting/37568/5 "2021-03-22T13:06:37Z")

</div>

The starting point I linked has all the information you need. Given the unsupported nature, you probably should make sure you understand it all. Note that you don’t need to make a module to use SDK classes and interfaces–jython can call just about anything in the platform. You might want to use the `introspect()` function from my [inspect.py](https://www.automation-pros.com/ignition/inspect.py) script module to help you enumerate the undocumented methods of various Ignition objects you encounter. (You will find that much **is** documented, but as part of the java platform.)

You might find these topics helpful as you dig around under the hood:

[http://forum.inductiveautomation.com/search?q=inspect.py](http://forum.inductiveautomation.com/search?q=inspect.py)

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [March 22, 2021, 1:13pm UTC](https://forum.inductiveautomation.com/t/set-property-binding-via-scripting/37568/6 "2021-03-22T13:13:57Z")

</div>

You’re far better off creating templates and then just using bulk tools to add the templates to the page and write static values in your template params than to try to add bindings yourself imo

---

<div class="post-metadata">

**Author:** ![damien.boissat](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@damien.boissat](https://forum.inductiveautomation.com/u/damien.boissat)\
**Post date:** [March 23, 2021, 6:36am UTC](https://forum.inductiveautomation.com/t/set-property-binding-via-scripting/37568/7 "2021-03-23T06:36:47Z")

</div>

Thanks again @pturmel for your help, I will definitively have a look at `introspect()`  
The advantage of using Modules is the convenience for small update/upgrade on site, when we only have to send a new version and install it on the gateway. Scripting seems to be more convenient during development, I thought it has limitations regarding SDK classes but obviously I was wrong.  
I still need to adapt to the java platform because I come from C# so I am still unfamiliar with the methodologies sometimes.

---

<div class="post-metadata">

**Author:** ![damien.boissat](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@damien.boissat](https://forum.inductiveautomation.com/u/damien.boissat)\
**Post date:** [March 23, 2021, 6:37am UTC](https://forum.inductiveautomation.com/t/set-property-binding-via-scripting/37568/8 "2021-03-23T06:37:33Z")

</div>

I have noticed templates are way easier but they do not draw properly on the screen unfortunately, in our case our components are extending `PathBasedVisionShape` and generated from Autocad drawings, so unless I discover a way to create templates with `PathBasedVisionShape` we can not use them. But yes, templates are far better to encapsulate the logic we need.  
Thanks @nminchin
