Gets the next error in the current context.
Supported platforms: Windows only
Namespace: AcStMgr
Assembly: AcStMgr.tlb
For internal use only.
VB.NET:
object.Next()
C#:
object.Next();
Type: AcStErrorIterator object
The object this method applies to.
VB.NET:
Public Sub Next() _
Implements AcStMgr.IAcStPlugin2.Next
...
End Sub
C#:
public void Next()
{
...;
}
Type: IAcStPlugin2 interface
The interface this method applies to.
No return value.
No additional remarks.
Releases: AutoCAD 2004 and later
VB.NET:
Not available
C#:
Not available
VB.NET:
Public Sub PlugIn_Next() _
Implements IAcStPlugin2.Next
m_pError = Nothing
If m_ContextList.Count > 0 Then
' Check to see if there are objects to check
' << Change based on standards implementation >>
If m_LayerCacheArray.Length() > 0 Then
Dim bFoundError As Boolean
' Check to see if this is the last object to be checked
If m_curIndex < m_ContextList.Count - 1 Then
m_curIndex = m_curIndex + 1
bFoundError = False
' << Change based on standards implementation >>
Dim layerObj As AcadLayer
Dim iCache As Integer
' Iterate the objects to be checked
While m_curIndex < m_ContextList.Count
' Get the ObjectId of the object to be checked
layerObj = m_pCheckDatabase.ObjectIdToObject(m_ContextList.Item(m_curIndex))
' Iterate through each of the standards objects and check for a match based on name
For iCache = LBound(m_LayerCacheArray) To UBound(m_LayerCacheArray)
' Compare the names of the two layers
If (layerObj.Name.CompareTo(m_LayerCacheArray(iCache).Name) <> 0) Then
' Check to see if the object is a macth,
' if not flag as possible error
bFoundError = True
Else
bFoundError = False
' Layer names matched, compare color and linetype values
If layerObj.color.ToString() <> m_LayerCacheArray(iCache).Color.ToString() Or _
layerObj.Lineweight.ToString() <> m_LayerCacheArray(iCache).Lineweight.ToString() Then
bFoundError = True
End If
' Exit For loop since a match by name was found
Exit For
End If
Next
' No match or a property difference was found
If bFoundError = True Then
Dim pError As New AcStError()
' Assign a description to the error
pError.Description = "Layer is non-standard"
' Assign an ObjectId to the error
pError.BadObjectId = layerObj.ObjectID
' Assign the name of the object, plug-in, and error type
pError.BadObjectName = layerObj.Name
pError.Plugin = m_pPlugin
pError.ErrorTypeName = "Layer "
' Assign a result status to the error
pError.ResultStatus = AcStResultStatus.acStResFlagsNone
' Assign the object's property values to the error for checking
If pError.PropertyCount = 0 Then
pError.PropertyValuePut("Color", layerObj.color)
pError.PropertyValuePut("Lineweight", layerObj.Lineweight)
End If
m_pError = pError
bFoundError = False
Exit While
End If
' Increment the counter
m_curIndex = m_curIndex + 1
End While
End If
End If
End If
End Sub
C#:
public void PlugIn_Next()
{
m_pError = null;
if (m_ContextList.Count > 0)
{
AcadLayer layerObj = default(AcadLayer);
int iCache = 0;
bool bFoundError = false;
// Check to see if there are objects to check
// << Change based on standards implementation >>
if (m_LayerCacheArray.Length > 0)
{
// Check to see if this is the last object to be checked
if (m_curIndex < m_ContextList.Count - 1)
{
m_curIndex = m_curIndex + 1;
bFoundError = false;
// Iterate the objects to be checked
while (m_curIndex < m_ContextList.Count)
{
// Get the ObjectId of the object to be checked
layerObj = (AXDBLib.AcadLayer)m_pCheckDatabase.ObjectIdToObject((long)m_ContextList.GetItem(m_curIndex));
int nLBound = m_LayerCacheArray.GetLowerBound(0);
int nUBound = m_LayerCacheArray.GetUpperBound(0);
// Iterate through each of the standards objects and check for a match based on name
for (iCache = nLBound; iCache <= nUBound; iCache++)
{
// Compare the names of the two layers
if ((layerObj.Name.CompareTo(m_LayerCacheArray[iCache].Name) != 0))
{
// Check to see if the object is a macth,
// if not flag as possible error
bFoundError = true;
}
else
{
bFoundError = false;
// Layer names matched, compare color and linetype values
if (layerObj.color.ToString() != m_LayerCacheArray[iCache].Color.ToString() |
layerObj.Lineweight.ToString() != m_LayerCacheArray[iCache].Lineweight.ToString())
{
bFoundError = true;
}
// Exit For loop since a match by name was found
break;
}
}
// No match or a property difference was found
if (bFoundError == true)
{
AcStError pError = new AcStError();
// Assign a description to the error
pError.Description = "Layer is non-standard";
// Assign an ObjectId to the error
pError.BadObjectId = layerObj.ObjectID;
// Assign the name of the object, plug-in, and error type
pError.BadObjectName = layerObj.Name;
pError.Plugin = m_pPlugin;
pError.ErrorTypeName = "Layer ";
// Assign a result status to the error
pError.ResultStatus = AcStResultStatus.acStResFlagsNone;
// Assign the object's property values to the error for checking
if (pError.PropertyCount == 0)
{
pError.PropertyValuePut("Color", (ACAD_COLOR)layerObj.color);
pError.PropertyValuePut("Lineweight", (ACAD_LWEIGHT)layerObj.Lineweight);
}
m_pError = pError;
bFoundError = false;
break;
}
// Increment the counter
m_curIndex = m_curIndex + 1;
}
}
}
}
}
void IAcStPlugin2.Next()
{
PlugIn_Next();
}