GetPropertyDiffs メソッド(ActiveX/CSP)

プロパティの名前および指定されたエラーの修正オブジェクトを取得します。

サポートされているプラットフォーム: Windows のみ

名前空間: AcStMgr

アセンブリ: AcStMgr.tlb

構文と要素: AcStError オブジェクト

VB.NET:

object.GetPropertyDiffs(pFix, pPropNames, pErrorValues, pFixValues, pFixableStatuses)

C#:

object.GetPropertyDiffs(pFix, ref pPropNames, ref pErrorValues, ref pFixValues, ref pFixableStatuses);
object

タイプ: AcStError オブジェクト

このメソッドが適用されるオブジェクト。

pFix

アクセス: 入力のみ

タイプ: AcStFix オブジェクト

エラーと比較する修正オブジェクト。

pPropNames

アクセス: 入力/出力

タイプ: バリアント型(文字列の配列)

比較するプロパティ名の配列。

pErrorValues

アクセス: 入力/出力

タイプ: バリアント型(バリアント型の配列)

エラー オブジェクトに現在割り当てられているプロパティ値の配列。

pFixValues

アクセス: 入力/出力

タイプ: バリアント型(バリアント型の配列)

修正オブジェクトに現在割り当てられているプロパティ値の配列。

pFixableStatuses

アクセス: 入力/出力

タイプ: バリアント型(ブール値の配列)

エラー オブジェクトのプロパティ別の修正可能ステータス コードの配列。

構文と要素: IAcStPlugin2 インタフェース

VB.NET:

Public Sub GetPropertyDiffs(pError, pFix, pPropNames, pErrorValues, pFixValues, pFixableStatuses) _
              Implements IAcStPlugin2.GetPropertyDiffs
    ...
End Sub

C#:

public void GetPropertyDiffs(pError, pFix, ref pPropNames, ref pErrorValues, ref pFixValues, ref pFixableStatuses)
{
    ...;
}
object

タイプ: IAcStPlugin2 インタフェース

このメソッドが適用されるインタフェース。

pError

アクセス: 入力のみ

タイプ: AcStError オブジェクト

比較するエラー オブジェクト。

pFix

アクセス: 入力のみ

タイプ: AcStFix オブジェクト

エラーと比較する修正オブジェクト。

pPropNames

アクセス: 入力/出力

タイプ: バリアント型(文字列の配列)

比較するプロパティ名の配列。

pErrorValues

アクセス: 入力/出力

タイプ: バリアント型(バリアント型の配列)

エラー オブジェクトに現在割り当てられているプロパティ値の配列。

pFixValues

アクセス: 入力/出力

タイプ: バリアント型(バリアント型の配列)

修正オブジェクトに現在割り当てられているプロパティ値の配列。

pFixableStatuses

アクセス: 入力/出力

タイプ: バリアント型(ブール値の配列)

エラー オブジェクトのプロパティ別の修正可能ステータス スコードの配列。

戻り値(RetVal)

戻り値はありません。

注意

追加の注意はありません。

バージョン情報

バージョン: AutoCAD 2004 以降

例: AcStError オブジェクト

VB.NET:

Not available

C#:

Not available

例: IAcStPlugin2 インタフェース

VB.NET:

Public Sub GetPropertyDiffs(ByVal pError As AcStError, _
                            ByVal pFix As AcStFix, _
                            ByRef pPropNames As Object, _
                            ByRef pErrorValues As Object, _
                            ByRef pFixValues As Object, _
                            ByRef pFixableStatuses As Object) _
                            Implements IAcStPlugin2.GetPropertyDiffs

    If IsNothing(pError) = False And IsNothing(pFix) = False Then

        ' Define the arrays that will hold the property values to compare
        Dim sPropNames(0) As String
        Dim sErrorValues(0) As String
        Dim sFixValues(0) As String
        Dim bFixableStatuses(0) As Boolean

        Dim sPropName As String = ""
        Dim vErrorVal As Object = Nothing
        Dim vFixVal As Object = Nothing
        Dim i As Integer, nPropCnt As Integer = 0

        ' Iterate the properties of the error object
        For i = 0 To pError.PropertyCount - 1
            ' Get a property name and value from the error
            pError.PropertyGetAt(i, sPropName, vErrorVal)
            m_sPropName = sPropName

            Try
                ' Retrieve the corresponding property value for the fix object
                pFix.PropertyValueGet(sPropName, vFixVal)

                ' Compare the value of the error and fix objects
                If (vErrorVal.CompareTo(vFixVal) <> 0) Then
                    ' Resize the arrays and add the new values
                    ReDim Preserve sPropNames(nPropCnt + 1)
                    ReDim Preserve sErrorValues(nPropCnt + 1)
                    ReDim Preserve sFixValues(nPropCnt + 1)
                    ReDim Preserve bFixableStatuses(nPropCnt + 1)

                    ' Store the property names and values in arrays
                    sPropNames(nPropCnt) = sPropName
                    sErrorValues(nPropCnt) = vErrorVal.ToString
                    sFixValues(nPropCnt) = vFixVal.ToString
                    bFixableStatuses(nPropCnt) = True

                    ' Increment the property counter
                    nPropCnt = nPropCnt + 1
                End If
            Catch
                ' Catch and handle the error as needed
            End Try
        Next

        ' Return the arrays
        pPropNames = sPropNames
        pErrorValues = sErrorValues
        pFixValues = sFixValues
        pFixableStatuses = bFixableStatuses

        ' Clear the local arrays
        Erase sPropNames
        Erase sErrorValues
        Erase sFixValues
        Erase bFixableStatuses

        ' Increment the number of fixes
        m_FixCnt = m_FixCnt + 1
    End If
End Sub

C#:

public void GetPropertyDiffs(AcStError pError, AcStFix pFix, ref object pPropNames, 
                             ref object pErrorValues, ref object pFixValues, ref object pFixableStatuses)
{
    if ((pError == null) == false & (pFix == null) == false)
    {
        // Define the arrays that will hold the property values to compare
        string[] sPropNames = new string[0];
        string[] sErrorValues = new string[0];
        string[] sFixValues = new string[0];
        bool[] bFixableStatuses = new bool[0];

        string sPropName = "";
        object vErrorVal = null;
        object vFixVal = null;
        int nPropCnt = 0;

        // Iterate the properties of the error object
        for (int i = 0; i <= pError.PropertyCount - 1; i++)
        {
            // Get a property name and value from the error
            pError.PropertyGetAt(i, ref sPropName, ref vErrorVal);
            m_sPropName = sPropName;

            try
            {
                // Retrieve the corresponding property value for the fix object
                pFix.PropertyValueGet(sPropName, ref vFixVal);

                // Compare the value of the error and fix objects
                if ((vErrorVal.Equals(vFixVal) == false))
                {
                    // Resize the arrays and add the new values
                    Array.Resize<string>(ref sPropNames, nPropCnt + 1);
                    Array.Resize<string>(ref sErrorValues, nPropCnt + 1);
                    Array.Resize<string>(ref sFixValues, nPropCnt + 1);
                    Array.Resize<bool>(ref bFixableStatuses, nPropCnt + 1);

                    // Store the property names and values in arrays
                    sPropNames[nPropCnt] = sPropName;
                    sErrorValues[nPropCnt] = vErrorVal.ToString();
                    sFixValues[nPropCnt] = vFixVal.ToString();
                    bFixableStatuses[nPropCnt] = true;

                    // Increment the property counter
                    nPropCnt = nPropCnt + 1;
                }
            }
            catch
            {
                // Catch and handle the error as needed
            }
        }

        // Return the arrays
        pPropNames = sPropNames;
        pErrorValues = sErrorValues;
        pFixValues = sFixValues;
        pFixableStatuses = bFixableStatuses;

        // Clear the local arrays
        sPropNames = null;
        sErrorValues = null;
        sFixValues = null;
        bFixableStatuses = null;

        // Increment the number of fixes
        m_FixCnt = m_FixCnt + 1;
    }
}