Quantcast
Channel: Scripting - McNeel Forum
Viewing all articles
Browse latest Browse all 5882

Removing curve grips within python

$
0
0

@Telfer_Scott wrote:

I want to be able to automatically select and delete grips from a curve object using a python script, i.e. if two grips were very close together.

The example below seems to fall down because it's looking for a point on the curve rather than the grip itself. It's probably possible to write a separate function to find the closest point on the curve to the grip, but is there a more straightforward way of removing a grip from an object?

import rhinoscriptsyntax as rs

# Curve from points
point_list = [(0, 0, 0), (0, 1, 1), (0, 15, 5), (0, 3, 6), (0, 20, 20)]
curve = rs.AddCurve(point_list)

# Curve control points
control_points = rs.CurvePoints(curve)
point_to_remove = control_points[1]

# Attempt to remove second point from curve
rs.Command("-_RemoveControlPoint " + "selid " + str(curve) + "_enter " + 
    "selid " + str(point_to_remove) + " _enter ")

Posts: 3

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 5882

Trending Articles