Тема: HandleToObject - не получается
Public sset As AutoCAD.AcadSelectionSet Private Sub UserForm_Initialize() '''''''''''' Dim FilterType(5) As Integer Dim FilterData(5) As Variant Set sset = ThisDrawing.SelectionSets.Add("sset_MText") FilterType(0) = 0 FilterData(0) = "MText" FilterType(1) = -4 FilterData(1) = "<or" FilterType(2) = 1 FilterData(2) = "*№*" FilterType(3) = 1 FilterData(3) = "№*" FilterType(4) = -4 FilterData(4) = "or>" FilterType(5) = 8 FilterData(5) = "***" sset.SelectOnScreen FilterType, FilterData Dim xT, xD As Variant Dim ent As AcadMText j = 0 For Each ent In sset opori_text(j, 3) = ent.Handle ent.GetXData "MText", xT, xD If VarType(xT) = vbEmpty Then opori_text(j, 2) = "" Else opori_text(j, 2) = xD(1) End If j = j + 1 Next ent '''''''''''''' LstBx.List() = opori_text ''''''''''''''
Потом по кнопке хочу стереть расширенные данные:
Private Sub CmBtn_del_Click() Dim i As Integer Dim strHandle As String Dim tempObj As AcadMText Dim xT(0) As Integer Dim xD(0) As Variant If LstBx.ListIndex = -1 Then Exit Sub xT(0) = 1001: xD(0) = "MText" For i = 0 To LstBx.ListCount - 1 If LstBx_opori.Selected(i) Then strHandle = Trim(LstBx_opori.List(i, 3)) Set tempObj = ThisDrawing.HandleToObject(strHandle) tempObj.SetXData xT, xD LstBx.List(i, 2) = "" End If Next End Sub
Но при новой загрузке формы расширенные данные остались