system.tag.importTags
This function is used in Python Scripting.
Description​
Imports a JSON tag file at the provided path. Also supports XML and CSV Tag file exports from legacy systems.
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.importTags(filePath, basePath, [collisionPolicy])
Parameters​
Type | Parameter | Description |
---|---|---|
String | filePath | The file path of the tag export to import. |
String | basePath | The Tag path that will serve as the root node for the imported tags. |
String | collisionPolicy | The action to take when a tag or folder with the same path and name is encountered. Defaults to Overwrite. [optional]. Possible values include:
|
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
# This script will import a .json file containing Sine Tags from the desktop into a folder in the Tag Browser called "Imported Tags".
filePath = "C:/Users/[USERNAME]/Desktop/SineTags.json"
basePath = "[default]Imported Tags"
system.tag.importTags(filePath,basePath)