# Create Windows using Script?

**URL:** <https://forum.inductiveautomation.com/t/create-windows-using-script/35038>\
**Category:** Ignition\
**Created:** [May 26, 2020, 12:12pm UTC](https://forum.inductiveautomation.com/t/create-windows-using-script/35038 "2020-05-26T12:12:05Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![tgrob](https://avatars.discourse-cdn.com/v4/letter/t/6bbea6/32.png) [@tgrob](https://forum.inductiveautomation.com/u/tgrob)\
**Post date:** [May 26, 2020, 12:12pm UTC](https://forum.inductiveautomation.com/t/create-windows-using-script/35038/1 "2020-05-26T12:12:05Z")

</div>

I have a list with buildings, floors and rooms. I would like to use a script to create a window for each room in a buildings and Rooms Folder . Is there somting like “system.gui.addWindow()” i could use?

Thanks for any help.

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [May 26, 2020, 12:39pm UTC](https://forum.inductiveautomation.com/t/create-windows-using-script/35038/2 "2020-05-26T12:39:29Z")

</div>

You will probably want to look into making a template [https://docs.inductiveautomation.com/display/DOC80/Creating+a+Template](https://docs.inductiveautomation.com/display/DOC80/Creating+a+Template)

---

<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:** [May 26, 2020, 12:43pm UTC](https://forum.inductiveautomation.com/t/create-windows-using-script/35038/3 "2020-05-26T12:43:36Z")

</div>

Or create one window for a generic “building”, one for a generic “floor”, and one for a generic “room”, parameterizing what they display to cover your needs. I would also make templates for use with a template canvas on each of those windows to provide dynamic visuals for the elements within the building, floor, or room.

---

<div class="post-metadata">

**Author:** ![tgrob](https://avatars.discourse-cdn.com/v4/letter/t/6bbea6/32.png) [@tgrob](https://forum.inductiveautomation.com/u/tgrob)\
**Post date:** [May 26, 2020, 1:41pm UTC](https://forum.inductiveautomation.com/t/create-windows-using-script/35038/4 "2020-05-26T13:41:44Z")

</div>

I have have created templates bound to udt for the room elements.  
I can generate an navigation treeview with the dispaly path. What i can not do is to generate the Windows and place some templates on it. If i get a new building i would like to create the Windows like i merge new tags with the import tool. Of course I could crete the windoes manually but there are a few 100 room to do and that would be booring. Using generic templates might be difficult because of the variations in the room Elements.

---

<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:** [May 26, 2020, 1:49pm UTC](https://forum.inductiveautomation.com/t/create-windows-using-script/35038/5 "2020-05-26T13:49:05Z")

</div>

Don’t create a bunch of windows. Use the template canvas. Feed it a dataset with the coordinates and link details of the templates you want placed in the building/floor/room. Keep all the dataset source material in your database.

Seriously, don’t create a bunch of windows.

---

<div class="post-metadata">

**Author:** ![tgrob](https://avatars.discourse-cdn.com/v4/letter/t/6bbea6/32.png) [@tgrob](https://forum.inductiveautomation.com/u/tgrob)\
**Post date:** [May 26, 2020, 6:54pm UTC](https://forum.inductiveautomation.com/t/create-windows-using-script/35038/6 "2020-05-26T18:54:19Z")

</div>

OK. Do you ave an exampel on the template canvas or can you throw me a line on how to get into that?

---

<div class="post-metadata">

**Author:** ![KathyApplebaum](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kathyapplebaum/32/7261_2.png) [@KathyApplebaum](https://forum.inductiveautomation.com/u/KathyApplebaum)\
**Post date:** [May 26, 2020, 9:01pm UTC](https://forum.inductiveautomation.com/t/create-windows-using-script/35038/7 "2020-05-26T21:01:36Z")

</div>

[Docs](https://docs.inductiveautomation.com/display/DOC80/Vision+-+Template+Canvas), which includes a link to the IU video on the template canvas.

---

<div class="post-metadata">

**Author:** ![tgrob](https://avatars.discourse-cdn.com/v4/letter/t/6bbea6/32.png) [@tgrob](https://forum.inductiveautomation.com/u/tgrob)\
**Post date:** [June 1, 2020, 8:55pm UTC](https://forum.inductiveautomation.com/t/create-windows-using-script/35038/8 "2020-06-01T20:55:39Z")

</div>

Thank you for the help. I bound the folowing sql query to the canvas:

SELECT name, template, parameters, x, y, width, height, layout, z FROM rooms WHERE path = ‘{Root Container.path}’ AND room = ‘{Root Container.room}’

The template canvas works very nice!
