# accessing objects in component groups with VSTA

**URL:** <https://tech-community.robotics.abb.com/t/accessing-objects-in-component-groups-with-vsta/3232>\
**Category:** RobotStudio\
**Created:** [December 9, 2009, 12:40am UTC](https://tech-community.robotics.abb.com/t/accessing-objects-in-component-groups-with-vsta/3232 "2009-12-09T00:40:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dean\_Thomas](https://avatars.discourse-cdn.com/v4/letter/d/ac91a4/32.png) [@Dean\_Thomas](https://tech-community.robotics.abb.com/u/Dean_Thomas)\
**Post date:** [December 9, 2009, 12:40am UTC](https://tech-community.robotics.abb.com/t/accessing-objects-in-component-groups-with-vsta/3232/1 "2009-12-09T00:40:56Z")

</div>

Hi,

example code:

gcTray = activeStation..GraphicComponents[“FullTray\_1\_” + i];

This works fine as long as the graphic component is not part of a component group in Studio - how can I access the part if it is in a group?  
When there are lots of them, it makes sense to use a group to keep the layout browser neat and tidy, and also to use a macro to index.

thanks.

---

<div class="post-metadata">

**Author:** ![Johannes\_Weiman\_old\_account](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/johannes_weiman_old_account/32/3345_2.png) [@Johannes\_Weiman\_old\_account](https://tech-community.robotics.abb.com/u/Johannes_Weiman_old_account)\
**Post date:** [December 9, 2009, 9:53am UTC](https://tech-community.robotics.abb.com/t/accessing-objects-in-component-groups-with-vsta/3232/2 "2009-12-09T09:53:54Z")

</div>

Hi Dean,

You need to drill down the component hierarchy, something like this:

`GraphicComponentGroup gcg = station.GraphicComponents["name_of_group"] as GraphicComponentGroup;
GraphicComponent gc = gcg.GraphicComponents["name_of_component"];
`  
regards,  
Johannes

---

<div class="post-metadata">

**Author:** ![Dean\_Thomas](https://avatars.discourse-cdn.com/v4/letter/d/ac91a4/32.png) [@Dean\_Thomas](https://tech-community.robotics.abb.com/u/Dean_Thomas)\
**Post date:** [December 11, 2009, 1:05am UTC](https://tech-community.robotics.abb.com/t/accessing-objects-in-component-groups-with-vsta/3232/3 "2009-12-11T01:05:26Z")

</div>

THANKS:+1:
