Rhino.BlockInstances character limit


#1

V6 RhinoScript’s Rhino.BlockInstances returns Null instead of an array when the block definition names have more than 64 characters. V5 doesn’t have this limitation.

RhinoScript_BlockInstances.3dm (67.0 KB)

Option Explicit

Call Main()
Sub Main()
	Dim strUserSelBlockInst
	strUserSelBlockInst = Rhino.GetObject("Select block instance", 4096, True)
	If IsNull(strUserSelBlockInst) Then Exit Sub
	
	Dim strBlockDefName, arrBlockInstances
	strBlockDefName = Rhino.BlockInstanceName(strUserSelBlockInst)
	Rhino.Print strBlockDefName
	arrBlockInstances = Rhino.BlockInstances(strBlockDefName)
	If IsNull(arrBlockInstances) Then Rhino.Print("arrBlockInstances is Null.")
	If IsArray(arrBlockInstances) Then Rhino.Print("arrBlockInstances is an array.")

End Sub

Thank you,
Steve


(Pascal Golay) #2

Hi Steve - thanks for the report, I’ll check this.

https://mcneel.myjetbrains.com/youtrack/issue/RH-36417

-Pascal


(Dale Fugier) #3

Hi Steve,

Thanks for reporting this. A fix will be available in next week’s WIP release.

In addition to this fix, I’ve added some additional “Block” related methods that allow you to deal with block definitions by their ID instead of their name. Check the “What’s New?” section of the RhinoScript help file for details.

– Dale