💻 Rhino 5
🔼 Rhino Script
🛠️ Visual Basic
This Rhino Script is not needed for Rhino 5 or later. Pipe now works on multiple curves.
This Rhino Script is a basic multipipe command. It allows the user to select multiple curves, the start radius, the end radius, and the cap type. The script then differentiates closed from open curves and runs the appropriate version of the command. This script is basic because it does not yet allow the ability to add thickness to the pipe which can create a conflict with the standard pipe command if it has been run prior with a specified thickness.
Option Explicit
'Script written by <David Mans>
'Script copyrighted by <Neoarchaic Design>
'Script version Sunday, September 14, 2008 1:39:30 PM
Call Main()
Sub Main()
Dim curves,radius,cap
curves = Rhino.GetObjects("Select Curves", 4,, true)
If isNull(curves) Then Exit Sub
radius = Rhino.GetReal("Radius", 1)
If isNull(radius) Then Exit Sub
cap = Rhino.GetString("Cap Type", "Flat", array("Flat", "None", "Round"))
If isNull(cap) Then Exit Sub
If cap = "Flat" Then
cap = "f"
ElseIf cap = "None" Then
cap = "n"
ElseIf cap = "Round" Then
cap = "r"
End If
Call Multipipe(curves, radius, cap)
End Sub
Function Multipipe(curves, radius, cap)
Multipipe = Null
Dim i
Call Rhino.EnableRedraw(False)
For i = 0 To uBound(curves) Step 1
If Rhino.IsCurveClosed(curves(i)) = False Then
Call Rhino.Command("-_Pipe " & "_SelID " & curves(i) & " c " & CStr(cap) & " " & CDbl(radius) & " _Enter " & CDbl(radius) & " _Enter _Enter", False)
Else
Call Rhino.Command("-_Pipe " & "_SelID " & curves(i) & CDbl(radius) & " _Enter " & CDbl(radius) & " _Enter _Enter", False)
End If
Next
Call Rhino.EnableRedraw(True)
End Function