How to get an object's name in a Lua script?

Version 3.1 by Hunter on 2026/10/08 15:58

In PIStudio, right click the object on the screen and select [Copy object name] option for copy object name into clipboard, then paste into the Lua script.

copyobjectname.png

For the Lua custom curve example, the object name is "0_CST_0". The first "0" indicates screen number 0, and the final "0" indicates the object's creation index, starting from 0. "CST" indicates that the object is a custom object. For more information of custom curve or custom table, please refer to the following link:

Custom Curve

Error

If the object name is incorrect, the Lua script will fail to manipulate the target object.

WXWorkCapture_17914453906582.png