Iterating Through Embedded Templates

I have a template instance (Facility), and inside this template instance there are other template instances (Tank1, Tank2, Meter1, etc.).

I wrote some code to iterate through the Facility template and get the tanks/meters and their properties. As of now I am returning:

  • Name
  • Template Path
  • Tag Path
  • x Coordinate
  • y Coordinate

I created a class containing this information, appended the instances of the classes to a list, then made a new list sorted off of the x and y coordinates.

I now want to open a new window that will allow me to step through the sorted list one template instance as a time.

I think I need to use a template canvas but I’m not sure how to add instances dynamically.

Any ideas? Could I make a template instance, embed it in a window, then change the template instance’s template path programmatically?

I ended up creating a new template instance, embedding it on a screen, and then changing the template path to point to different template types as I iterated through using the .setTemplatePath() method.