指定对象或插件的说明。 支持的平台:仅窗口 Namespace:AcStMgr 集会:AcStMgr.tlb 签名 - AcStError, AcStFix 对象VB.NET: object.Description C#: object.Description; 签名 - IAcStPlugin2 接口VB.NET: Public ReadOnly Property Description() As String _
Implements IAcStPlugin2.Description
Get
Return "..."
End Get
End Property
C#: public string Description {
get {
return "...";
}
}
属性值只读:不,对象;是的,对于界面AcStErrorAcStFixIAcStPlugin2 类型:字符串 分配给对象或插件的说明。 言论没有额外的评论。 发布信息释放: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."; }
}
|
|Archiver|CAD开发者社区
( 苏ICP备2022047690号-1 苏公网安备32011402011833)
GMT+8, 2025-10-29 06:05
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.