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

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

$
0
0

@mike15 wrote:

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?

Posts: 3

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 5760

Trending Articles