How do I draw temporary visible objects in my sketchup tool

i want to know how to make something like sketchup protractor tool
when you choose it you can see it beside your cursor by ruby API

it’s not trivial, but you can start here in the API…

Sketchup::Tool :onMouseMove(flags, x, y, view) :draw(view)


You can use the Tool interface and the View#draw method to draw things to the view.

is there any example ?

linetool.rb in the examples folder has some basic draw ability…


where can i find this file

Extension Warehouse


thanks alot

It’s a very advanced extension but TrueBend might be useful to show how drawing to the view can be done. Of my own extensions it appears the open source ones rarely draw to the viewport but otherwise they could have been good examples too.