How to replace any particular object in mesh

I added one object by AssetsManager in mesh. I again added second object by OBJ file by this way
replaceMesh(path, file)
{
BABYLON.SceneLoader.ImportMesh("", path, file, scene, function (myMeshtwo) {});
}
second object I added by button onclick.
Now i want to replace second object. To replace it, I did this
replaceMesh(path, file)
{
myMeshTwo.dispose();
BABYLON.SceneLoader.ImportMesh("", path, file, scene, function (myMeshtwo) {});
}
so i am trying to dispose second object and added new object, but it’s not working.
I also try
for (mesh of myMeshtwo)
mesh.dispose();
error: myMeshtow is undefined

I also try to get mesh by id and dispose but not get luch.
var mymesh = scene.getMeshById(“myMeshtwo”);
If I try to add mesh id by putting name
BABYLON.SceneLoader.ImportMesh(“meshname”, path, file, scene, function (myMeshtwo) {});
It’s not load new object.

Hello can you provide a repro in the Playground?
What do you mean by:

It is like 1st object is a human body and 2nd object is a garment on it. I want to replace that garment by clicking new one.

I am new here. Can you please tell me the way how to create Playground. I can’t see option to create it.

I got a solution to replace second object. now first object remains same and second can be replace by any number time.
I just declare a variable
var secondMesh=’’;

replaceMesh(path, file)
{
if(secondMesh.length>0){
for(mesh of secondMesh)
mesh.dispose();
}
BABYLON.SceneLoader.ImportMesh("", path, file, scene, function (myMeshtwo) {
secondMesh = myMeshtwo;
});
}

Now it’s working fine.

Excellent.

For the playground:Introduction to the Playground - Babylon.js Documentation