Newbie Developer, wanting to build "slope arrow" plugin, any advice?


#1

I’m interested in trying to experiment with Ruby, and I want to build a tool that will place an “arrow” pointing in the direction of the down slope of the clicked surface, and place a text entity that displays the slope. This is something I’d find really useful with site modeling analysis. I’d just click on any part of my terrain, and it would place the slope arrow with the slope text right above the terrain. Eventually, I’ve got a ton of ideas for features, but I’m starting simple.

I’d like to produce something similar to the image below, when viewing the model from a Top perspective: (This is from AutoDesk Civil3D)

Since I’m new with developing with SketchUp, I was wondering if some of you more experienced folks could recommend various methods/classes I should read up on in the API just to point me in the right direction.

PS ( If you know of a plugin that does this already, I’d be happy with that too :slight_smile: I haven’t been able to find one.


#2

You will save yourself hours of frustration if you learn basic Ruby first.


#3

Thanks for the resource Dan.


#4

My very old [but functioning] Plugin http://sketchucation.com/pluginstore?pln=gradienttools
Does much of what you want.
Feel free to borrow parts of its code [for non-commercial use].
It adds text for slopes as 1:19 etc, but changing it to 2.4° would be a simple edit.
Also ‘flat 3d-text’ could be substituted for the 2d floating type ?
Also the addition of a down-slope ‘direction arrow’ would be relatively straightforward, given the data already collected about the selected face…


#5

Hi TIG, Thanks for the link. This is very helpful, exactly the kind of guidance I was hoping to find.