Take back an override of a nested UDT instance via script?

Hello, thanks for the solution, but that is not what I want to do.

If I do it like this then the value of the enabled attribute will be True, but it still will be overridden. I know how to change the value from True to False and back, but I need to remove the override itself.

Here is the code I use:

#search for disabled childUDT, and enable it
parentPath = "[default]Project"
udtParentType = "parentUDT"
parentList = system.tag.browseTags(parentPath=parentPath,
				   tagPath="*",
				   tagType="UDT_INST",
				   udtParentType=udtParentType,
				   recursive=True,
				   sort="ASC")
childList = []
for udt in parentList:
	udtParentType = "childUDT"
	childList += system.tag.browseTags( parentPath=udt.fullPath + "/someFolder",
					    tagPath="*",
					    tagType="UDT_INST",
					    udtParentType=udtParentType,
					    recursive=False,
					    sort="ASC")

childListAttributEnabledPaths = [udt.fullPath+".enabled" for udt in childList]
childListAttributEnabledValues = system.tag.readAll(childListAttributEnabledPaths)
childListAttributEnabledPaths2True = []
for v, p in zip(childListAttributEnabledValues,childListAttributEnabledPaths):
	if not v.value:
		childListAttributEnabledPaths2True.append(p)
		
valueList = [True for _ in childListAttributEnabledPaths2True]
system.tag.writeAll(childListAttributEnabledPaths2True, valueList)

But like I sad this is not what I want.

In child instances of a UDT if the override exists and I change the default value in the UDT definition it will not apply to that instance, and it is not important if the override is the same as the default or not.

Here an example:
A) DataType/parentUDTDef with chidlUDT nested and the default value for attribut enabled = True
B) DataType/childUDT

  1. Project/Instance of UDTDef with childUDT override Enabled = False
  2. Project/Instance of UDTDef with childUDT override Enabled = True
  3. Project/Instance of UDTDef with childUDT and no override of the enable attribute value = default

So the 2) and 3) instances have the same value for enabled = True, the difference is the 3) instance is not overridden. If I now change the default value in A) to enabled = False
Only the Instance 3) will have this change to, and now the 1) and the 3) have the same value for attribute enabled, and because 1) and 2) have overridden values the change of the default will not have an effect on them.

My goal is to completely remove the override in 1) and 2), whether true or false and reset it to the default value.