# Difference Between Python for Rhino and Grashopper

**URL:** <https://discourse.mcneel.com/t/difference-between-python-for-rhino-and-grashopper/20752>\
**Category:** Scripting\
**Created:** [May 24, 2015, 5:02am UTC](https://discourse.mcneel.com/t/difference-between-python-for-rhino-and-grashopper/20752 "2015-05-24T05:02:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shridhar\_Mamidalaa](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/shridhar_mamidalaa/32/145639_2.png) [@Shridhar\_Mamidalaa](https://discourse.mcneel.com/u/Shridhar_Mamidalaa)\
**Post date:** [May 24, 2015, 5:02am UTC](https://discourse.mcneel.com/t/difference-between-python-for-rhino-and-grashopper/20752/1 "2015-05-24T05:02:38Z")

</div>

Iwas trying to implement a simple script

import rhinoscriptsyntax as rs  
import math  
q = 15  
for i in range (0,q):  
for j in range(0,q):  
for k in range (0,q):  
a = rs.AddPoint(i,j,k)

and found variations .same script in Rhino py give me 3d point and when used in grasshopper give me just one point. why is that ???

---

<div class="post-metadata">

**Author:** ![603419608](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/603419608/32/487406_2.png) [@603419608](https://discourse.mcneel.com/u/603419608)\
**Post date:** [May 24, 2015, 5:43am UTC](https://discourse.mcneel.com/t/difference-between-python-for-rhino-and-grashopper/20752/2 "2015-05-24T05:43:45Z")

</div>

hi Shridhar  
Check the attached file[pointlist.gh](https://global.discourse-cdn.com/mcneel/uploads/default/original/7/e/7e63be07aab029627e14c49b70bafac3cec5eb3c.gh) (2.0 KB)

---

<div class="post-metadata">

**Author:** ![djordje](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/djordje/32/747634_2.png) [@djordje](https://discourse.mcneel.com/u/djordje)\
**Post date:** [May 24, 2015, 8:02am UTC](https://discourse.mcneel.com/t/difference-between-python-for-rhino-and-grashopper/20752/3 "2015-05-24T08:02:19Z")

</div>

Hi Shridhar,

It’s because in RhinoPythonEditor each time you call a rs.AddPoint function a new point is added to the Rhino document, and each of those points is therefor visible in viewports. The same happens with your ghcomponent (rs.AddPoint function adds a point to the grasshopper document), but unlike Rhino, these points are not immediately visible. To make them visible you need to reference their guids or geometry to ghpython component output parameter (which is “a” in this case). What your script currently does is referencing only a guid of the last point.

```auto
import rhinoscriptsyntax as rs

a = []
q = 15
for i in range (0,q):
    for j in range(0,q):
        for k in range (0,q):
            a.append(rs.AddPoint(i,j,k))

```

---

<div class="post-metadata">

**Author:** ![Shridhar\_Mamidalaa](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/shridhar_mamidalaa/32/145639_2.png) [@Shridhar\_Mamidalaa](https://discourse.mcneel.com/u/Shridhar_Mamidalaa)\
**Post date:** [May 24, 2015, 2:36pm UTC](https://discourse.mcneel.com/t/difference-between-python-for-rhino-and-grashopper/20752/4 "2015-05-24T14:36:33Z")

</div>

Thank’s Guys.
