points_save()

Saves the current set of points from the global program state to a file in the profile directory.

The function accepts a filename (or relative subpath) and writes the point data to that file.

It returns the number of points saved.

Syntax

planetcnc.points_save(filename)

Parameters

Parameter Type Description
filename str A string representing the name of the file (or relative path) from which to load points.

Return Value

Examples

#! /usr/bin/env python 
 
import planetcnc
 
# Save the current points to a file named "points_backup.dat" in the profile directory.
num_saved = planetcnc.points_save("points_backup.dat")
print(f"Saved {num_saved} points to 'points_backup.dat'.")

See also

points_clear
points_count
points_add
points_get
points_set
points_delete
points_load
points_save