Guilin Sun
Ansys Employee

You will need to follow the example here:
https://optics.ansys.com/hc/en-us/articles/360034928733-adduserprop-Script-command

I guess there is some kind of bug, since you use

?getnamed("group")

you cannot find the object you want.

I guess it might not be designed to do this after the group script, since you have set the data to the property so you know its value.

In addition, if you use mysript as shown in the example, you cannot rename the object, somehow. when you use

set("script",'addrect;

you can change the name of the object added. however, the single quote mark thinks the group script has not stopped, I believe.