Tag change script "valueChanged": tag object

Hi guys,
This is a "PyTagNodeWrapper", but I couldn't find anything with that name in the docs.
Is it even supposed to be exposed to scripts?

This is just out of curiosity.
I was trying to get to a BasicTagPath object to retrieve the tag's folder path, but it seems that system.tag.writeBlocking works with a relative path, so I didn't need it after all.

Don't know about the PyTagNodeWrapper docs.

However, if you want to check the value of the currentValue object you need to actually access the value of the Qualified Value.

if currentValue.value != 0:
    #do stuff

#or this is equivelant
if currentValue.value:

A qualifiedValue object will never be equal to 0, so you're not actually preventing the write operation from occuring, which means that you are writing to your tag more often than you may be expecting.

1 Like

The PyTagNodeWrapper is, as the name implies, a "wrapper" class that just makes things a bit more ergonomic to use from Python.

In this case, it's a wrapper around a TagNode class, which, I think just as an oversight, also isn't documented in the API. The wrapper basically gives you easier access to values inside the tag, so something like tag.historyEnabled should resolve.

1 Like

You're absolutely right, my mistake.
Glad you caught it for me!

Gotcha, thanks!