rvb Multipipe

rvb animation snippet example

A simple to use multipipe tool - unfortunately it does ot save history records, as it happens with rhino v5 by default.

Option explicit

'Script written by Adolfo Nadal

'Script by archiologics · www.archiologics.com

Call AddPipes()

Sub AddPipes()

' set the current locale to en-us to force usage of the comma seperator "."

Dim intLCID:intLCID = Rhino.LocaleID

SetLocale("en-us")

 

 

Dim typePipe:typePipe = Rhino.GetString("Select Type of Multipipe", ,Array("Caps_Flat_Simple","Caps_Flat_Thik","Caps_Round"))

If IsNull(typePipe) Then Exit Sub

Dim AllCurves : AllCurves = Rhino.GetObjects("Select curves to pipe...", 4, False, True, True)

If IsNull(AllCurves) Then Exit Sub

Dim R1,R2,R3,R4,i,pipe()

ReDim pipe(ubound(AllCurves))

Select Case typePipe

Case "Caps_Flat_Simple"

R1 = Rhino.GetReal("R start ex")

R3 = Rhino.GetReal("R end ex")

For i = 0 To UBound(AllCurves)

Rhino.UnselectAllObjects

Rhino.SelectObject AllCurves(i)

Rhino.Command "_Pipe  _Cap=Flat _Thick=No " & R1 & " " & R3 & " _Enter ", False

pipe(i)=Rhino.FirstObject 

Next

Case "Caps_Flat_Thik"

R1 = Rhino.GetReal("R start ex")

R2 = Rhino.GetReal("R start in")

R3 = Rhino.GetReal("R end ex")

R4 = Rhino.GetReal("R end in")

For i = 0 To UBound(AllCurves)

Rhino.UnselectAllObjects

Rhino.SelectObject AllCurves(i)

Rhino.Command "_Pipe  _Cap=Round _Thick=Yes " & R1 & " " & R3 & " " & R2 & " " & R4 & " _Enter ", False

pipe(i)=Rhino.FirstObject 

Next

Case "Caps_Round"

R1 = Rhino.GetReal("R start ex")

R3 = Rhino.GetReal("R end ex")

For i = 0 To UBound(AllCurves)

Rhino.UnselectAllObjects

Rhino.SelectObject (AllCurves(i))

Rhino.Command "-_Pipe  _Cap=Round _Thick=No " & R1 & " " & R3 & " _Enter ", False

pipe(i)=Rhino.FirstObject 

Next

End Select

Rhino.UnselectAllObjects 

Rhino.SelectObjects (pipe)

End Sub

Search Site




archi·o·logics survey

I am interested in: