# GetExternalObjectMap()

> Gets a copy of the external object map used by the AssetImporter.

## Definition

* **Type:** Method
* **Namespace:** [UnityEditor](/engine/6000.7/script-reference/unityeditor.md)
* **Assembly:** UnityEditor.CoreModule

```csharp
public Dictionary<AssetImporter.SourceAssetIdentifier, Object> GetExternalObjectMap()
```

### Returns

| Type                                                                                                                         | Description                                        |
| ---------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------- |
| [Dictionary\<SourceAssetIdentifier, Object>](https://learn.microsoft.com/dotnet/api/system.collections.generic.dictionary-2) | The map between a sub-asset and an external Asset. |

### Remarks

Changing the map does not affect the state of the AssetImporter.

Additional Resources: [AssetImporter.AddRemap](/engine/6000.7/script-reference/unityeditor/assetimporter/addremap.md), [AssetImporter.RemoveRemap](/engine/6000.7/script-reference/unityeditor/assetimporter/removeremap.md).

### Examples

```csharp
using UnityEditor;
using UnityEngine;

public class GetExternalObjectMapExample
{
    [MenuItem("Tools/GetExternalObjectMapExample")]
    static void Example()
    {
        var importer = AssetImporter.GetAtPath("Path/To/Your/Asset");
        //Get external object map from asset pack importer
        var externalObjectMap = importer.GetExternalObjectMap();

        //Log each external reference if any exist; otherwise, report that none are present
        if (externalObjectMap.Count > 0)
        {
            foreach (var map in externalObjectMap)
            {
                Debug.Log($"{map.Value} path: {map.Key} in asset pack importer at path: {importer.assetPath}");
            }
        }
        else
        {
            Debug.Log("No external object map found for the specified asset pack importer.");
        }
    }
}
```
