Rhinoscript, Build all possible pipe lines based on array of points

This code build a straight pipe geometry based on array of points. calculate all the possibilities to construct a net. Select the points or generate the points by code.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Option Explicit
'Script version martes, 26 de Febrero de 2008 16:15:54

Call network()
Sub network() 
	Dim arrpts
	Dim strline, strcmd, radius 
	Dim i, u 
	arrpts = Rhino.GetPointCoordinates("selecciona puntos en el espacio") 
	If IsNull(arrpts) Then Exit Sub
 
	For i = 0 To UBound(arrpts) 
		For u = 0 To UBound(arrpts) 
 
			strline = Rhino.AddLine(arrpts(i), arrpts(u)) 
			'construye el tubo
			radius = 1 
			strCmd = "! _Pipe _SelID " & strline & " " & radius & " _Enter _Enter" 
			Rhino.Command strCmd
 
		Next 
	Next 
End Sub

Leave a Reply