How to dynamically draw DisplayConduit

Hi.everyone.
I have a simple table, and I want to preview this table while inserting it and moving the mouse.
I created a DisplayConduit for this table, but during the moving process,
the table doesn’t refresh and requires zooming the view to display. What could be the reason for this?
like this.
PixPin_2024-07-05_11-50-00
this is my code


As you only post screenshots, and not the whole code, it is a bit of guessing. I see you are setting the simpleTable.Origin during the dynamic draw, and in the DrawForeground of the display conduit the lines for rows and columns are drawn and the text. But I don’t see any use of the origin during the drawing.

My guess is that when you set the origin, you do not update the row/column lines or the text to use the new origin.

If this is not helping, please post your code.

You need to redraw on mouse move.
RhinoDoc.ActiveDoc.Views.Redraw();

I don’t think you want to use a display conduit at all in this case. You are running a “GetPoint” operation to get the insertion point.

Create a subclass of Rhino.Input.Custom.GetPoint and override the OnMouseMove, OnDynamicDraw functions to draw your geometry while placing it.

https://developer.rhino3d.com/api/rhinocommon/rhino.input.custom.getpoint/ondynamicdraw

1 Like

thanks.
I have already tried it, but it doesn’t work unless drawing directly within the event method, like this.

Thank you for your reply.
When changing the origin point, I also modified the table’s border and text.

Thank you for your reply.
I think this method is not general enough and has too strong coupling

From what you describe and your initial video the GetPoint approach looks exactly like what you would want. Of course the decision is up to you.

In the absence of other options, this method is an acceptable choice. :grin: