Home/ Reference/ Curve & Node

subpath.GetCopy() / subpath.Delete()

Copies a sub-path out as a standalone Shape, or deletes the part you don't want. Useful when splitting lettering or isolating a piece of artwork.

Signature

subpath.GetCopy() / subpath.Delete()

Notes

Copies a sub-path out as a standalone Shape, or deletes the part you don't want. Useful when splitting lettering or isolating a piece of artwork.

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 > 1:
    sp = c.SubPaths.Item(2)                         # take the second subpath
    copy = sp.GetCopy()                             # copy it out as its own shape
    print("Copy type: ", copy.Type)
    print("Subpaths left on the original: ", c.SubPaths.Count)

About this section: Curve & Node

Curve & Node — subpaths and nodes.

Other entries in this section