Hi,
It is working now:
<CommandMethod("teste")>
Public Sub teste()
Dim doc = ApplicationServices.Application.DocumentManager.MdiActiveDocument
Dim ed = doc.Editor
For i = 0 To 100
Dim ss = ED.SelectAll(New SelectionFilter({New TypedValue(DxfCode.Operator, "<AND"),
New TypedValue(DxfCode.Start, "LWPOLYLINE"),
New TypedValue(DxfCode.LayerName, CadMemoOptions.LayerQuadra),
New TypedValue(DxfCode.Operator, "AND>")}))
If ss.Status <> PromptStatus.OK Then
MsgBox(ss.Status.ToString & vbNewLine & "i=" & i)
Exit Sub
End If
ss.Value.Dispose() 'added this to ZWCAD works
Next
End Sub
ZWCAD can only have 255 selection sets at the same time, so when a selection set is no longer needed, developers should call its Dispose() method to free this selection set