Here it is in C#:
int count = 0;
foreach( ObjectId id in SomeBlockTableRecord )
{
++ count;
}
That's essentially what AutoCAD does to get it,
and there is no simple way to do it.
--
http://www.caddzone.com
AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006
http://www.acadxtabs.com
"Genoud Alain" wrote in message news:4897264@discussion.autodesk.com...
Hi,
How to count Entyties in MODELSPACE with .NET ?
_
Public Sub GetInfos()
Dim db As Database = HostApplicationServices.WorkingDatabase
Dim Trans As Transaction = db.TransactionManager.StartTransaction()
Dim Bt As BlockTable = CType(Trans.GetObject(db.BlockTableId,
OpenMode.ForRead), BlockTable)
Dim Btr As BlockTableRecord = CType(Trans.GetObject(Bt(Btr.ModelSpace),
OpenMode.ForRead), BlockTableRecord)
???
Trans.Dispose()
End Sub