Skip to main content
Version: 8.1

system.tag.deleteTags

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 run in the Gateway scope.

Syntax​

system.tag.deleteTags(tagPaths)

Parameters​

TypeParameterDescription
ListtagPathsA 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​

Example #1 - 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])