Scripting using a UDT Property

I have a UDT called “Motor_Block” that I am trying to utilize on a template. I was originally using an indirect tag, but have changed to using a property of the UDT in a script.

The script is as follows:

x = (“event.source.parent.parent.MotorTag.PROG_AUTO”)

if x.value is True:
system.tag.write(“event.source.parent.parent.MotorTag.PROG_AUTO”, 0)
system.tag.write(“event.source.parent.parent.MotorTag.PROG_AUTO”, 1)

When I run in Preview mode and click on the group associated with the script, I get the following error:

Traceback (most recent call last):

File “event:mouseClicked”, line 2, in

ValueError: Token PROPERTY_SEPARATOR found after property name.

Ignition v7.6.1 (b2278)
Java: Sun Microsystems Inc. 1.6.0_45

Any assistance would be greatly appreciated!

You can’t reference a UDT custom property from outside the UDT. To get around it, create a memory tag in your UDT and set it’s value to the custom property, then reference the memory tag in your project.