Week 1 Scripting additions

Option Explicit
‘Script written by mark.bearak
‘Script copyrighted by dtls.Architecture
‘Script version Tuesday, October 21, 2008 1:08:31 PM

Call ClearEverything()
Call Main()

Sub Main()
Dim arrPlane, i, j, strCrv(), strInnerCrv(), dblBase
dblBase = Rhino.getReal (“how wide would you like your base?”,10,7,15)
For j = 0 To 5
For i = 0 To 10
ReDim Preserve strCrv(i)
ReDim Preserve strInnerCrv(i)
arrPlane = Rhino.PlaneFromPoints (Array(0,j*25,i*(j+1)), Array(1,j*25,i*(j+1)), Array(0,j*25+1,i*(j+1)))
If i < j+3 Then
strCrv(i) = Rhino.AddCircle (arrPlane, dblBase)
strInnerCrv(i) = Rhino.AddCircle (arrPlane, dblBase-1)
Else
strCrv(i) = Rhino.AddCircle (arrPlane, dblBase-5)
strInnerCrv(i) = Rhino.AddCircle (arrPlane, dblBase-6)
End If
Next
Call Rhino.AddLoftSrf (strCrv,,,1)
Call Rhino.AddLoftSrf (strInnerCrv,,,1)
Call Rhino.deleteobjects (strCrv)
Next
End Sub

Sub ClearEverything()
Call Rhino.Command (“selall “)
Call Rhino.Command (“delete “)
End Sub

—————————————————————–

Option Explicit
‘Script written by mark.bearak
‘Script copyrighted by dtls.Architecture
‘Script version Tuesday, October 21, 2008 1:08:31 PM

Call ClearEverything()
Call Main()

Sub Main()
Dim arrPlane, i, j, strCrv(), strInnerCrv(), intCircles
‘This integer determines size of vases and cap at top of each vase
intCircles = Rhino.getinteger (“How many circles in each vase?”,10,4,20)
For j = 0 To 5
For i = 0 To intCircles
ReDim Preserve strCrv(i)
ReDim Preserve strInnerCrv(i)
arrPlane = Rhino.PlaneFromPoints (Array(0,j*25,i*(j+1)), Array(1,j*25,i*(j+1)), Array(0,j*25+1,i*(j+1)))
If i < j+3 Then
strCrv(i) = Rhino.AddCircle (arrPlane, 10.0)
strInnerCrv(i) = Rhino.AddCircle (arrPlane, 9.0)
Else
strCrv(i) = Rhino.AddCircle (arrPlane, 5.0)
strInnerCrv(i) = Rhino.AddCircle (arrPlane, 4.0)
End If
If i = 0 Then
Call Rhino.AddPlanarSrf (strCrv)
Call Rhino.AddPlanarSrf (strInnerCrv)
End If
If i = intCircles Then
Call Rhino.AddLoftSrf (Array(strCrv(i),strInnerCrv(i)))
End If
Next
Call Rhino.AddLoftSrf (strCrv,,,1)
Call Rhino.AddLoftSrf (strInnerCrv,,,1)
Call Rhino.deleteobjects (strCrv)
Next
End Sub
Sub ClearEverything()
Call Rhino.Command (“selall “)
Call Rhino.Command (“delete “)
End Sub

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s