CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

ActiveX 开发指南

相关分类

说明属性 (ActiveX/CSP)

2023-1-2 19:57| 发布者: admin| 查看: 165| 评论: 0|来自: AutoCAD

摘要: 指定对象或插件的说明。

指定对象或插件的说明。

支持的平台:仅窗口

Namespace:AcStMgr

集会:AcStMgr.tlb

签名 - AcStError, AcStFix 对象

VB.NET:

object.Description

C#:

object.Description;
对象

类型:AcStErrorAcStFix对象

此属性适用的对象。

签名 - IAcStPlugin2 接口

VB.NET:

Public ReadOnly Property Description() As String _
                Implements IAcStPlugin2.Description
    Get
        Return "..."
    End Get
End Property

C#:

public string Description {
    get {
         return "...";
    }
}
对象

类型:IAcSt插件2接口

此属性适用的对象。

属性值

只读:不,对象;是的,对于界面AcStErrorAcStFixIAcStPlugin2

类型:字符串

分配给对象或插件的说明。

言论

没有额外的评论。

发布信息

释放:AutoCAD 2004 及更高版本

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

示例 - AcStError、AcStFix 对象

VB.NET:

Public Function GetRecommendedFix(ByVal pError As AcStError) As AcStFix _
                                  Implements IAcStPlugin2.GetRecommendedFix

    Dim pRecommendedFix As New AcStFix()

    ' << Change based on standards implementation >>
    If m_LayerCacheArray.Length = 0 Then
        pError.ResultStatus = AcStResultStatus.acStResNoRecommendedFix
        pRecommendedFix = Nothing
    Else
        ' Get the ObjectId of the error object and the associated layer object
        Dim tmpObjID As Long = pError.BadObjectId()
        Dim tmpLayer As AcadLayer = m_pCheckDatabase.ObjectIdToObject(tmpObjID)

        ' Get the name of the layer
        Dim nameToBeChecked As String = tmpLayer.Name
        tmpLayer = Nothing
        Dim layCache As LayerCache = m_LayerCacheArray(0)

        m_RecommendedFixIndex = -1

        ' Attempt to get the recommended fix from the cached array by matching layer names
        Dim i As Integer
        For i = 0 To UBound(m_LayerCacheArray)
            If m_LayerCacheArray(i).Name = nameToBeChecked Then
                layCache = m_LayerCacheArray(i)
                m_RecommendedFixIndex = i

                ' Exit the For loop after a match is found
                Exit For
            End If
        Next

        ' Validate if a recommended fix was found
        If m_RecommendedFixIndex <> -1 Then
            ' Populate the properties for the recommended fix object
            pRecommendedFix.Description = "Layer fix"
            pRecommendedFix.StandardFileName = m_LayerCacheArray( _
                                               m_RecommendedFixIndex).StandardFileName
            pRecommendedFix.FixObjectName = m_LayerCacheArray( _
                                               m_RecommendedFixIndex).Name

            If pRecommendedFix.PropertyCount = 0 Then
                pRecommendedFix.PropertyValuePut("Color", m_LayerCacheArray( _
                                                 m_RecommendedFixIndex).Color)
                pRecommendedFix.PropertyValuePut("Lineweight", m_LayerCacheArray( _
                                                 m_RecommendedFixIndex).Lineweight)
            End If
        Else
            pRecommendedFix = Nothing
        End If
    End If

    GetRecommendedFix = pRecommendedFix
End Function

C#:

public AcStFix GetRecommendedFix(AcStError pError)
{
    AcStFix pRecommendedFix = new AcStFix();

    // << Change based on standards implementation >>
    if (m_LayerCacheArray.Length == 0)
    {
        pError.ResultStatus = AcStResultStatus.acStResNoRecommendedFix;
        pRecommendedFix = null;
    }
    else
    {
        // Get the ObjectId of the error object and the associated layer object
        long tmpObjID = pError.BadObjectId;
        AcadLayer tmpLayer = (AcadLayer)m_pCheckDatabase.ObjectIdToObject(tmpObjID);

        // Get the name of the layer
        string nameToBeChecked = tmpLayer.Name;
        tmpLayer = null;
        AdskLayersPlugin.StandardsHelpers.LayerCache oLayCache = m_LayerCacheArray[0];

        m_RecommendedFixIndex = -1;

        int nLBound = m_LayerCacheArray.GetLowerBound(0);
        int nUBound = m_LayerCacheArray.GetUpperBound(0);

        // Attempt to get the recommended fix from the cached array by matching layer names
        for (int i = nLBound; i <= nUBound; i++)
        {
            if (m_LayerCacheArray[i].Name == nameToBeChecked)
            {
                oLayCache = m_LayerCacheArray[i];
                m_RecommendedFixIndex = i;

                // Exit the For loop after a match is found
                break;
            }
        }

        // Validate if a recommended fix was found
        if (m_RecommendedFixIndex != -1)
        {
            // Populate the properties for the recommended fix object
            pRecommendedFix.Description = "Layer fix";
            pRecommendedFix.StandardFileName = m_LayerCacheArray[m_RecommendedFixIndex].StandardFileName;
            pRecommendedFix.FixObjectName = m_LayerCacheArray[m_RecommendedFixIndex].Name;

            if (pRecommendedFix.PropertyCount == 0)
            {
                pRecommendedFix.PropertyValuePut("Color", (ACAD_COLOR)m_LayerCacheArray[m_RecommendedFixIndex].Color);
                pRecommendedFix.PropertyValuePut("Lineweight", (ACAD_LWEIGHT)m_LayerCacheArray[m_RecommendedFixIndex].Lineweight);
            }
        }
        else
        {
            pRecommendedFix = null;
        }
    }

    return pRecommendedFix;
}

示例 - IAcStPlugin2 接口

VB.NET:

Public ReadOnly Property Description() As String _
                Implements IAcStPlugin2.Description
    Get
        Return "Basic example of a layers CAD Standards plug-in."
    End Get
End Property

C#:

public string Description
{
    get { return "Basic example of a layers CAD Standards plug-in."; }
}

路过

雷人

握手

鲜花

鸡蛋

最新评论

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

GMT+8, 2024-5-11 15:48

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部