Public Function JointPolyline(ents)
Dim TReg As Variant
Dim i As Long
Dim cuts As Long
Dim oSS() As AcadEntity
Dim CutL As Variant
If TypeOf TReg Is AcadRegion Then
ents = TReg.Explode()
end if
cuts = UBound(ents)
ReDim Preserve oSS(0 To cuts) As AcadEntity
For Each CutL In ents
Set oSS(i) = MyDWG.ModelSpace.item(MyDWG.ModelSpace.Count - 1 - i)
i = i + 1
Next CutL
'add plines to group
Tgroup.AppendItems oSS
Dim GRname As String
GRname = Tgroup.Name
' using SendCommand method with Group
MyDWG.SendCommand "J" & vbCr & "G" & vbCr & GRname & vbCr & vbCr
' deleting group and clearing selection set
Tgroup.Delete
'sset.Clear
Dim TempTile As AcadLWPolyline
Set TempTile = MyDWG.ModelSpace.item(MyDWG.ModelSpace.Count - 1)
TempTile.closed = True
End Sub
Hi Ed,
i attached partial code (hope nothing is missed) , i notice that send command MyDWG.SendCommand "J" & vbCr & "G" & vbCr & GRname & vbCr & vbCr takes more time to join lines (based on API using point), before i used join method by joininig points similar to your proposal in my previous questions by using start and end point but encounter issues as some pointes were acting as start or End which create mistakes once lines were connected, to avoid checking start or end order i found joining will work easier but slower