Multipipe

This rhinoscript is not needed for Rhino 5. Pipe now works on multiple curves.

This rhinoscript 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 vesion 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.

Rhino Script

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 " &amp; "_SelID " &amp; curves(i) &amp; " c " &amp; CStr(cap) &amp; " " &amp; CDbl(radius) &amp; " _Enter " &amp; CDbl(radius) &amp; " _Enter _Enter", False)
		Else
			Call Rhino.Command("-_Pipe " &amp; "_SelID " &amp; curves(i) &amp; CDbl(radius) &amp; " _Enter " &amp; CDbl(radius) &amp; " _Enter _Enter", False)
		End If
	Next
	Call Rhino.EnableRedraw(True)
	
End Function