How to realize the Drag effect

I know how to relealize the effect like linetool ,which shows a dynamic line,

and I wanna know how to dynamically display complex 3D graphics with color ,instead of a dynamic line, like the effect of dragging skp file into Sketchup, the 3D graphics move as the mouse move.


You can check out the View#draw method.

ok,I take a try

You can call Sketchup::Model.place_component if you are actually placing a component instance. (If you do this from within a custom tool, the native Move Tool will be activated for the placing, and your tool will no longer be active.)

Here is a code example that “mimics” the Move Tool using Sketchup::Model.place_component :


I also posted another example of a Drag Tool that uses a transformation to move an instance instead. (This can be used within a custom tool.)

The whole of this topic thread has interesting information (for context.)