# Search Python code components in whole document

**URL:** <https://discourse.mcneel.com/t/search-python-code-components-in-whole-document/183431>\
**Category:** Grasshopper\
**Tags:** windows, python, rhino7\
**Created:** [June 5, 2024, 9:17am UTC](https://discourse.mcneel.com/t/search-python-code-components-in-whole-document/183431 "2024-06-05T09:17:15Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![AndersDeleuran](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/andersdeleuran/32/476683_2.png) [@AndersDeleuran](https://discourse.mcneel.com/u/AndersDeleuran)\
**Post date:** [June 5, 2024, 11:41am UTC](https://discourse.mcneel.com/t/search-python-code-components-in-whole-document/183431/2 "2024-06-05T11:41:36Z")

</div>

Hi YCoCg, welcome to forum. You have tagged Rhino 7, so I assume you are referring to GHPython components. In which case, one can use the `ReplaceGHPythonString` code posted here (last code block):

> [@Python components def RunScript empty outputs](https://discourse.mcneel.com/t/python-components-def-runscript-empty-outputs/156991/5):
>
> I hadn’t seen this before, looks cool but also quite convoluted. Depending on what your requirements are, two components I developed back at CITA might be enough. I don’t think I ever did publish the code outside the Smart Geometry/Advances in Architectural Geometry workshops in 2016, but here it is: """ Iterates the GHPython components in the document and makes user objects of them if the their Category property matches the input Category parameter. Also grabs all the code and writes this to …

---

_[View the full topic](https://discourse.mcneel.com/t/search-python-code-components-in-whole-document/183431)._
