# Grasshopper GUID input

**URL:** <https://discourse.mcneel.com/t/grasshopper-guid-input/211740>\
**Category:** GH for Mac\
**Tags:** mac, macgrasshopper, rhino8\
**Created:** [October 31, 2025, 1:35am UTC](https://discourse.mcneel.com/t/grasshopper-guid-input/211740 "2025-10-31T01:35:02Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![coffsoft](https://avatars.discourse-cdn.com/v4/letter/c/5f9b8f/32.png) [@coffsoft](https://discourse.mcneel.com/u/coffsoft)\
**Post date:** [November 1, 2025, 5:48am UTC](https://discourse.mcneel.com/t/grasshopper-guid-input/211740/6 "2025-11-01T05:48:41Z")

</div>

Hello,

I found the code suggestion below, which hints at a solution to obtaining the GUID within GH.

> [@Get objects from a grasshopper component?](https://discourse.mcneel.com/t/get-objects-from-a-grasshopper-component/80677/2):
>
> Once you have the GH component object, you might access the persistent data of it.
> 
> e.g. if you have a Brep component which has some breps assigned by the user, you can get Rhino object ids like this:
> 
> ```auto
> if component_obj.PersistentDataCount > 0:
> for data in component_obj.PersistentData: 
> if hasattr(data, "ReferenceID"):
> print "ObjectID:", data.ReferenceID
> 
> ```

In order to get this code snippet running, it needs one or more namespaces to be imported. I have searched, but cannot determine which namespace(s) are required. I found the page below which is a comprehensive list, but still cannot find GetSingleComponent. PersistentDataCount and hasattrdata are probably in the same namespace. Any help would be appreciated.

[Namespaces](https://mcneel.github.io/rhinocommon-api-docs/api/RhinoCommon/html/R_Project_RhinoCommon.htm#) !

Regards, Garry.

---

_[View the full topic](https://discourse.mcneel.com/t/grasshopper-guid-input/211740)._
