How to set unique names to new "obj" files?

I've noticed that if I insert "obj" files in simulation while using "AddConvexMesh", the names given to the inserted entities are random long strings, see the upper three:http://www.compactech.com/microsoft/pics/un1.jpg

Is there a better method for naming new objects (such as a counting-up integer)? If not, I'll have to program it.

Thanks,

Uri.

[619 byte] By [UriKartoun] at [2008-1-10]
# 1

I just solved it:

use AddConvexMesh function that looks like that:

Code Snippet

public void AddConvexMesh(string name, float id, Vector3 pos, float angle, Vector3 veloc)

{

Shape cshape = null;

SimplifiedConvexMeshEnvironmentEntity centity = new SimplifiedConvexMeshEnvironmentEntity(

pos,

name,

cshape);

centity.State.MassDensity.Mass = 30;

centity.State.Velocity.X = veloc.X;

centity.State.Velocity.Y = veloc.Y;

centity.State.Velocity.Z = veloc.Z;

centity.State.Pose.Orientation = Quaternion.FromAxisAngle(0, 1, 0, (float)(angle * Math.PI / 180.0));

centity.State.Name = "Convex mesh:" + name + ":" + id.ToString();

SimulationEngine.GlobalInstancePort.Insert(centity);

}

where the id variable is a unique value (integer) that represents each entity inserted to the simulated model.
UriKartoun at 2007-10-3 > top of Msdn Tech,Microsoft Robotics Studio,Microsoft Robotics - Simulation...

Microsoft Robotics Studio

Site Classified