NEW: Welcome to the Rhino 6 version of this page! Looking for the older Rhino 5 version?

Count Block Instances

Demonstrates how to count block instances using RhinoScript.

VBScript

Sub CountAllInstancesOfAllBlocks
  arrNames = Rhino.BlockNames(True)
  If IsArray(arrNames) Then
    For Each strName In arrNames
      Rhino.Print strName & " = " & CStr(Rhino.BlockInstanceCount(strName))
    Next
  End If
End Sub