When I set up my files recently to CNC rout the plywood profiles for my latest project I made the newbie error of drawing the outside diameter of the holes I needed drilled rather than the center points (it makes sense after the fact but was counter-intuitive for someone more used to RP than CNC). Anyway, after manually drawing all the center points I asked the good folks at McNeel if there was a simpler way to bulk insert these points. Pascal Golay just sent me this Rhinoscript:
'*****************************
'*****************************
Option Explicit
Call Main()
Sub Main()
Dim aCircles
aCircles = Rhino.GetObjects("Select circles",4,True,True)
If Not isArray(aCircles) Then Exit Sub
Dim sCircle,aPt
Rhino.EnableRedraw(False)
For Each sCircle In aCircles
If Rhino.IsCircle(sCircle) Then
aPt = Rhino.CircleCenterPoint(sCircle)Rhino.AddPoint aPt
End If
Next
Rhino.EnableRedraw(True)
End Sub
'*****************************
'*****************************
It works a charm. Since I've recently been working with Processing and Arduino - I actually sort of understand it, too. I was inspired to put in the effort to get over the inevitable learning curve with Rhinoscripting when I saw THEVERYMANY - this just makes it all the more so. For all those (like me) that are intimidated by code, I think this is a significant move:
Grasshopper™ - a graphical algorithm editor tightly integrated with Rhino’s 3-D modeling tools. Unlike RhinoScript, Grasshopper requires no knowledge of programming or scripting, but still allows designers to build form generators — from the simple to the awe-inspiring.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment