Dim sset As AcadSelectionSet
Dim Ftype(0) As Integer
Dim Fdata(0) As Variant
Dim i As Integer
Dim entity As AcadEntity
Dim plineobj As AcadLWPolyline
Dim spnt As Variant
Dim epnt As Variant
Dim ver(0 To 3) As Double
Ftype(0) = 0
Fdata(0) = "Line"
For i = 0 To ThisDrawing.SelectionSets.Count - 1
ThisDrawing.SelectionSets.Item(i).Clear
ThisDrawing.SelectionSets.Item(i).Delete
Next
Set sset = ThisDrawing.SelectionSets.Add("linesset")
sset.SelectOnScreen Ftype, Fdata
For Each entity In sset
spnt = entity.StartPoint
epnt = entity.EndPoint
ver(0) = spnt(0): ver(1) = spnt(1)
ver(2) = epnt(0): ver(3) = epnt(1) '
Set plineobj = ThisDrawing.ModelSpace.AddLightWeightPolyline(ver)
plineobj.ConstantWidth = 0.5
entity.Delete
Next