# Closest Object problem

**URL:** https://tech-community.robotics.abb.com/t/closest-object-problem/9902
**Category:** RobotStudio
**Tags:** smart-components, robotstudio, simulation, tool
**Created:** [January 5, 2021, 5:07am UTC](https://tech-community.robotics.abb.com/t/closest-object-problem/9902 "2021-01-05T05:07:01Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Armbross](https://avatars.discourse-cdn.com/v4/letter/a/9de053/32.png) [@Armbross](https://tech-community.robotics.abb.com/u/Armbross)
#### Post date: [January 5, 2021, 5:07am UTC](https://tech-community.robotics.abb.com/t/closest-object-problem/9902/1 "2021-01-05T05:07:01Z")

</div>

Hi, I’m trying to use closest Object to do Pick N Place. I have the robot in a robot cage Cell. I’m using closest object in smart component to pick up a Object, but RS picks up the cage instead of the my intended object.

The cage is considered an object according to closest object. I want the smart component to ignore it. Is there a way to do so?

---

<div class="post-metadata">

### Author: ![Armbross](https://avatars.discourse-cdn.com/v4/letter/a/9de053/32.png) [@Armbross](https://tech-community.robotics.abb.com/u/Armbross)
#### Post date: [January 7, 2021, 6:14am UTC](https://tech-community.robotics.abb.com/t/closest-object-problem/9902/2 "2021-01-07T06:14:51Z")

</div>

[https://gofile.io/d/ylZGxi](https://gofile.io/d/ylZGxi) Heres is my file. Trying to do pick n place without picking up the cage in the process.  
Hope to receive advice

---

<div class="post-metadata">

### Author: ![j\_proulxFB](https://avatars.discourse-cdn.com/v4/letter/j/f04885/32.png) [@j\_proulxFB](https://tech-community.robotics.abb.com/u/j_proulxFB)
#### Post date: [January 7, 2021, 2:54pm UTC](https://tech-community.robotics.abb.com/t/closest-object-problem/9902/3 "2021-01-07T14:54:50Z")

</div>

I did not download your project but you may want to uncheck “Detectable by Sensors” for your cage object.

 ![image.png](https://europe1.discourse-cdn.com/flex005/uploads/robotics1/original/1X/3e8c4a367f00f4ddbbbc6d8fee7150d51c6d670d.png)

---

<div class="post-metadata">

### Author: ![Armbross](https://avatars.discourse-cdn.com/v4/letter/a/9de053/32.png) [@Armbross](https://tech-community.robotics.abb.com/u/Armbross)
#### Post date: [January 8, 2021, 4:27am UTC](https://tech-community.robotics.abb.com/t/closest-object-problem/9902/4 "2021-01-08T04:27:57Z")

</div>

I have done it, but closest object does not attach the target to gripper because the child is always changing even after I uncheck “Detectable by Sensors” for the other objects not involved in the pickNplace
