det = axSSet2lspEnts(SSet1)
ThisDrawing.SendCommand "flatten" & vbCr & det & vbCr & vbCr & "no" & vbCr & vbCr
Function axSSet2lspEnts(ByVal SSet As AcadSelectionSet) As String
If SSet.Count = 0 Then Exit Function
Dim enthandle As String
Dim strEnts As String
enthandle = SSet.Item(0).Handle
strEnts = "(handent " & Chr(34) & enthandle & Chr(34) & ")"
If SSet.Count > 1 Then
Dim i As Integer
For i = 1 To SSet.Count - 1
enthandle = SSet.Item(i).Handle
strEnts = strEnts & vbCr & "(handent " & Chr(34) & enthandle & Chr(34) & ")"
Next i
End If