<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSBezierPath/element(at:associatedPoints:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSBezierPath(im)elementAtIndex:associatedPoints:"
  },
  "title" : "element(at:associatedPoints:)"
}
-->

# element(at:associatedPoints:)

Gets the element type and (and optionally) the associated points for the path element at the specified index.

```
func element(at index: Int, associatedPoints points: NSPointArray?) -> NSBezierPath.ElementType
```

## Parameters

`index`

The index of the desired path element.

`points`

On input, a C-style array containing up to three `NSPoint` data types, or `NULL` if you do not want the points. On output, the data points associated with the specified path element.

## Return Value

The type of the path element. For a list of constants, see [`NSBezierPath.ElementType`](/documentation/AppKit/NSBezierPath/ElementType).

## Discussion

If you specify a value for the points parameter, your array must be large enough to hold the number of points for the given path element. Move, close path, and line segment commands return one point. Curve operations return three points.

For curve operations, the order of the points is controlPoint1 (`points`[0]), controlPoint2 (`points`[1]), endPoint (`points`[2]).

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)