Wiki

Clone wiki

GhToGhx / Home

Home | Console | Batch Script | Commands | Next>>

GhToGhx - A Grasshopper Conversion & Compression Tool

Table of Contents

  1. Commands
  2. Install
  3. Downloads
  4. Source Code
  5. Links

GhToGhz is a CommandLine tool for converting Rhino Grasshopper files (.gh) to XML (.ghx) and, optionally, compressing the XML to GZip format. By converting to Xml/.ghx the Grasshopper definitions can be made "searchable" to external search tools. GhToGhz can convert and compress entire folder structures in one go, starting from a folder provided as the first commandline argument. GhToGhz compresses the xml (.ghx) format into gzip. GhToGhz never modifies original files, it only produces copies of files and it also creates and removes temp folders for these files.

The tool can be used interactively (pictured) or called from a batch script like so:

.\GhToGhx.exe "D:\Grasshopper Folder\More Folders\"

Fig 1. In the Console Window the command options options are always displayed:

ConsoleMenu_02.png

Grasshopper's ghx file format is essentially a xml file format which is searchable (although Xml isn't fully optimal for code inside Script Components) and plain xml is also suitable for being stored in version control systems (VCS). Moreover, diff tools can spot differences between saved versions.

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

COMMANDS

See separate pages with a listing of all available commands

INSTALL

If you are installing a 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. then - 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: C:\Program Files\Rhino 6\Plug-ins\Grasshopper
  4. now the program should work.

DOWNLOADS

A compiled version of the GhToGhx.exe can be found on the Downloads page

SOURCE CODE

The source files are available here at Bitbucket GhToGhx.

See also related forum posts on McNeel forums on this subject:

Updated