CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

AutoCAD 2022 开发者帮助

GetAllFixes 方法 (ActiveX/CSP)

2024-5-18 18:46| 发布者: admin| 查看: 133| 评论: 0|原作者: admin|来自: AutoCAD

GetAllFixes 方法 (ActiveX/CSP)

返回可用于解决指定错误的对象数组。AcStFix

支持的平台:仅限 Windows

命名空间:AcStMgr (英语)

集会:AcStMgr.tlb

Signature - AcStError 对象

VB.NET:

object.GetAllFixes(fixArray, recommendedFixIndex)

C#:

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

类型:AcStError 对象

此方法应用到的对象。

fixArray

访问:输入/输出

类型:Variant(AcStFix 对象数组)

可能用于更正错误对象属性的修复对象。

推荐的 FixIndex

访问:输入/输出

类型:

数组中建议的修复对象的索引。

值为 -1 表示没有建议的修复。

签名 - IAcStPlugin2 接口

VB.NET:

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

C#:

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

类型:IAcStPlugin2 接口

此方法应用到的对象。

p错误

访问:仅输入

类型:AcStError 对象

与已建立的 CAD 标准不匹配的错误对象。

fixArray

访问:输入/输出

类型:Variant(AcStFix 对象数组)

可能用于更正错误对象属性的修复对象。

推荐的 FixIndex

访问:输入/输出

类型:

数组中建议的修复对象的索引。

值为 -1 表示没有建议的修复。

返回值 (RetVal)

无返回值。

言论

没有其他评论。

发行信息

释放:AutoCAD 2004 及更高版本

  • AcStMgr.tlb - AutoCAD 2004 及更高版本

示例 - AcStError 对象

VB.NET:

Not available

C#:

Not available

示例 - IAcStPlugin2 接口

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;
        }
    }
}

路过

雷人

握手

鲜花

鸡蛋

最新评论

QQ|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1   苏公网安备32011402011833)

GMT+8, 2025-3-14 05:50

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部