# Using scripting in gh

**URL:** <https://discourse.mcneel.com/t/using-scripting-in-gh/94240>\
**Category:** Grasshopper Developer\
**Created:** [January 2, 2020, 1:14pm UTC](https://discourse.mcneel.com/t/using-scripting-in-gh/94240 "2020-01-02T13:14:18Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![bhattprathmesh.89](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/bhattprathmesh.89/32/657063_2.png) [@bhattprathmesh.89](https://discourse.mcneel.com/u/bhattprathmesh.89)\
**Post date:** [January 2, 2020, 1:14pm UTC](https://discourse.mcneel.com/t/using-scripting-in-gh/94240/1 "2020-01-02T13:14:18Z")

</div>

Namaste All,  
I am using a python package called decode in grasshopper and was trying to display the outcome in the rhino window but the following error is displayed :

" Runtime error (MissingMemberException): ‘GrasshopperDocument’ object has no attribute ‘CreateDefaultAttributes’ "

This is the code that I am trying to run :

```
import decodes
from decodes.core import *
outie = decodes.make_out(decodes.Outies.Rhino)
outie.put(Point(1,2))
outie.draw()

```

Here, I am able to run first and second line successfully.  
“outie” is a translation object which we use to display and transport geometry to traditional CAD. but am unable to run it. Kindly help. Thanks 🙂

 ![Capture 1](https://global.discourse-cdn.com/mcneel/uploads/default/original/3X/e/c/ec1d125bdcb1971f4e9fe540ad0c968324b258ff.jpeg)

---

<div class="post-metadata">

**Author:** ![nathanletwory](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/nathanletwory/32/482880_2.png) [@nathanletwory](https://discourse.mcneel.com/u/nathanletwory)\
**Post date:** [January 2, 2020, 1:28pm UTC](https://discourse.mcneel.com/t/using-scripting-in-gh/94240/2 "2020-01-02T13:28:57Z")

</div>

I don’t think this is going to work inside Grasshopper, as the `scriptcontext.doc` import is wrong. It should be a `RhinoDoc`, but it appears that through the Python script component it is understood as a `GrasshopperDocument`.

---

<div class="post-metadata">

**Author:** ![bhattprathmesh.89](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/bhattprathmesh.89/32/657063_2.png) [@bhattprathmesh.89](https://discourse.mcneel.com/u/bhattprathmesh.89)\
**Post date:** [January 2, 2020, 1:47pm UTC](https://discourse.mcneel.com/t/using-scripting-in-gh/94240/3 "2020-01-02T13:47:32Z")

</div>

I do not understand, are there things which I need to do before using this?

---

<div class="post-metadata">

**Author:** ![bhattprathmesh.89](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/bhattprathmesh.89/32/657063_2.png) [@bhattprathmesh.89](https://discourse.mcneel.com/u/bhattprathmesh.89)\
**Post date:** [January 2, 2020, 1:59pm UTC](https://discourse.mcneel.com/t/using-scripting-in-gh/94240/4 "2020-01-02T13:59:13Z")

</div>

> [@bhattprathmesh.89](#):
>
> attribute

I am not a computer guy but is this " [decodes/src/decodes/io/gh\_out.py at master · ksteinfe/decodes · GitHub](https://github.com/ksteinfe/decodes/blob/master/src/decodes/io/gh_out.py) " of any use if I am to use that outie function?  
I am stuck with this thing from quite some time now ☹

---

<div class="post-metadata">

**Author:** ![gankeyu](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/gankeyu/32/487811_2.png) [@gankeyu](https://discourse.mcneel.com/u/gankeyu)\
**Post date:** [January 2, 2020, 2:08pm UTC](https://discourse.mcneel.com/t/using-scripting-in-gh/94240/5 "2020-01-02T14:08:17Z")

</div>

I remembered decodes only works with Rhino 5, at least when I was still in UCB… I don’t know if it’s the issue. 😂

---

<div class="post-metadata">

**Author:** ![bhattprathmesh.89](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/bhattprathmesh.89/32/657063_2.png) [@bhattprathmesh.89](https://discourse.mcneel.com/u/bhattprathmesh.89)\
**Post date:** [January 2, 2020, 2:11pm UTC](https://discourse.mcneel.com/t/using-scripting-in-gh/94240/6 "2020-01-02T14:11:43Z")

</div>

I use rhino 5.

---

<div class="post-metadata">

**Author:** ![nathanletwory](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/nathanletwory/32/482880_2.png) [@nathanletwory](https://discourse.mcneel.com/u/nathanletwory)\
**Post date:** [January 2, 2020, 3:13pm UTC](https://discourse.mcneel.com/t/using-scripting-in-gh/94240/7 "2020-01-02T15:13:10Z")

</div>

Best is to ask the author of the library, imo.
