Skip to content

Instantly share code, notes, and snippets.

View philipbelesky's full-sized avatar

Philip Belesky philipbelesky

View GitHub Profile
THESIS GRID SETUP
#1
#2
X 0; Y 0; Z 0; A 0; B 12
L 0 83: $ 5
THESIS
#1
IF EQ -1 P 0: $ 7
P.N T; X P 0; Y P 1; Z P 2
$ 2; T + T 1
IF == T PARAM: T 0
T 0
@philipbelesky
philipbelesky / moult.py
Created November 23, 2015 22:26
Traverses a Grasshopper XML definition(.ghx) and extracts VB/C#/Python components to separate individual .vb/.cs/.py files
from xml.etree.ElementTree import ElementTree
import os
def ProcessGHXFile(definition_path, base_filename):
# Loads the file and sets up the XML parser
the_file = open(definition_path)
the_directory = os.path.dirname(definition_path)
the_tree = ElementTree()
the_tree.parse(the_file)
IsolateTheScript(the_tree, the_directory, base_filename)
@philipbelesky
philipbelesky / RhinoOnLoad.rvb
Created August 24, 2015 06:26
Automatically open a Rhino file and Grasshopper file upon load
'Automatically open a Rhino file and Grasshopper file upon start
'Setup via File > Properties > Rhino Options > RhinoScript > Startup Scripts
Call Rhino.Command("_Open C:\Users\YourName\TheRhinoDocument.3dm")
Call Rhino.Command("_Grasshopper")
Dim GH
Set GH = Rhino.GetPlugInObject("Grasshopper")
Call GH.DisableBanner()
Call GH.ShowEditor()
Call Rhino.Print("Loaded:" & GH.IsEditorLoaded())
Call Rhino.Print("Visible:" & GH.IsEditorVisible())
@philipbelesky
philipbelesky / gist:9472982
Created March 10, 2014 19:57
An attempt at easier GhPython Profiling
import rhinoscriptsyntax as rs
if debug:
# debug is a Boolean input I use for each GhPython component - it toggles messages/debug info
from System.Diagnostics import Stopwatch as sw
profiling = ['========']
timing = 0
total = sw.StartNew()
class Timer(object):

Keybase proof

I hereby claim:

  • I am philipbelesky on github.
  • I am philipbelesky (https://keybase.io/philipbelesky) on keybase.
  • I have a public key whose fingerprint is 7427 CF02 819A 0753 19CE 426A B7BF 838F 4B82 A206

To claim this, I am signing this object: