#2
Sure you could write some short lisp routine to do this, but maybe this little trick will helb you more quickly:

Type any command that needs selecting entities, for example COPY
ICAD wil prompt you to select entities, type PRO to select by properties.
Type NAME to select by block name.
Enter the blcokname, in the comand line ICAD will show you how many blocks has been selected.



------------------
Michael Röck

#3
Yes, it is quite easy to get this information from the CAD directly, but I was looking for a VBA coding way of obtaining the number of block references for a particular block definition

#4
Try this:

Public Sub CountBlocks()
Dim dxfCode(1) As Integer, dxfValue(1) As Variant
Dim sBlockName As String
Dim ssBlocks As SelectionSet

sBlockName = InputBox("Block name?")
dxfCode(0) = 0
dxfValue(0) = "INSERT"
dxfCode(1) = 2
dxfValue(1) = sBlockName
Set ssBlocks = IntelliCAD.ActiveDocument.SelectionSets.Add("Blocks")
ssBlocks.Select vicSelectionSetAll, , , dxfCode, dxfValue
MsgBox "The number of " & sBlockName & " blocks is " & ssBlocks.Count & "."
End Sub