Sub PE()
Dim ss As AcadSelectionSet
Set ss = GetSelSet
Dim Ent As AcadEntity
For Each Ent In ss
If Ent.ObjectName = "AcDbLine" Then
ThisDrawing.SendCommand "_pe" & vbCr _
& axEnt2lspEnt(Ent) & vbCr & "y" & vbCr & "w" _
& vbCr & "1" & vbCr & vbCr
End If
Next
End Sub
Function GetSelSet() As AcadSelectionSet
Dim ss As AcadSelectionSet
Set ss = ThisDrawing.PickfirstSelectionSet
If ss.Count = 0 Then
Dim ssName As String
ssName = "strSSet"
On Error Resume Next
Set ss = ThisDrawing.SelectionSets(ssName)
If Err Then Set ss = ThisDrawing.SelectionSets.Add(ssName)
ss.Clear
ss.SelectOnScreen
End If
Set GetSelSet = ss
End Function
Public Function axEnt2lspEnt(entObj As AcadEntity) As String
Dim entHandle As String
entHandle = entObj.Handle
axEnt2lspEnt = "(handent " & Chr(34) & entHandle & Chr(34) & ")"
End Function