https://github.com/philipbelesky/moult
A script that extracts the contents of Python, VB, and C# components within Grasshopper3D and writes them to files.
https://github.com/philipbelesky/moult
grasshopper grasshopper-3d
Last synced: 9 months ago
JSON representation
A script that extracts the contents of Python, VB, and C# components within Grasshopper3D and writes them to files.
- Host: GitHub
- URL: https://github.com/philipbelesky/moult
- Owner: philipbelesky
- Created: 2014-02-17T07:33:54.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2014-02-28T05:11:13.000Z (over 12 years ago)
- Last Synced: 2025-01-12T22:43:49.170Z (over 1 year ago)
- Topics: grasshopper, grasshopper-3d
- Language: Python
- Size: 215 KB
- Stars: 5
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Moult
A script that extracts the contents of Python, VB, and C# components within [Grasshopper](http://www.grasshopper3d.com/) and writes them out to files.
I find it useful because it means (when combined with version control) that I can use a diff tool to compare between different revisions to a script inside a component. YMMV.
## Installation
You'll need Python installed in order to use this. You'll then need to open up a shell, navigate to where your Grasshopper files are, and then execute the script. As an example:
$ cd "c:\Grasshopper Project\"
$ python "c:\Script Location\moult.py"
## Usage
If you execute the file it will traverse down all the folders within the directory it is placed. Each time it encounters a **GHX** file it will extract its the scripts and write them to a file in the same directory tree.
*Note that you must Save As your Grasshopper files as "Grasshopper Xml (.ghx)" for this to work*
*Note that each time this script is run it deletes and then regenerates the old versions of its files. This means that if you delete a component containing a script in the definition, and then re-run this script its file will be removed. Comment out lines 88-91 if you want to stop this behaviour*