Create Windows using Script?

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.

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

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.

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.

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.

2 Likes

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

Docs, which includes a link to the IU video on the template canvas.

1 Like

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!