> For the complete documentation index, see [llms.txt](https://raia-software-inc.gitbook.io/tacview-2-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://raia-software-inc.gitbook.io/tacview-2-documentation/api-reference/api-reference/telemetry-objects/get-object-long-name.md).

# GetObjectLongName()

Returns the long name of an object.

Use this function when your add-on needs a clear, readable object name for user interface output.

The long name is usually more descriptive than a short designation, but less verbose than a full name.

## Syntax

```lua
objectLongName = GetObjectLongName(objectHandle [, telemetryTime])
```

## Parameters

### objectHandle

Type: `object handle`

Handle of the object.

### telemetryTime

Type: `number`

Optional high-resolution Unix timestamp.

When this parameter is omitted, Tacview returns the long name available at the current telemetry playback time.

## Return value

Type: `string`

Returns the long name of the object.

Returns **nil** if no long name is available.

This can happen if the object handle is invalid, if the object has been deleted, or if no long name is defined for that object.

## Remarks

The long name corresponds to the `LongName` object property.

This value can come directly from telemetry data, but it is often inferred by Tacview when the object is identified through the object database. Many telemetry files only specify a basic `Name` property, while Tacview may be able to provide a more descriptive `LongName`.

The `telemetryTime` parameter does not need to match an exact data sample. Tacview high-level helpers try to return the most appropriate value available for the requested time.

The long name is intended for readable user-facing text.

It is usually a good choice for verbose UI output, reports, analysis panels, tooltips, and exported tables.

Examples of long names:

```
F-14D Super Tomcat
B206 JetRanger
T-80
```

The long name is not necessarily very long. It simply tries to provide a clearer name than a compact designation when more information is available.

Use `GetObjectShortName()` instead when space is limited, such as in 2D or 3D labels.

Use a full name function when you need the most detailed name available, even if it may be too verbose for normal UI display.

## Example

### Display active fixed-wing aircraft names

```lua
local activeUnitCount = GetActiveUnitCount()

for activeUnitIndex = 0, activeUnitCount - 1 do

	local objectHandle = GetActiveUnitHandle(activeUnitIndex)

	if objectHandle ~= nil and ObjectHasAllTags(objectHandle, TelemetryTags.FixedWing) then

		local objectLongName = GetObjectLongName(objectHandle)

		if objectLongName ~= nil then

			LogInformation("Aircraft: {0}", objectLongName)

		end
	end
end
```

## Example

### Read a name at a specific playback time

```lua
local telemetryTime = GetTelemetryPlaybackTime()
local objectLongName = GetObjectLongName(objectHandle, telemetryTime)

if objectLongName ~= nil then

	-- Use the best long name available for this telemetry time.

end
```

## Requirements

Tacview 2.0.0 or later

## See also

* [GetActiveUnitCount()](/tacview-2-documentation/api-reference/api-reference/telemetry-objects/get-active-unit-count.md)
* [GetActiveUnitHandle()](/tacview-2-documentation/api-reference/api-reference/telemetry-objects/get-active-unit-handle.md)
* [ObjectHasAllTags()](/tacview-2-documentation/api-reference/api-reference/telemetry-objects/object-has-all-tags.md)
* [GetTelemetryPlaybackTime()](/tacview-2-documentation/api-reference/api-reference/playback-control/get-telemetry-playback-time.md)
