(by RIL)

Resource File

Support Email

GhToGhx is a Win commandline tool for converting Grasshopper files (.gh) to Xml (.ghx) and compressing to GZip format, making gh definitions searchable. The tool can convert and compress files in entire folder structures in one go, starting from a folder the first commandline parameter. 

The tool doesn't modify any original files, it only makes converted and compressed copies of the original files and places them in subfolders which easily can be removed later if the converted files are for temporary use only (for example for text searches through the entire Grasshopper library). All operations, including removal of log files, temp files and temp folders, can be automated via batch scripts and commandline parameters.

The tool can be used either interactively or by calling it from batch scripts (see example below and links to a wiki with more detailed info). GhToGhx is available as a compiled exe-file (GhToGhx.exe) and source files can be found on on Bitbucket (GhToGhx is written in C#). License MIT.

Grasshopper's ghx file format is essentially a xml file format which is searchable (although Xml isn't fully optimal for the code inside script components), and plain xml is also suitable for storing text files in version control systems (VCS) and DIFF tools can spot differences between versions.

Some search tools can also search zipped files directly (for example [PowerGrep]( and for this reason the tool also supports compressing the ghx/xml files into GZip format. Also the copmpression tool operates recursively on entire folder structures.

See separate pages on the BitBucket Wiki which has listings of all available commands.

If you are installing the compiled exe-file (see download link below) you can quickly get started by following these simple steps:

1. drop the exe file anywhere on your harddisk,
2. if need be, remove any fake file extensions
3. place your own copy of the file GH_IO.dll in the same folder as the exe file.
GH_IO.dll typically reside in the following folder under Rhino6, example: C:\Program Files\Rhino 6\Plug-ins\Grasshopper
4. the program should now work if called from a command console. Example:

     .\GhToGhx.exe "D:\Your Folder1\Folder2\"          Starts the Console Window and lets you pick a
                                                                                  command. Operates recursively from this from
                                                                                  this folder and below
     .\GhToGhx.exe "D:\Your Folder1\Folder2\" XL     Converts to ghx (X) recursively and log (L)
                                                                                  filenames to disk and terminate immediately.

GhToGhx.exe runs on Windows only. A copy of the file GH_IO.dll (ships with Rhino6) must be placed in the same folder as the GhToGhx.exe file. The compiled version GhToGhx_1.0.1.exe was compiled with .NET Framework 4.5.

A compiled version of the GhToGhx.exe can be found on the Bitbucket Downloads page. The project files be found at Bitbucket GhToGhx.

See also related posts on McNeel forums on this subject:

* McNeel | Gallery
* McNeel | Forum Post

Resource Type