Count Property (ActiveX/CSP)

Gets the number of items in the object.

Supported platforms: Windows only

Namespace: AcStMgr

Assembly: AcStMgr.tlb

Signature

VB.NET:

object.Count

C#:

object.Count;
object

Type: AcStModelSpaceProxy, AcStPaperSpaceProxy object

The objects this property applies to.

Property Value

Read-only: Yes

Type: Long

The number of items in the object.

Remarks

No additional remarks.

Release Information

Releases: AutoCAD 2004 and later

Examples

VB.NET:

Public Sub SetupForAudit(ByVal pDb As AcadDatabase, _
                         ByVal szPathName As String, _
                         ByVal stdNameArray As Object, _
                         ByVal stdPathArray As Object, _
                         ByVal stdDbArray As Object) _
                               Implements IAcStPlugin2.SetupForAudit

    ' Number of graphical objects contained in model space and paper space of
    ' the database being checked
    If Not IsNothing(pDb) Then
        Dim msProxy As IAcStBlockProxy = m_pManager.ModelSpaceProxy(pDb)
        Dim psProxy As IAcStBlockProxy = m_pManager.PaperSpaceProxy(pDb)

        Debug.Print("Object counts " & vbLf & "Model: " & msProxy.Count.ToString() &
                    vbLf & "Paper: " & psProxy.Count.ToString())
    End If
End Sub

C#:

public void SetupForAudit(AcadDatabase pDb, string szPathName, object stdNameArray, 
                          object stdPathArray, object stdDbArray)
{
    // Number of graphical objects contained in model space and paper space of
    // the database being checked
    if (pDb != null)
    {
        IAcStBlockProxy msProxy = m_pManager.get_ModelSpaceProxy(pDb);
        IAcStBlockProxy psProxy = m_pManager.get_PaperSpaceProxy(pDb);

        Debug.Print("Object counts \nModel: " + msProxy.Count.ToString() +
                    "\nPaper: " + psProxy.Count.ToString());
    }
}