1 Reply Latest reply on Oct 14, 2016 8:50 AM by Asle Frantzen

    How to modify AF database name in PI processbook multi state symbol in bulk?

    Royjohn

      I have more than 50 multi state symbols in one single Processbook screen. My AF database name is now modified .How to rename this AF database name in all multi sate symbol mapping?(refer image).Doing it manually is very time consuming.I tried "Proceesbook tool", but I cant see anything to change AF tags. I can export AF tags in CSV file but there is no "rename" or "replace" option for AF tags.How to achieve this ?

        • Re: How to modify AF database name in PI processbook multi state symbol in bulk?
          Asle Frantzen

          Hi

           

          It's been some time since I used the ProcessBook Support Tool, so I wouldn't know any tricks there. But you could definitely do this in ProcessBook if you write a small VBA script.

           

          Open the PI ProcessBook Programmer Reference Guide from the help menu, and navigate to the MultiState section. There you will see an example on how to use this, and you should be able to read out the current config string using MultiState.GetPtTagName, then manipulate the string (replace the old name with the new), and then set it using MultiState.SetPtTagName.

           

          Loop through all the symbols in the display and use MySymbol.GetMultiState to find all the multistates.

           

          You can either add this code directly to your display and activate it using a button, or you can create another display which acts as a "renaming application" and then add the code to change any other open displays in your current ProcessBook session.

           

           

          Another way to achieve your goal might be to save your display as .SVG, then open it in a text editor and do a find/replace there. Then you can open that .SVG in ProcessBook and re-save it as PDI. Please note that any VBA code will be lost during this transaction so make sure you're working on a copy of your display so you have backup.