Page 1 of 1

How can i remove objects from the scene

Posted: 22 Mar 2023, 04:54
by dkchaisumdet
Hello,

When i try to remove objects this way I get an error

27: in sim.removeObjects: one of the function's argument type is not correct.

Code: Select all

function sysCall_actuation()
    shapeHandle=sim.getObject('/Shape',{noError=true})
    if(not sim.isHandle(shapeHandle)) then
   createdShape=simSurfRec.reconstruct_scale_space(pointCloudHandle,4,12,300,0.001)
    shapeHandle=sim.getObject('/Shape')
    else
    
    sim.removeObjects(shapeHandle)

    --local createdShape=simSurfRec.reconstruct_scale_space(pointCloudHandle,4,12,300,0.001)
    end
end
Thanks

Re: How can i remove objects from the scene

Posted: 22 Mar 2023, 07:15
by coppelia
Hello,

sim.removeObjects expects a table as argument. So instead of sim.removeObjects(objectHandle), do sim.removeObjects({objectHandle})

Cheers