Тема: Почему не работает??? Help
Sub ÍàáîðÏðèìèòèâîâ()
Dim MySelSet As AcadSelectionSet
Set MySelSet = ThisDrawing.SelectionSets("MySet")
ReDim MyObjSet(0 To ThisDrawing.ModelSpace.Count - 1) As AcadEntity
Dim X As Integer
X = 0
Dim I As Integer
With ThisDrawing.ModelSpace
Do
If .Item(X).ObjectName = "AcDbPolyline" And .Item(X).Layer Like "Category*" Then
Set MyObjSet(I) = .Item(X)
I = I + 1
End If
X = X + 1
Loop Until X = ThisDrawing.ModelSpace.Count
End With
ReDim Preserve MyObjSet(0 To I) As AcadEntity
MySelSet.AddItems MyObjSet
End Sub