Hi,
As I replied you in this other thread, if you want to hard-code the "join" option of the "PEDIT" command, you can get some inspiration from this reply. The MJOIN command uses the PolylineSegement and PolylneSegmentCollection classes defined in the GeometryExtensions assembly. The source code (C#) and compiled assemblies are downloadable from this reply.
But it seems to me that you're missing the AutoCAD and .NET basics.
So, you'd perhaps rather do some "scripting" with the "PEDIT" command.
Here's an example using a Tony Tanzillo's Editor.Command extension method which allow to pass managed types arguments to the command (as the LISP "command" function).
Imports System.Reflection
Imports Autodesk.AutoCAD.ApplicationServices
Imports Autodesk.AutoCAD.DatabaseServices
Imports Autodesk.AutoCAD.EditorInput
Imports Autodesk.AutoCAD.Runtime
Namespace gulzar25.JoinIntoPolyline
' credit to Tony Tanzillo
' http://www.theswamp.org/index.php?topic=43113.msg483306#msg483306
Module MyEditorExtensions
Dim runCommand As MethodInfo = _
GetType(Editor).GetMethod("RunCommand", BindingFlags.Instance Or BindingFlags.NonPublic Or BindingFlags.Public)
<System.Runtime.CompilerServices.Extension> _
Public Function Command(ed As Editor, ParamArray args As Object()) As PromptStatus
If Application.DocumentManager.IsApplicationContext Then
Throw New InvalidOperationException("Invalid execution context for Command()")
End If
If ed.Document <> Application.DocumentManager.MdiActiveDocument Then
Throw New InvalidOperationException("Document is not active")
End If
Return DirectCast(runCommand.Invoke(ed, New Object() {args}), PromptStatus)
End Function
End Module
Public Class Commands
<CommandMethod("MJOIN")> _
Public Sub MultipleJoin()
Dim acEditor As Editor = Application.DocumentManager.MdiActiveDocument.Editor
Dim sf As SelectionFilter = New SelectionFilter(New TypedValue() {New TypedValue(8, "FirstBias")})
Dim psr As PromptSelectionResult = acEditor.SelectAll(sf)
If psr.Status <> PromptStatus.OK Then
Return
End If
acEditor.Command("_.pedit", "_multiple", psr.Value, "", "_join", 0.0, "")
End Sub
End Class
End Namespace
IMO, scripting AutoCAD commands with .NET looks like hunting mosquitoes with a bazooka, this task would have been much more simply done with LISP:
(defun c:join (/ ss)
(if (setq ss (ssget "_X" '((8 . "FirstBias"))))
(command "_.pedit" "_multiple" ss "" "_join" 0.0 "")
)
(princ)
)