When I use Lua script to create a new object, (e.g. a cuboid), I can not give the new object a proper name.
The function usage is
int objectHandle=sim.createPureShape(int primitiveType,int options,table[3] sizes,float mass,table[2] precision=nil)
It is not easy to use when the created object does not have a customized name.
So, how to create an object with a customized name?
How to create an object with a customized name?
Re: How to create an object with a customized name?
Hello,
you will have to use
Starting with CoppeliaSim V4.3.0, object names will be deprecated and object aliases used instead: they will allow for non-unique aliases, and be very convenient for object access via an absolute or relative path, e.g.
Cheers
you will have to use
sim.setObjectName
(and maybe also sim.getObjectName
), but keep in mind that object names have to be unique. Use sim.handleflag_silenterror to generate silent errors and find out whether a name already exists (or contains illegal chars).Starting with CoppeliaSim V4.3.0, object names will be deprecated and object aliases used instead: they will allow for non-unique aliases, and be very convenient for object access via an absolute or relative path, e.g.
sim.getObjectHandle("./path/to/alias")
.Cheers