Pick and Drag with Python?

Hi all, @stevebaer,

is there a way to simulate control point dragging with Python?
Means picking a (temporary) point and move it to a new location with a single mouse click?

What I’m doing right now is adding “control points” as point objects to the document, then the user has to select a point and click again for the new location (usually constrained to some geometry). Works fine, but takes two mouse clicks.

I’d prefer a way to make it feel like the usual Rhino behavior but I don’t see a way how to do it.
Am I’m missing something?

Thanks for ideas!
Jess

Hi Jess, not sure if this helps here but gp.Get(True) acts on mouse up not mouse down.

_
c.

1 Like

Perfect! Thanks!

Edit: Almost; immediate mouse up continues the gp.get which is not exactly Rhino like dragging.
Trying to find a break… :wink:

Hi Jess,

below is some kind of drag mode for points. It requires Point Osnap to be enabled:

DragPoint.py (1.7 KB)

_
c.

1 Like

Thanks Clement, that’s a pretty cool “workaround”.
Still I wonder if there is another “hidden” option which we’ve missed.
@stevebaer what do you think about dragging objects with Python?