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

Version 2.1 by Hunter on 2026/10/08 15:50

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. 

Error

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

WXWorkCapture_17914453906582.png