# Sandbox.Model.TryGetData

## Overload 1

```csharp
bool TryGetData(out T data)
```

Tries to extract data from model based on the given type's [ModelDoc.GameDataAttribute](/api/Sandbox.ModelEditor.GameDataAttribute).

### Parameters

- `out data` (`T`): The extracted data, or default on failure.

### Returns

`bool`: true if data was extracted successfully, false otherwise.

## Overload 2

```csharp
bool TryGetData(System.Type t, out object data)
```

Tries to extract data from model based on the given type's [ModelDoc.GameDataAttribute](/api/Sandbox.ModelEditor.GameDataAttribute).

### Parameters

- `t` (`System.Type`): The class with [ModelDoc.GameDataAttribute](/api/Sandbox.ModelEditor.GameDataAttribute).
- `out data` (`object`): The extracted data, or default on failure.

### Returns

`bool`: true if data was extracted successfully, false otherwise.

Declared in [Sandbox.Model](/api/Sandbox.Model).
Assembly: `Sandbox.Engine`.
