'合并选择集中分离的线为PLine
Public Sub JoinLineToPline(sel As AcadSelectionSet)
Dim strCommand As String
strCommand = "_Pedit" & vbCr & axEnt2lspEnt(sel.Item(0)) & " Y J "
Dim i As Integer
For i = 0 To sel.Count - 1
strCommand = strCommand + axEnt2lspEnt(sel.Item(i)) + vbCr
Next
strCommand = strCommand + vbCr + vbCr
ThisDrawing.SendCommand strCommand
End Sub
Public Function axEnt2lspEnt(entObj As AcadEntity) As String
Dim entHandle As String
entHandle = entObj.Handle
axEnt2lspEnt = "(handent " & Chr(34) & entHandle & Chr(34) & ")"
End Function