Deciphering a key associated with property overrides

I’m trying to dig down on the overrides of a list of UDT instances to get their overrides and have them in at least a semi-readable format. I have some messy code that gets a list of the OverrideMap objects for each instance. I’m trying to get some sort of path for each of these - so far all I can find is a keyset (something like ‘42d48838-e9d8-4aa4-adce-c3c532da94dd’) and occasionally a meaningful tag name will be in the value as a part of something like an ExtendedPropertySet.

Anyone know how I can get something like the path for each override?

Here’s the portion of my code I have so far that gathers all this information. Not the most readable thing but works so far.

overrides = [[x for x in z if str(x[1]) <> "{}"] for z in 
				[ zip(o.keySet(), o.values()) for o in 
					[t.value for t in system.tag.readAll([p + ".PropertyOverrides" for p in tagSet])]] ]

I don’t know off the top of my head how to reverse from a UID into an instance/member item, but you can clean up the code a bit thanks to Jython’s automagic iteration:

v ="UDT Instance.PropertyOverrides").value

for key in v:
	props = v.getOrCreate(key)
	for prop in props.getProperties():
		print key, prop, props.get(prop)
1 Like

That helps a lot! Much more readable now at least.

I have a workable solution, not my favorite but it does the job for my purpose. I noticed the “UDTMemberUID” property in the Tag Attributes page. Sure enough, there is one of these for each item in a UDT and they are consistent across instances. So I grab one, use browseTags() and collect the UDTMemberUID for each then convert using that.

I’m wondering if there is any way to read the values from the UDT definitions themselves - right now, I have to actually find a UDT instance to try and get the UIDs. I’d like to be a bit more abstract here if I can, and just get them straight from the definition. I know that they’re prefaced by “types”, and I’ve used browseTags to actually find them all, but using read on them just gives a null value on any member of that UDT. Is it possible to do this?