Learn Rhino-grasshopper-scripting - 9 Code Examples & CST Typing Practice Test
Rhino is a 3D modeling software widely used in architecture, product design, and industrial design. Grasshopper is its visual programming environment that allows parametric and algorithmic design. Scripting in Rhino/Grasshopper enables automation, customization, and complex parametric workflows.
View all 9 Rhino-grasshopper-scripting code examples →
Learn RHINO-GRASSHOPPER-SCRIPTING with Real Code Examples
Updated Nov 27, 2025
Code Sample Descriptions
Create a Point in Rhino
import Rhino
import rhinoscriptsyntax as rs
pt = rs.AddPoint(10, 20, 30)
Creates a point at specified coordinates in Rhino via Grasshopper scripting.
Create Multiple Points in Loop
points = []
for i in range(5):
points.append(rs.AddPoint(i*10, 0, 0))
Generates multiple points along the X-axis.
Draw a Line Between Two Points
pt1 = rs.AddPoint(0,0,0)
pt2 = rs.AddPoint(10,10,0)
line = rs.AddLine(pt1, pt2)
Creates a line connecting two points.
Draw a Circle
center = rs.AddPoint(0,0,0)
circle = rs.AddCircle(center, 5)
Creates a circle with a given center and radius.
Draw a Rectangle
corner1 = rs.AddPoint(0,0,0)
corner2 = rs.AddPoint(10,5,0)
rect = rs.AddRectangle(rs.WorldXYPlane(), 10, 5)
Draws a rectangle using corner points.
Move an Object
obj = rs.AddSphere(rs.AddPoint(0,0,0), 5)
vec = rs.VectorCreate([10,0,0],[0,0,0])
rs.MoveObject(obj, vec)
Translates an object along a vector.
Rotate an Object
obj = rs.AddBox([[0,0,0],[10,0,0],[10,5,0],[0,5,0],[0,0,10],[10,0,10],[10,5,10],[0,5,10]])
center = rs.AddPoint(0,0,0)
rs.RotateObject(obj, center, 45)
Rotates an object around a point by a given angle.
Scale an Object
obj = rs.AddSphere(rs.AddPoint(0,0,0), 5)
base = rs.AddPoint(0,0,0)
rs.ScaleObject(obj, base, [2,2,2])
Scales an object relative to a base point.
Create a Loft Between Curves
curve1 = rs.AddCircle(rs.AddPoint(0,0,0),5)
curve2 = rs.AddCircle(rs.AddPoint(0,0,10),3)
loft = rs.AddLoftSrf([curve1, curve2])[0]
Creates a loft surface between multiple curves.
Frequently Asked Questions about Rhino-grasshopper-scripting
What is Rhino-grasshopper-scripting?
Rhino is a 3D modeling software widely used in architecture, product design, and industrial design. Grasshopper is its visual programming environment that allows parametric and algorithmic design. Scripting in Rhino/Grasshopper enables automation, customization, and complex parametric workflows.
What are the primary use cases for Rhino-grasshopper-scripting?
Parametric architectural modeling. Automated repetitive design tasks. Generative and algorithmic design. Digital fabrication workflows (CNC, 3D printing). Custom plugins or tools for design teams
What are the strengths of Rhino-grasshopper-scripting?
Highly flexible parametric modeling. Visual programming reduces coding barrier. Seamless integration with Rhino geometry engine. Supports complex generative and algorithmic designs. Strong community and plugin ecosystem
What are the limitations of Rhino-grasshopper-scripting?
Steep learning curve for scripting and data trees. Not suitable for large-scale computation without optimization. Grasshopper scripts can become complex and hard to debug. Single-threaded execution in many cases. Dependent on Rhino runtime environment
How can I practice Rhino-grasshopper-scripting typing speed?
CodeSpeedTest offers 9+ real Rhino-grasshopper-scripting code examples for typing practice. You can measure your WPM, track accuracy, and improve your coding speed with guided exercises.