Skip to end of metadata
Go to start of metadata

This function is used in Python Scripting.

Description

Deletes multiple Tags or Tag Folders. When deleting a Tag Folder, all Tags under the folder are also deleted.

Client Permission Restrictions

Permission Type: Tag Editing

Client access to this scripting function is blocked to users that do not meet the role/zone requirements for the above permission type. This function is unaffected when ran from the Gateway scope.

Syntax

system.tag.deleteTags(tagPaths)

  • Parameters

List tagPaths - A List of the paths to the Tags or Tag Folders that are to be removed.

  • Returns

List - A List of QualityCode objects, one for each Tag in the list, that is representative of the result of the operation. See Scripting Object Reference.

  • Scope

Gateway, Vision Client, Perspective Session

Code Examples
Code Snippet - Deleting Tags
# This example will delete several Tags. Modify the paths argument to change which Tags will be deleted. 
# Note that a confirmation isn't automatically included, so be cautious when calling this on a production server. 

paths = [
	'[default]A_Tag',
	'[default]Folder/Some_Other_Tag'
]

# Delete the Tags.
results = system.tag.deleteTags(paths)

# We could expand this example further by examining the list of quality codes...
for index in range(len(results)):

	# ...check if a returned anything except Good.
	if results[index].isNotGood():
		
		# ...and do something if we failed, such as retrieve the Tag path from earlier, and pair it with a quality code. 
		print 'Could not delete tag at path: %s \n Reason: %s' % (paths[index], results[index])
Keywords

system tag deleteTags, tag.deleteTags