CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

ActiveX 开发指南

相关分类

GetAllFixes Method (ActiveX/CSP)

2023-1-2 21:08| 发布者: admin| 查看: 148| 评论: 0|来自: AutoCAD

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

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

支持的平台:仅窗口

Namespace:AcStMgr

集会:AcStMgr.tlb

签名 - AcStError 对象

VB.NET:

object.GetAllFixes(fixArray, recommendedFixIndex)

C#:

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

类型:AcStError对象

此方法适用的对象。

fixArray

访问:输入/输出

类型:变体(AcStFix对象数组)

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

推荐修复索引

访问:输入/输出

类型:

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

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

签名 - IAcStPlugin2 接口

VB.NET:

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

C#:

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

类型:IAcSt插件2接口

此方法适用的对象。

p错误

访问:仅输入

类型:AcStError对象

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

fixArray

访问:输入/输出

类型:变体(AcStFix对象数组)

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

推荐修复索引

访问:输入/输出

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

  • AcStMgr.tlb - 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;
        }
    }
}

路过

雷人

握手

鲜花

鸡蛋

最新评论

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

GMT+8, 2024-5-19 15:02

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部