# Ruby Console unable to reference the active SU model

**URL:** <https://forums.sketchup.com/t/ruby-console-unable-to-reference-the-active-su-model/38602>\
**Category:** Developers\
**Created:** [February 5, 2017, 9:15pm UTC](https://forums.sketchup.com/t/ruby-console-unable-to-reference-the-active-su-model/38602 "2017-02-05T21:15:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gaz](https://avatars.discourse-cdn.com/v4/letter/g/c2a13f/32.png) [@Gaz](https://forums.sketchup.com/u/Gaz)\
**Post date:** [February 5, 2017, 9:15pm UTC](https://forums.sketchup.com/t/ruby-console-unable-to-reference-the-active-su-model/38602/1 "2017-02-05T21:15:57Z")

</div>

I have just started learning and using the Ruby Console in SU 17 via [http://developer.sketchup.com/en/content/new-ruby](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:

```auto
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.

---

<div class="post-metadata">

**Author:** ![john\_mcclenahan](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/john_mcclenahan/32/135377_2.png) [@john\_mcclenahan](https://forums.sketchup.com/u/john_mcclenahan)\
**Post date:** [February 5, 2017, 9:30pm UTC](https://forums.sketchup.com/t/ruby-console-unable-to-reference-the-active-su-model/38602/2 "2017-02-05T21:30:04Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Gaz](https://avatars.discourse-cdn.com/v4/letter/g/c2a13f/32.png) [@Gaz](https://forums.sketchup.com/u/Gaz)\
**Post date:** [February 5, 2017, 9:36pm UTC](https://forums.sketchup.com/t/ruby-console-unable-to-reference-the-active-su-model/38602/3 "2017-02-05T21:36:53Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![john\_mcclenahan](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/john_mcclenahan/32/135377_2.png) [@john\_mcclenahan](https://forums.sketchup.com/u/john_mcclenahan)\
**Post date:** [February 5, 2017, 9:44pm UTC](https://forums.sketchup.com/t/ruby-console-unable-to-reference-the-active-su-model/38602/4 "2017-02-05T21:44:14Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Gaz](https://avatars.discourse-cdn.com/v4/letter/g/c2a13f/32.png) [@Gaz](https://forums.sketchup.com/u/Gaz)\
**Post date:** [February 5, 2017, 10:02pm UTC](https://forums.sketchup.com/t/ruby-console-unable-to-reference-the-active-su-model/38602/5 "2017-02-05T22:02:15Z")

</div>

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.
