Quantcast
Channel: Scripting - McNeel Forum
Viewing all articles
Browse latest Browse all 5820

Subtracting multiple Polysurfaces from multiple Polysurfaces in RhinoScript

$
0
0

@Vahab wrote:

Hello,
Can anyone please help with the following code?
Just imagine there are two squares and inside each one there are two rectangles. the code is supposed to take all inner rectangles, extrude and convert them to solid objects and subtract them from their outer extruded curves.
The current result is to apply BooleanDifference on the last selected inner curve and its bounding box only.
Thanks;

`Call Main()
 Sub Main()

Dim arrInput0, arrInput1,strObject0,strObject1,strPath,surface1,surface2

arrInput0 = Rhino.GetObjects("Select inner Curves")
strPath = Rhino.GetObject("pick path")


If IsArray(arrInput0) Then

	For Each strObject0 In arrInput0

		surface1 = rhino.ExtrudeCurve(strObject0, strPath)
		rhino.CapPlanarHoles(surface1)
	Next

	arrInput1 = Rhino.GetObjects("Select bounding Curves")

	If IsArray(arrInput1) Then

		For Each strObject1 In arrInput1

			surface2 = rhino.ExtrudeCurve(strObject1, strPath)
			rhino.CapPlanarHoles(surface2)
			Rhino.BooleanDifference surface2, surface1
		Next

	End If

End If

End Sub`

Posts: 12

Participants: 4

Read full topic


Viewing all articles
Browse latest Browse all 5820

Trending Articles