---
title: "element(at:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsbezierpath/element(at:)"
---

# element(at:)

Returns the type of path element at the specified index.

## Declaration

```swift
func element(at index: Int) -> NSBezierPath.ElementType
```

## Parameters

- `index`: The index of the desired path element.

## Return Value

Return Value The type of the path element. For a list of constants, see NSBezierPath.ElementType.

## Discussion

Discussion Path elements describe the commands used to define a path and include basic commands such as moving to a specific point, creating a line segment, creating a curve, or closing the path. The elements are stored in the order of their execution.

## See Also

### Related Documentation

- [reversed](appkit/nsbezierpath/reversed.md)

### Accessing Elements of a Path

- [cgPath](appkit/nsbezierpath/cgpath.md)
- [elementCount](appkit/nsbezierpath/elementcount.md)
- [element(at:associatedPoints:)](appkit/nsbezierpath/element(at:associatedpoints:).md)
- [removeAllPoints()](appkit/nsbezierpath/removeallpoints().md)
- [setAssociatedPoints(_:at:)](appkit/nsbezierpath/setassociatedpoints(_:at:).md)
