2 момента. Для LWPLYLINE 70 группа немного не такая по справке:
Polyline flag (bit-coded); default is 0:
1 = Closed; 128 = Plinegen
Ты же справку показал для POLYLINE! А это уже другая песня...
И попробуй такой код (я особо его не проверял):
Sub GetSelSet(Optional EntType As String = "LWPOLYLINE", _
Optional Linetype As String = "ByLayer", _
Optional sLayer As String, _
Optional iColor As Integer = -5, _
Optional iLineWeight As Integer = -1, _
Optional bIsClosedLWPline As Boolean = True)
Dim SelSet As AcadSelectionSet, sSetName As String
Dim lCounter As Long
Dim filDXF() As Integer, filData() As Variant
' Работаем с SelectionSet, удаляя старый с таким же именем
sSetName = "SelectForLWPlines"
For Each SelSet In ThisDrawing.SelectionSets
If SelSet.Name = sSetName Then
SelSet.Clear
SelSet.Delete
Exit For
End If
Next SelSet
Set SelSet = ThisDrawing.SelectionSets.Add(sSetName)
ReDim filDXF(1): ReDim filData(1)
' Определяем фильтры данных
filDXF(0) = 0: filData(0) = EntType
filDXF(1) = 6: filData(1) = Linetype
If sLayer <> "" Then
ReDim Preserve filDXF(1 + UBound(filDXF)): ReDim Preserve filData(1 + UBound(filData))
filDXF(UBound(filDXF)) = 8: filData(UBound(filData)) = sLayer
End If
If iColor <> -5 Then
ReDim Preserve filDXF(1 + UBound(filDXF)): ReDim Preserve filData(1 + UBound(filData))
filDXF(UBound(filDXF)) = 62: filData(UBound(filData)) = iColor
End If
If iLineWeight <> -1 Then
ReDim Preserve filDXF(1 + UBound(filDXF)): ReDim Preserve filData(1 + UBound(filData))
filDXF(UBound(filDXF)) = 370: filData(UBound(filData)) = iLineWeight
End If
If LCase(EntType) = "lwpolyline" And bIsClosedLWPline Then
ReDim Preserve filDXF(1 + UBound(filDXF)): ReDim Preserve filData(1 + UBound(filData))
filDXF(UBound(filDXF)) = 70: filData(UBound(filData)) = 1
End If
SelSet.Select acSelectionSetAll, , , filDXF, filData
SelSet.Highlight True
' GetSelSet = SelSet
End Sub
Sub testgetselset()
GetSelSet , , , , , True
End Sub