I’m entirely new to developing SketchUp extensions. I started developing one just today because I found out I need to do something that would take several hours to do manually - so I decided to learn how to use the Ruby API.
However right at the begining I’ve got into trouble: I want to create a tool that would convert the ordinary Cartesian (XYZ) axes into cylindrical or spherical axes. As you need to define the center first, it would be appropriate to use the internal Protractor tool / helper / input thingy.
You can only active the protractor tool using Sketchup.send_action()
But that will have precipitated you out of your own tool !
Fredo actually replicates the actions of the protractor tool in his own Tool, by using the view.draw commands to replicate the ‘gizmo’ form location, colors, tooltips, status-bar prompts etc.
This combined with guides etc, can then replicate the protractor tool’s functions within your own tool…
You need to learn Ruby first. The SketchUp API only extends Ruby to work with models and SketchUp.
See the Ruby Learning Resources pinned wiki thread in this category.
Because the tool interface is advanced event driven programming.
Start with simple plugins, and progress from there.
Forget using internal “native” tools. Since the observer overhaul (v2016), tool state changes are all queued up and dumped enmass at the end of tool operation. It makes it near impossible to interact synchronously with native tools now.
As TIG said, Devs need to write their own tool functionality that mimics native tool flows.
The best way to learn is to read examples. The SketchUp team has a Line tool and Cylinder tool example in their “Examples” extension. Their “Utilities Tools” extension also has good examples.
It is a little late. It is best to say these things in the original post, so we don’t waste our time.
I only went by what you said which implied you were new to development, viz:
Yea, I spent hours “not helping” creating this just for those who are new
to Ruby and SketchUp extension development: