Skip to content

Instantly share code, notes, and snippets.

Stephen P. Maher StepMaher

Block or report user

Report or block StepMaher

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View get_rhino_camera.py
"""
Gets active Rhino camera.
Inputs:
A: Set to 'True' to activate current camera.
Outputs:
S: Starting location.
T: Target location.
L: Lens length.
U: Up.
"""
View directory_contents.py
"""
Lists content of the history folder.
Outputs:
full_file: Full file paths for each file.
file_names: File name and extensions for each file.
"""
# Import libraries
import os
@StepMaher
StepMaher / set_rhino_camera.py
Last active Feb 18, 2016
Set Rhino camera using GHPython.
View set_rhino_camera.py
"""
Sets Rhino camera from starting location, target location and lens length.
Args:
S: Starting location.
T: Target location.
L: Lens length.
"""
ghenv.Component.Name = "Set Camera"
ghenv.Component.NickName = 'SetCam'
View relative_path.py
"""
Finds a file in the same directory as the Grasshopper file.
Inputs: Name: File name and extiestion to grab.
Outputs: Path: Full file path.
"""
# Name component
ghenv.Component.Name = "Relative File Path"
ghenv.Component.NickName = "RelFilePath"
@StepMaher
StepMaher / reboot_GH.py
Last active Nov 4, 2015
Reboots Grasshopper.
View reboot_GH.py
"""
Reboots Grasshopper.
Inputs: Reboot: Set to 'True' to reboot Grasshopper.
"""
ghenv.Component.Name = "Reboot Grasshopper"
ghenv.Component.NickName = 'GH-Rebooter'
# Stephen P. Maher / 2015
# Many thanks to Andrew Heumann for the help.
@StepMaher
StepMaher / get_all_screens.py
Last active Nov 4, 2015
Get X and Y dimensions of all screens. Note: This works once per GH instance.
View get_all_screens.py
"""
Get X and Y dimensions of all screens. Note: This works once per GH instance.
Outputs:
Rights: Width.
Bottoms: Height.
Names: Monitor displays.
"""
# Name component
ghenv.Component.Name = "Get All Screen Dimensions"
@StepMaher
StepMaher / get_slider_domain.py
Created Nov 4, 2015
Retrieve a named slider's domain.
View get_slider_domain.py
"""
Retrieve a named slider's domain.
Inputs:
Sliders: Slider NickNames.
Update: Set to 'True' to update information.
Outputs:
Start: Slider domain start.
End: Slider domain end.
"""
@StepMaher
StepMaher / change_slider_domain.py
Last active Nov 4, 2015
Change the domain of an existing slider with a given NickName.
View change_slider_domain.py
"""
Reset a named slider's domain.
Inputs:
Sliders: List of slider NickNames.
Min: Minimum Value(s).
Max: Maximum value(s).
Update: Set to 'True' to update the slider's domain.
"""
# Name component
@StepMaher
StepMaher / add_slider.py
Last active Jan 21, 2016
Add a slider with a given NickName to the Grasshopper Canvas.
View add_slider.py
"""
Create a named number slider.
Inputs:
Name: Slider NickName.
Add: Set to 'True' to create the slider.
"""
# Name component
ghenv.Component.Name = "Slider Creator"
ghenv.Component.NickName = 'Slider Creator'
View list_to_tree.py
"""
Creates a data tree from a list.
Inputs: list: List to make a tree.
Outputs: tree: Output tree.
"""
# Name component
ghenv.Component.Name = "List to Data Tree"
ghenv.Component.NickName = 'ListTree'
You can’t perform that action at this time.