Hi
Pass this parameters of "INSERT" and "*" like this.
NumberofBlockInsertsinDrawing = SelectObjectsOnLayer (ssObjects, "INSERT",
"*")
'''''''''''''''''''''''''''' '''''''''''''''''''
Public Function SelectObjectsOnLayer(ssObs As AcadSelectionSet, spObjectType
As String, spLayer As String) As Long
On Error Resume Next
Dim FilterType(0 To 1) As Integer
Dim FilterData(0 To 1) As Variant
Dim sNumber As String
FilterType(0) = 0: FilterData(0) = spObjectType
FilterType(1) = 8: FilterData(1) = spLayer
' The line below will create an error if the SSET doesn't exist
' or delete it if it does exist.
' The ON Error will allow the program to continue and create the set
ThisDrawing.SelectionSets.Item("SSET").Delete
Set ssObs = ThisDrawing.SelectionSets.Add("SSET")
ssObs.Select acSelectionSetAll, , , FilterType, FilterData
SelectObjectsOnLayer = ssObs.Count
Exit Function
SOLErrorHandler:
Err.Clear
SelectObjectsOnLayer = 0
End Function ' SelectObjectsOnLayer()
--
Laurie Comerford
CADApps
www.cadapps.com.au
wrote in message news:[email protected]...
I understand your sarcasm Robert, it is VERY useless, the cout varible. I
have yet to find a reasonable way to get the block inserts in a drawing
without somehow writting a sub that iterates the intire block array
comparing string id's. major pain!