SetContext Method (ActiveX/CSP)

Sets the objects to examine when iterating over errors.

Supported platforms: Windows only

Namespace: AcStMgr

Assembly: AcStMgr.tlb

Signature

VB.NET:

Public Sub SetContext(objIdArray, bUseDb) _
                      Implements IAcStPlugin2.SetContext
    ...
End Sub

C#:

public void SetContext(objIdArray, bUseDb)
{
    ...;
}
object

Type: IAcStPlugin2 interface

The interface this method applies to.

objIdArray

Access: Input-only

Type: Variant (Array of Object IDs)

The array of object IDs for the objects whose properties to check.

bUseDb

Access: Input-only

Type: Boolean

  • False: Real-time checking is enabled and only those objects modified are checked
  • True: All objects in the database should be checked

Return Value (RetVal)

No return value.

Remarks

The SetContext method is called every time an object (or a list of objects) is modified in an edit session, and the object type matches what your plug-in sent to the framework by the GetObjectFilter method. The context can be an object list or null (which indicates that the entire drawing needs to be checked). Once the context is set, the framework calls the Start, Next, and Done methods to iterate through errors within the current context.

Release Information

Releases: AutoCAD 2004 and later

Examples

VB.NET:

Public Sub SetContext(ByVal objIdArray As Object, ByVal bUseDb As Boolean) _
                      Implements IAcStPlugin2.SetContext

    ' If useDb is set to "true" (default), or if objIdArray is blank, 
    ' the context is set to the database (all ObjectIds in the drawing).
    ' Otherwise, the supplied array contains the objects to check.
    m_ContextList.SetContext(bUseDb, objIdArray)
End Sub

C#:

public void SetContext(object objIdArray, bool bUseDb)
{
    // If useDb is set to "true" (default), or if objIdArray is blank, 
    // the context is set to the database (all ObjectIds in the drawing).
    // Otherwise, the supplied array contains the objects to check.
    m_ContextList.SetContext(bUseDb, (Array)objIdArray);
}