How to pass array of objects to methods that take the String id of a single object?

Using VBScript, how do I pass the String id of an array to methods that accept only String ids?

For example:

Option Explicit

Call Main()
Sub Main()
	' Get object to be split
	Dim arrBlock : arrBlock = Rhino.ObjectsByName("Block", True)
    	
	Dim blockToSplit
	Dim s

	For Each s In arrBlock
		MsgBox "Object to split: " + s
		blockToSplit = s
	Next
    	
	' Get objects to split with
	Dim arrPlane : arrPlane = Rhino.ObjectsByName("Plane", True)
    	
	For Each s In arrPlane
		MsgBox "Object to cut with: " + s
	Next
    	
	Call Rhino.SplitBrep(blockToSplit, arrPlane)  ' <--- FAILS
End Sub

SplitBrep requires Strings as input and arrPlane is an array. How can I get the ID of the array arrPlane to pass to SplitBrep?

You can’t. SplitBrep() takes only two breps, the base brep and the cutting brep. If you have multiple “splitters”, you need to use a loop… But: when you split the brep with the first cutter, it becomes two (or more) breps with different ID’s. So you need to do some scripting gymnastics to replace the original base breps with the new split ones on every iteration and continue your loop…

Ok. Thanks.

@Helvetosaur suggested scripting gymnastics. Here’s an instance of that:

The following is grossly inefficient, but the code is relatively readable.

Sub Main()
	Call MySplit("Block", "Plane")
End Sub

Sub MySplit (strObjectToSplit, strCutter)
	Dim arrObjectToSplit
	Dim arrCutter
   	
	Dim objectToSplit
	Dim objectCutter
	
	Dim wasAnythingSplit

	Do
		wasAnythingSplit = False
		arrObjectToSplit = Rhino.ObjectsByName(strObjectToSplit, True)
		arrCutter = Rhino.ObjectsByName(strCutter, True)
	
		For Each objectToSplit In arrObjectToSplit
			For Each objectCutter In arrCutter
				If Not IsNull(Rhino.SplitBrep(objectToSplit, objectCutter, True)) Then
					wasAnythingSplit = True
				End If
			Next
		Next
	Loop Until wasAnythingSplit = False
End Sub