system.tag.browseTags

I’m trying to get a complete list of all the tags using system.tag.browseTags, problem is it’s sloooowww. The following code prints 3000 tags but takes 11-12 seconds to run. It’s not my computer, I’m running Win7, Core i7, with 8G RAM.

[code]def getTagsForFolder(Folder):
import system
import app.wims

tags = system.tag.browseTags(Folder)
for tag in tags:
	if tag.isFolder() or tag.isUDT():
		app.wims.tag.getTagsForFolder(tag.fullPath)
	else:
		print tag.path[/code]

I’m trying to get a list of the tags in the Internal tag provider. Any ideas on how to speed this up or perhaps a different way to go about it?

Also, the system.tag.browseTags() function only works if you tell it what provider to use, if I don’t it will error out saying it can’t find the “default” provider.

You do need to specify the provider. If you don’t, we try to use the provider named “default”, not the default of your project. It is going to be slow since it will make several calls to the Ignition Gateway. Each call takes around 100 ms or maybe a little more. I will add a request in to add a recursive flag to the function so you only have to do one call.