[Feature-2684]Scripting - Tag group - Create / Delete

8.1.5

I don’t find any exemple to manage, create, delete tag group with scripting.

Is there a way to do that ?

Hi @luc.martin, I don’t think it is possible, but I’ve never looked into it too deeply so :man_shrugging:

Just out of interest why would you need to manage tag groups in this way? Could be worth a feature request.

There is a series of commands to do that.
system.tag.*
has commands to create (add in 7.9.x/configure in 8.x), edit, delete, organize, retrieve.
Everything I’ve ever needed is already there.

I use scripting to manage, create and delete my UDTs, so I want to validate if tag group exist and configured correctly when I plublish an update.

Unfortunately there doesn’t seem to be anything for manipulating tag groups there. Those set of functions only seem to encompass tag manipulation (as far as I can see).

That makes sense and it could be quite useful. If you don’t get an answer definitely look into making a feature request.

I was about to say to put it in the ideas portal. :slight_smile:

I thought there was already one there, but I don’t see it.

1 Like

You’re not missing anything, but yes, this should definitely be possible.

2 Likes

On a related note, do any of you know if there currently is a way to retrieve a list of existing tag groups via scripting?

How is going this feature?

I just came to a situation when this would be a very useful feature…

this will get you a list of all the tags of the given provider (this case default)

from com.inductiveautomation.ignition.gateway import IgnitionGateway
provider = IgnitionGateway.get().getTagManager().getTagProvider('default')
taggroups = provider.getTagGroupsAsync().get()
names = [x.getName() for x in taggroups]

there is also saveTagGroupsAsync() and removeTagGroupsAsync()
https://files.inductiveautomation.com/sdk/javadoc/ignition81/8.1.0/com/inductiveautomation/ignition/common/tags/model/TagProvider.html#getTagGroupsAsync()

2 Likes

Thank you, but this is what I get (v8.1.10):

you can not use this in the script console

1 Like

OK, thank you, but I need this in Vision, not Perspective…

Send a message to a message handler.

Ok, but from where?
Sorry but … I’m :confused:

Wherever you needed it in Vision?

Define a gateway message handler in your project that will run @victordcq’s gateway-scoped code. Call that message handler from anywhere in Vision Client scope using system.util.sendMessage or sendRequest.

2 Likes

Now I understand.
Thank you. :+1:

1 Like

Is this the only way (or at least the best/easiest way) to get a list of tag groups?