C# which event to listen to when first point of line is drawn before end point is clicked?

Dear community,

I would like to have a plugin with a Rhino panel, where drawing events in a viewport in Rhino are handled.

Basically, I need to know which event to listen to when e.g. a line is drawn. More specifically, when the start point of a line is drawn and the user moves the mouse cursor before clicking to select the position for the end position of the line.

In fact, this event is probably used inside Rhinoceros to draw the intermediate line between the already drawn start point and the still movable line end point…

Any leads welcome…

Filip

I’m not sure what you are asking for is do-able. What are you trying to do (specifically) and why?

Dear Dale,

Thank you for your response.

I would like to have a plugin that allows interactive drawing and showing intermediate results, comparable to drawing the second point of a line.

E.g., when checking a check box in a plugin and adding a first point of a line, the mouse cursor holds the second line point. For a selected volume, I would them like to see real time the result of the section of that line (in fact, the plane by that line extruded like the section command does) and the selected volume.

Or when a line and volume are available, to show the section again of that line (in fact intersection of the plane by extrusion of that line) and volume interactively when moving that line around in the vieuwport…

Is anything like that possible?

Kind regards,

Filip Rooms

You can create your own GetPoint class, which allows you to respond dynamically to mousemoves. There are events for when the mouse moves, and there are events for every viewport afterwards so you can draw feedback geometry.

What you probably cannot do is eavesdrop on other commands using events, and I’m not entirely sure whether that’s what you’re asking for.

If you want to make a command that draws stuff during mousemoves, you can create a new Rhino.Input.Custom.GetPoint class, then set it up the way you like and handle the MouseMove and DynamicDraw events.

Do note that you should probably not do anything slow in these events, because that will make the mouse unresponsive, which is an unpleasant experience for the user.