How do you make plug-ins for sketchup
-
I wouldn't consider myself an expert. I am basically self-taught and with that comes lots of bad programming habits. I learned everything I know about Ruby scripting in the last 18 months from these sources:
- http://download.sketchup.com/OnlineDoc/gsu6_ruby/Docs/index.html (SketchUp Ruby API Developer's Guide)
- http://www.ruby-doc.org/docs/ProgrammingRuby/ (The Pragamatic Programmers Guide)
- Opening up other plugins with a text editor and trying to understand the code.
- Helpful people on SCF
You should probably start by reading the fist few parts of 2) You might not understand everything at first, but when you start looking at 1) and 3), things will start to make more sense.
You can't learn this sutff overnight. Start off with something very simple. There are lots of helpful people on the forums so best of luck!
-
thanx...whatt .maybe its the best advise... so , no time waste for you and helpful for seekers
-
hi, I'm new to Ruby too. Just thought of sharing a book that i bought which turned to be a great self learning guide for someone that knows nothing about Ruby (it also happened to be the only book i could find about Ruby in my part of the world
)
Begining Ruby From Novice to Professional by Peter Cooper
http://www.apress.com/book/view/9781590597668 -
Heh, I've been wondering how to make ruby scripts aswell. Apparently if functions are part of ruby, so I have a start
Pilou, moi aussi je sais comment de parler le français!
C'est pas une langue très dificile à apprendre, mais il y a trop de verbes, et c'est difficile de savoir si quelque chose est masculin ou feminin.
En anglais, nous avons pas de masculin ou feminin pour les objets non-vivants
Aussi, qu'est ce que ton signature veut dire? "Is beautiful that please without concept!" en français veut dire "Est belle que s'il-vous-plait sans concept" Je ne le comprend pas...
-
Are you actually interested BTM? There's been quite a few of us Ruby newbs hanging out here lately, and I think we've mostly shown that the learning goes pretty fast once you get into it.
I'm currently putting together a tutorial for the SCF tutorials on how to start learning Ruby. But you really don't need to wait for anything like that. Start teaching yourself Ruby using Chris Pine's ruby tutorial. Its a great place to get started with Ruby. Then once you get the hang of the basic syntax, its time to dig into the SketchUp specific stuff.
Chris
-
what text editor do you use to write code, Chris?
-
-
@unknownuser said:
what text editor do you use to write code, Chris?
I guess this thread will answer to most of your questions about Ruby.
http://www.sketchucation.com/forums/scf/viewtopic.php?f=180&t=10142&p=65928#p65928 -
I personally use notepad++ currently. And I use Jim's Web Console inside of SU. I use it to test chunks of code and then I copy them into notepad++ once I get things running as expected.
Chris
-
...any mac versions or mac text editors? I thought I could use textedit, but it doesn't have any way to save as ruby files. Neither does pages, but word seems to be able to save as ruby if I type .rb in manually. Still, a mac text editor would help.
-
i think a lot of the mac heads use TextMate
-
Hi
Smultron can do it on mac, it's free.
regards
-
My MacBook has Xcode or something like that (I'm not a "Mac person" - I just got one for self-preservation for dual-platform SU ruby development
). It's color coded and has auto-completion capabilities as you type.
-
-
This is some good info on Mac code editors. I'll include it in whatever little tutorial I get thrown together.
-
I have Xcode too, downloaded smultron anyways, they both seem good, Xcode a little more complicated, but does have menus for picking the exact thing you want to make ( like ruby extentions), but I don't know which one's better.
...Anyone out there have experience with these sorts of things? -
Hey not too bad! Just keep that up and you're well on your way. Once you get the standard flow control methods down (which you have, the if/else/end, until/end, array.each do/end) your set. Then its time to dig into the sketchup API to see what methods/classes/modules that SketchUp has added to Ruby.
Chris
-
Nevermind, Xcode's my pick. I made my first ruby code too (not for sketchup)
keycode = false puts 'INPUT CODE' code = gets.chomp puts 'CODE RECIEVED' while (not keycode) puts 'INPUT CODE TO UNLOCK' if gets.chomp == code keycode = true puts 'ACCESS GRANTED' else puts 'ACCESS DENIED' end end
It's a good thing I've used sketchyphysics before, or I would have no idea what I was doing.
-
@unknownuser said:
.also, how do you add global variables throughout the script? Is it still setVar("foo",1), getVar("foo"), and getSetVar("foo",0)?
These are not part of the Ruby API - they must be part of the SketchyPhysics API (to confuse things even further.)
-
Just looked it up in that pine-something-or-other tutorial. So it's if you put a @ in front of a variable that makes it global?
Advertisement