Rename name of UDT with a script

I create list of udt with differents attributs.
Now I want mofify the name of UDT but I met a problem Ignition give an error : does not writing of the tag and the project is Mode read/ write gateway.
Here is the script : system.tag.write("[]Tag.name",‘test’,1)

Thank You for your help.

Nadya,

I don’t think there will be any problem in modifying the UDT name.

Can you please elaborate the problem.

What i understand,
You have created 1 UDT under this UDT suppose you have 1 Expression tag and that tag have script that you mentioned.

If this is correct then there should not have any issue.

Hello Niks,

Thanks for take the time to help me. :smiley:

In fact, I generate several UDTs with a script which import file csv and add tag with differents attributs.
system.tag.addTag(parentPath=“ControlLoops”, name=“Test2”, tagType=“UDT_INST”,
attributes={“UDTParentType”:“ControlLoop”},
overrides={“conf_PV_max”:{“Expression”:"{[~]Boucle de Regulation/Boucle Classique/%s}" % row[“Mesure Process”] }…

No problem with this instruction but now I want modify just the name of UDT with a script, it’s not possible.
I can modify the differents attributes of UDT for example “conf_PV_max” with this instructions system.tag.write("[]Test2/conf_PV_max",‘Test’,1). but no the name.

Ignition generate an error tag does not writing with this instruction system.tag.write("[]Test2.name",‘Test’,1).
You understand now what is the problem, I try differents solutions none works :cry:

Thanks

you cant write to every attribute using system.tag.write. you may want to try using the editTag function of the ialabs scripting module, that would be your best bet at doing this.

I try it, it just edit and not write :cry:
Tks

Thank you Diat150

I try again with this instruction print system.tag.editTag(tagPath=“test/Test2”, attributes={“Name”:“ttt”} ) and finally it works

Thank you very much for your help