Quantcast
Viewing all articles
Browse latest Browse all 5778

RhinoScript to Python help

@markleichliter wrote:

Hi folks - long time no see! I have 2500 holes to place at point locations in my file. I found this old Rhinoscript by Damon - any chance I could get it rewritten in Python so I can use it in Mac Rhino?

Option Explicit
’Script written by Damon Sidel
’Script copyrighted by Damon Sidel
’Script version Sunday, April 19, 2009 7:22:34 PM

Call CopyToPoints()
Sub CopyToPoints()

Dim pts : pts = Rhino.GetPointCoordinates("Select points",True)
If IsNull(pts) Then Exit Sub

Dim	copyObj : copyObj = Rhino.GetObject("Select object to copy")
If IsNull(copyObj) Then Exit Sub

Dim copyObjOrigin : copyObjOrigin = Rhino.GetPointCoordinates("Select point at origin of object being copied")
If IsNull(copyObjOrigin) Then Exit Sub

Call Rhino.EnableRedraw(False)

Dim arrPt
If IsArray(pts) Then
	For Each arrPt In pts
		Call Rhino.CopyObject(copyObj,copyObjOrigin(0),arrPt)
	Next
End If

Thanks for any help offered in the form of yummy virtual beer.

Posts: 10

Participants: 4

Read full topic


Viewing all articles
Browse latest Browse all 5778

Trending Articles