Counts the number of instances of the block in the document. Nested instances are not included in the count.
Rhino.BlockInstanceCount (strBlock)
strBlock |
Required. String. The name or identifier of an existing block definition. |
Number |
The number of instances of the block in the document if successful. |
Null |
If not successful, or on error. |
Dim strBlock, intCount
strBlock = Rhino.GetString("Block to count")
If Rhino.IsBlock(strBlock) Then
intCount = Rhino.BlockInstanceCount(strBlock)
Rhino.Print CStr(intCount) & " block(s) found."
End If