points_delete()

Deletes a point from the points collection by its index.

If the index is invalid, returns None.

Syntax

planetcnc.points_delete(index)

Parameters

Parameter Type Description Comment
index int The index of the point to delete.

Return Value

Examples

#! /usr/bin/env python
 
import planetcnc
 
# Delete the third point in the collection
result = planetcnc.points_delete(2)
if result is not None:
    print("Point deleted. Remaining points:", result)
else:
    print("Invalid index, no point deleted.")

See also

points_clear
points_count
points_add
points_get
points_set
points_delete
points_load
points_save