A pool of resources
Multipipe

    


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.


platform: Rhino Script
function: Modeling Aid

 


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, radA, radB, cap
	curves = Rhino.GetObjects("Select Curves",4,,True)
	If isNull(curves) Then Exit Sub

	radA = Rhino.GetReal("Start Radius",1)
	If isNull(radA) Then Exit Sub

	radB = Rhino.GetReal("End Radius",2)
	If isNull(radB) 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,array(radA,radB),cap)

End Sub
Function Multipipe(curves,arrRadius,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(arrRadius(0)) & " _Enter " & CDbl(arrRadius(1)) & " _Enter _Enter",False)
		Else
			Call Rhino.Command( "-_Pipe " & "_SelID " & curves(i) & CDbl(arrRadius(0)) & " _Enter _Enter",False)
		End If
	Next
	Call Rhino.EnableRedraw(True)

End Function


Reply