<div class="meta" robots="noindex">

</div>

Method

# Group2D.Remove

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

<div class="warning">

<div class="title">

Warning

</div>

This item was deprecated in version 2019r2. Please use `Group2D.RemoveObjectAt<group2D.removeobjectat>` as a replacement.

</div>

## Description

Removes an object specified by its reference.

## Sample code

This example removes the first object, which is the image.

``` xojo
Dim px As PixmapShape
Dim s As StringShape
Dim d As New Group2D
Dim o As New Object2D

px = New PixmapShape(DSC_0343)
d.Append(px)

s = New StringShape
s.Y = 70
s.Text = "This is what I call a REAL car!"
s.TextFont = "Helvetica"
s.Bold = True
d.Append(s)

d.Remove(0)
g.DrawObject(d, 100, 100)
```

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

This example also removes the second item, which is the text.

``` xojo
Dim px As PixmapShape
Dim s As StringShape
Dim d As New Group2D
Dim o As New Object2D

px = New PixmapShape(DSC_0343)
d.Append(px)

s = New StringShape
s.Y = 70
s.Text = "This is what I call a REAL car!"
s.TextFont = "Helvetica"
s.Bold = True
d.Append(s)

d.Remove(d.Item(1))
g.DrawObject(d, 100, 100)
```

## Compatibility

All project types on all supported operating systems.
