Home/ Reference/ Curve & Node

subpath.ReverseDirection()

Reverses path direction. Inside/outside tests, holes, and boolean results that come out backwards are usually a direction problem — flip it and move on.

Signature

subpath.ReverseDirection()

Notes

Reverses path direction. Inside/outside tests, holes, and boolean results that come out backwards are usually a direction problem — flip it and move on.

Python example (runnable)

Requires pywin32. The example assumes app / doc / page / layer are already connected. See Connection & Init
Python
shape = app.ActiveSelectionRange(1)
shape.ConvertToCurves()

c = shape.Curve
if c.SubPaths.Count > 0:
    sp = c.SubPaths.Item(1)
    print("Clockwise before reversing: ", c.IsClockwise)
    sp.ReverseDirection()
    print("Clockwise after reversing: ", c.IsClockwise)

About this section: Curve & Node

Curve & Node — subpaths and nodes.

Other entries in this section