# How to use GSPath.removeNodeAtIndex\_() correctly

**URL:** <https://forum.glyphsapp.com/t/how-to-use-gspath-removenodeatindex-correctly/35295>\
**Category:** Scripting\
**Created:** [October 4, 2025, 4:03pm UTC](https://forum.glyphsapp.com/t/how-to-use-gspath-removenodeatindex-correctly/35295 "2025-10-04T16:03:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![SCarewe](https://forum.glyphsapp.com/user_avatar/forum.glyphsapp.com/scarewe/32/18952_2.png) [@SCarewe](https://forum.glyphsapp.com/u/SCarewe)\
**Post date:** [October 4, 2025, 4:03pm UTC](https://forum.glyphsapp.com/t/how-to-use-gspath-removenodeatindex-correctly/35295/1 "2025-10-04T16:03:00Z")

</div>

Hello, I have a question regarding `GSPath.removeNodeAtIndex_()`. I am trying to use the method in order to remove duplicate nodes like this:

 ![image](https://forum.glyphsapp.com/uploads/default/original/3X/4/3/430b1fc91c29972d0c1a5af79f5542f894f5b571.png)

However, when I run the method, the following happens:

 ![image](https://forum.glyphsapp.com/uploads/default/original/3X/7/6/76f56b647c0cd4a05a4c46479f0d09d13b82d368.png)

Any reason the offcurve nodes need to be deleted as well? I would like to keep them. Same happens if I do `GSPath.nodes.remove(node)`.

---

<div class="post-metadata">

**Author:** ![GeorgSeifert](https://forum.glyphsapp.com/user_avatar/forum.glyphsapp.com/georgseifert/32/259_2.png) [@GeorgSeifert](https://forum.glyphsapp.com/u/GeorgSeifert)\
**Post date:** [October 4, 2025, 9:57pm UTC](https://forum.glyphsapp.com/t/how-to-use-gspath-removenodeatindex-correctly/35295/2 "2025-10-04T21:57:15Z")

</div>

You need to remove the second of the two nodes. That is a line node that is a zero length line segments. removing it doesn’t change the path structure. the first of the two nodes might be a curve node and removing that makes the preceding segment a line (the next node is a line).
