Ruby Console unable to reference the active SU model

I have just started learning and using the Ruby Console in SU 17 via http://developer.sketchup.com/en/content/new-ruby. I am following the tutorial exactly and also copy and paste the example however I consistently get an error when trying to reference the active model.

The code snippet and error is:

point1 = [0,0,0]
[0, 0, 0]
point2 = [100,100,100]
[100, 100, 100]
model = Sketchup.active_model
#<Sketchup::Model:0x0000603daf4ba8>

I have rebooted my PC, reinstalled SU, both typed and copy/paste code into the Ruby console and still get the same error. I have also opened different models in SU as well.

Obviously I am missing something but unsure what it is.

If someone could point me in the right direction that would be fantastic.

If you are typing this in line by line, this isn’t an error. It’s just Ruby telling you that the active model has the ID 0x0000603daf4ba8

It is easier to follow if you put the code in a file, then load the file into the console.

load "/yourpath/yourfile.rb"

You will see the result in the model open in SketchUp.

Ahh, makes perfect sense, I obviously can’t see the trees for the forest.

I will also take your recommendation of loading the file into the console as well.

Thanks for the quick reply. Much appreciated.

There’s a lot to get your head round when you start coding.

I found it took me a good while to get the most basic things to work, then it started to make sense.

Good luck.

I have a little bit of “novice” coding experience but am struggling to fully grasp the Ruby syntax.

I am sure that I will get the hang of it all in good time.