CEntity.cls
上传用户:yayuwl
上传日期:2022-03-18
资源大小:8952k
文件大小:2k
- VERSION 1.0 CLASS
- BEGIN
- MultiUse = -1 'True
- Persistable = 0 'NotPersistable
- DataBindingBehavior = 0 'vbNone
- DataSourceBehavior = 0 'vbNone
- MTSTransactionMode = 0 'NotAnMTSObject
- END
- Attribute VB_Name = "CEntity"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = False
- Attribute VB_Exposed = False
- Private WithEvents m_oEntity As AcadObject
- Attribute m_oEntity.VB_VarHelpID = -1
- Private m_Value As Variant
- Private m_Owner As TlsReactor
- Public Property Let Owner(ByVal vNewValue As TlsReactor)
- Set m_Owner = vNewValue
- End Property
- Public Property Let Entity(ByVal vNewValue As AcadObject)
- Set m_oEntity = vNewValue
- End Property
- Public Property Get Entity() As AcadObject
- Set Entity = m_oEntity
- End Property
- Public Property Get Value() As Variant
- Value = m_Value
- End Property
- Public Property Let Value(ByVal vNewValue As Variant)
- m_Value = vNewValue
- End Property
- Private Sub m_oEntity_Modified(ByVal pObject As AutoCAD.IAcadObject)
- m_Owner.Change 0, m_oEntity, m_Value
- End Sub
- Public Property Get EntityInfo() As Variant
- On Error GoTo ErrHandle
- Dim Count As Integer
- If IsArray(m_Value) Then Count = UBound(m_Value) Else Count = -1
- EntityInfo = m_oEntity.Handle
- For i = 0 To Count
- EntityInfo = EntityInfo & "," & m_Value(i)
- Next i
- ErrHandle:
- End Property
- Public Property Let EntityInfo(ByVal vNewValue As Variant)
- On Error Resume Next
- Dim Values()
- Dim Count As Integer
- If InStr(vNewValue, ",") Then
- vNewValue = Split(vNewValue, ",")
- Else
- vNewValue = Array(vNewValue)
- End If
- Count = UBound(vNewValue) - 1
- Set m_oEntity = m_Owner.ActiveDocument.HandleToObject(vNewValue(0))
-
- If Count > -1 Then
- ReDim Values(Count)
- For i = 0 To Count
- Values(i) = vNewValue(i + 1)
- Next i
- m_Value = Values
- End If
- End Property