# SimConnect_AIRemoveObject The **SimConnect\_AIRemoveObject** function is used to remove any object created by the client using one of the AI creation functions.   ##### Syntax ``` cpp HRESULT SimConnect_AIRemoveObject( HANDLE hSimConnect, SIMCONNECT_OBJECT_ID ObjectID, SIMCONNECT_DATA_REQUEST_ID RequestID ); ```   ##### Parameters {{< table-wrapper >}} | Parameter | Description | Type | |---------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------| | *hSimConnect* | Handle to a SimConnect object. | Integer | | *ObjectID* | Specifies the server defined object ID (refer to the [SIMCONNECT\_RECV\_ASSIGNED\_OBJECT\_ID](../structures-and-enumerations/simconnect-recv-assigned-object-id/) structure). | Integer | | *RequestID* | Specifies the client defined request ID. | Integer | {{< /table-wrapper >}}   ##### Return Values The function returns an **HRESULT**. Possible values include, but are not limited to, those in the following table. {{< table-wrapper >}} | Return value | Description | |--------------|-------------------------| | S\_OK | The function succeeded. | | E\_FAIL | The function failed. | {{< /table-wrapper >}}   ##### Remarks A client application can only remove AI controlled objects that it created, not objects created by other clients, or by the simulation itself.