Py Code Reader
(by spatiomatics)
Simple component that reads a .PY file and parses it to string format so it can be fed into the Code input of a ghPython component.
Support Email

PyCodeReader

PyCodeReader will parse a .py file into a string format so that it can feed a code input from a ghPython component. This allows you to host a .py file anywhere on a local or network computer and read its contents. This also allows you to write your .py file in any IDE or text editor that you prefer. If you have questions, please see the Forum link on this page.

Installation

  • Copy PyCodeReader into your Grasshopper special folder: C:\Users\<username>\AppData\Roaming\Grasshopper\Libraries
  • It will show up below the Grasshopper tab:  Extra > Python Utilities
  • For Windows users, please Unblock the file by right-clicking on the file, selecting properties and "unblock".
  • Only tested on Rhino 6 and 7 for Windows.

Using PyCodeReader

  • If you set a builtin Grasshopper File Path component to "Syncronise", PyCodeReader will update when the .py file is saved. See the example and screenshot below.
  • On a new ghPython component, righ-click on the logo and select: Show code input parameter. Then connect the two code components. Please see the example and screenshot below.
License:
Reviews