GetAllFixes Method (ActiveX/CSP)

Returns an array of AcStFix objects that might be used to resolve the specified error.

Supported platforms: Windows only

Namespace: AcStMgr

Assembly: AcStMgr.tlb

Signature - AcStError object

VB.NET:

object.GetAllFixes(fixArray, recommendedFixIndex)

C#:

object.GetAllFixes(ref fixArray, ref recommendedFixIndex);
object

Type: AcStError object

The object this method applies to.

fixArray

Access: Input/Output

Type: Variant (Array of AcStFix objects)

The fix objects that might be used to correct the properties of the error object.

recommendedFixIndex

Access: Input/Output

Type: Long

The index of the recommended fix object in the array.

A value of -1 indicates there is no recommended fix.

Signature - IAcStPlugin2 interface

VB.NET:

Public Sub GetAllFixes(pError, fixArray, recommendedFixIndex) _
                         Implements IAcStPlugin2.GetAllFixes
    ...
End Sub

C#:

public void GetAllFixes(pError, ref fixArray, ref recommendedFixIndex)
{
    ...;
}
object

Type: IAcStPlugin2 interface

The object this method applies to.

pError

Access: Input-only

Type: AcStError object

The error object that does not match the established CAD standards.

fixArray

Access: Input/Output

Type: Variant (Array of AcStFix objects)

The fix objects that might be used to correct the properties of the error object.

recommendedFixIndex

Access: Input/Output

Type: Long

The index of the recommended fix object in the array.

A value of -1 indicates there is no recommended fix.

Return Value (RetVal)

No return value.

Remarks

No additional remarks.

Release Information

Releases: AutoCAD 2004 and later

Examples - AcStError object

VB.NET:

Not available

C#:

Not available

Examples - IAcStPlugin2 interface

VB.NET:

Public Sub GetAllFixes(ByVal pError As AcStError, _
                       ByRef fixArray As Object, _
                       ByRef recommendedFixIndex As Integer) _
                       Implements IAcStPlugin2.GetAllFixes

    ' << Change based on standards implementation >>
    If IsNothing(pError) = False Then
        Dim arr(UBound(m_LayerCacheArray)) As IAcStFix

        Dim i As Integer
        recommendedFixIndex = -1
        m_FixCnt = 0

        ' Check the cache of fixes
        If m_LayerCacheArray.Length > 0 Then

            ' Get the properties of the fix
            For i = LBound(m_LayerCacheArray) To UBound(m_LayerCacheArray)
                arr(i) = m_LayerCacheArray(i).StandardsFix
            Next

            fixArray = arr
            m_FixArray = fixArray
            Dim tmpFix As New AcStFix()

            ' Find the recommended fix for the error; the fix object does need to be retained
            If Not GetRecommendedFix(pError) Is Nothing Then
                recommendedFixIndex = m_RecommendedFixIndex
            End If
        End If

        ' Was a recommended fix found
        If recommendedFixIndex = -1 Then
            ' No recommended fix found, set the proper result status flag for the error object
            pError.ResultStatus = AcStResultStatus.acStResNoRecommendedFix
        End If
    End If
End Sub

C#:

public void GetAllFixes(AcStError pError, ref object fixArray, ref int recommendedFixIndex)
{
    // << Change based on standards implementation >>
    if ((pError == null) == false)
    {
        int nLBound = m_LayerCacheArray.GetLowerBound(0);
        int nUBound = m_LayerCacheArray.GetUpperBound(0);

        IAcStFix[] arr = new IAcStFix[nUBound + 1];

        int i = 0;
        recommendedFixIndex = -1;
        m_FixCnt = 0;

        // Check the cache of fixes
        if (m_LayerCacheArray.Length > 0)
        {
            // Get the properties of the fix
            for (i = nLBound; i <= nUBound; i++)
            {
                arr[i] = m_LayerCacheArray[i].StandardsFix;
            }

            fixArray = arr;
            m_FixArray = fixArray;
            AcStFix tmpFix = new AcStFix();

            // Find the recommended fix for the error; the fix object does need to be retained
            if (GetRecommendedFix(pError) != null)
            {
                recommendedFixIndex = m_RecommendedFixIndex;
            }
        }

        // Was a recommended fix found
        if (recommendedFixIndex == -1)
        {
            // No recommended fix found, set the proper result status flag for the error object
            pError.ResultStatus = AcStResultStatus.acStResNoRecommendedFix;
        }
    }
}