# Get the value of Grasshopper component from RhinoPython

**URL:** <https://discourse.mcneel.com/t/get-the-value-of-grasshopper-component-from-rhinopython/167622>\
**Category:** Grasshopper\
**Tags:** windows, rhinopython, python\
**Created:** [October 21, 2023, 8:09am UTC](https://discourse.mcneel.com/t/get-the-value-of-grasshopper-component-from-rhinopython/167622 "2023-10-21T08:09:43Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![春日\_拓実](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/%E6%98%A5%E6%97%A5_%E6%8B%93%E5%AE%9F/32/508305_2.png) [@春日\_拓実](https://discourse.mcneel.com/u/%E6%98%A5%E6%97%A5_%E6%8B%93%E5%AE%9F)\
**Post date:** [October 21, 2023, 8:09am UTC](https://discourse.mcneel.com/t/get-the-value-of-grasshopper-component-from-rhinopython/167622/1 "2023-10-21T08:09:43Z")

</div>

Hi,

I am trying to program to set values in RhinoPython and get the resulting values calculated in Grasshopper.However, I don’t know which method to use to get the values of Grasshopper components.What should I do?

[test.py](https://discourse.mcneel.com/uploads/short-url/jPRyhzXSIOnZyhMBGuaPrnXPpsj.py) (474 Bytes)  
[test.gh](https://discourse.mcneel.com/uploads/short-url/y5aZzTnr2tG7cBmV2Q3IEubN1SR.gh) (9.4 KB)

---

<div class="post-metadata">

**Author:** ![春日\_拓実](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/%E6%98%A5%E6%97%A5_%E6%8B%93%E5%AE%9F/32/508305_2.png) [@春日\_拓実](https://discourse.mcneel.com/u/%E6%98%A5%E6%97%A5_%E6%8B%93%E5%AE%9F)\
**Post date:** [October 23, 2023, 3:48am UTC](https://discourse.mcneel.com/t/get-the-value-of-grasshopper-component-from-rhinopython/167622/2 "2023-10-23T03:48:22Z")

</div>

Self resolved.  
I worked around the problem by using the GhPython component to output the number component values to a txt file and reading it in.

---

<div class="post-metadata">

**Author:** ![heiko1](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/heiko1/32/636896_2.png) [@heiko1](https://discourse.mcneel.com/u/heiko1)\
**Post date:** [November 9, 2024, 1:24pm UTC](https://discourse.mcneel.com/t/get-the-value-of-grasshopper-component-from-rhinopython/167622/3 "2024-11-09T13:24:29Z")

</div>

hello 春日\_拓実,  
same problem here. i want to send data to grasshopper and to get back the computed solution with a single pythonscript. may you explain, how your solution is working?

best, heiko

---

<div class="post-metadata">

**Author:** ![scottd](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/scottd/32/494002_2.png) [@scottd](https://discourse.mcneel.com/u/scottd)\
**Post date:** [November 9, 2024, 4:28pm UTC](https://discourse.mcneel.com/t/get-the-value-of-grasshopper-component-from-rhinopython/167622/4 "2024-11-09T16:28:38Z")

</div>

Will this method work? Calling grasshopper components from within Rhino.Python:

> **[Node in Code from Python.](https://developer.rhino3d.com/guides/rhinopython/ghpython-call-components/)**
>
> It is possible to call a Grasshopper component from inside a Python script.

---

<div class="post-metadata">

**Author:** ![heiko1](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/heiko1/32/636896_2.png) [@heiko1](https://discourse.mcneel.com/u/heiko1)\
**Post date:** [November 9, 2024, 4:50pm UTC](https://discourse.mcneel.com/t/get-the-value-of-grasshopper-component-from-rhinopython/167622/5 "2024-11-09T16:50:32Z")

</div>

Thanks for your reply. i’ll take a try. is this also usable with addon components (dendro in my case)

---

<div class="post-metadata">

**Author:** ![scottd](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/scottd/32/494002_2.png) [@scottd](https://discourse.mcneel.com/u/scottd)\
**Post date:** [November 11, 2024, 2:45pm UTC](https://discourse.mcneel.com/t/get-the-value-of-grasshopper-component-from-rhinopython/167622/6 "2024-11-11T14:45:15Z")

</div>

Yes, it should work for GH plugins also.

---

<div class="post-metadata">

**Author:** ![heiko1](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/heiko1/32/636896_2.png) [@heiko1](https://discourse.mcneel.com/u/heiko1)\
**Post date:** [November 12, 2024, 8:56pm UTC](https://discourse.mcneel.com/t/get-the-value-of-grasshopper-component-from-rhinopython/167622/7 "2024-11-12T20:56:17Z")

</div>

sounds promising, i will follow up on it!
