Referencing view parameters in perspective via scripting

While you are able to use system.tag.write() in perspective, you should use system.tag.writeAsync() as system.tag.write() is essentially deprecated (in your script type out “system.tag.” then hold Ctrl and tap Space to see available methods).

Assuming self.parent.parent indeed refers to the View, then you should try one of two ways (which should both do the same thing):

  1. str(self.parent.parent.params.MotorNumber)

or

  1. str(self.view.params.MotorNumber)

Option 2 will remove the potential issue which could pop up if you ever move the component into a container at a different level.

Further documentation.

2 Likes