3 Replies Latest reply on Jun 26, 2013 9:16 PM by plac88

    AF Template Element Tag Creation






      I'm not sure this is the right place, but here we go:


      My problem is naming a AF Template Element which is a common element and appears in many hierarchal levels. 


      I want to automate the naming, using: placeholders: "%..\..\Element% and so on". The problem is that putting a number of placeholders equals to the depth of the hierarchy, 


      the common elements at upper levels keep the name of the tag with hierarchically unnecessary "%..\..Element%".


      So my question is, there is a way to put a placeholder that works like "optional" without me having to remove by hand, or if there is other way of doing it?


      Hope i made myself clear, it's kind of an abstract question to do.


      Thanks in advance. 

        • Re: AF Template Element Tag Creation

          You are better off creating a flat list of Elements - and use that for Tag creation.


          Once you have the Elements, use Element references to create Element hierarchies - I'm sure you'll need more than one hierarchy.  AFBuilder can speed things up.

            • Re: AF Template Element Tag Creation
              Roger Palmen



              I use a similar setup, where i have up to 7-8 levels in my hierarchy, and the lowest element in the hierarchy actually holds the Attributes that link to the PI Points. The PI Points need to have a name that reflect the position in the hierarchy.


              On each element (hurray to template inheritance!) i have e.g. an attribute called 'codename' containing the Pointcoding-part from that element, and on every element i have an attribute called 'code' that is the concatenation of the parent element attribute 'code' and the 'codename' of the current element. This effectively adds the codename attribute each level down to that from the parent. Unfortunately, AF does not support strings in formula's. I solved this by creating the StringConcat DataReference (see code examples for custom datarefences) which lets me concatenate the parts.


              An example:

              Level Element codename code
              1 Plant P21 P21
              2 Process DZ4 P21-DZ4
              3 Unit PG12 P21-DZ4-PG12

              Hope this helps!