Creating an offcurve node in 2.3

Possibly related to Cannot check node type , one of my scripts used to work but now doesn’t, and I’ve narrowed it down to:

> print(GSNode((100,200), GSOFFCURVE).type)
line

(The docs say to use OFFCURVE rather than GSOFFCURVE, but NameError: name 'OFFCURVE' is not defined.)

I usually need to do a specific from GlyphsApp import OFFCURVE, LINE etc., not sure why your first line does not work. What happens after you add it to a path?

I get a line, not a curve. But I will try with the import.

> from GlyphsApp import OFFCURVE
> print(GSNode((100,200), OFFCURVE).type)
line

:frowning:

> from GlyphsApp import OFFCURVE
> print(GSNode((100,200), type=OFFCURVE).type)
offcurve

Aha, thank you very much! Here’s a docpatch:

--- a/ObjectWrapper/GlyphsApp/__init__.py
+++ b/ObjectWrapper/GlyphsApp/__init__.py
@@ -5473,7 +5473,7 @@ Implementation of the node object.
 For details on how to access them, please see :class:`GSPath`.nodes


-.. class:: GSNode([pt, type])
+.. class:: GSNode([pt, type = type])

        :param pt: The position of the node.
        :param type: The type of the node, LINE, CURVE or OFFCURVE

Applied, thanks