Join Lines Using the CAD Command Line

Use the Join Lines command alias on the CAD Command Line to join two or more contiguous lines into individual linestrings using manual and automated methods. When lines are joined, they are converted into linestrings, thereby increasing their versatility. The resulting linestring's direction and properties are determined by the first (base) line that you choose.

There are two ways lines are joined:

  • By making their end points coincident if they are within 0.0001 m of each other.
  • By drawing a straight segment between the nearest end points if they are further than 0.0001 m apart; this only works for individual selected lines, not a mass selection of lines.

    Before

    After

Note: The pane-based versions of the CAD Command Line commands may have additional options not offered on the CAD Command Line, e.g., the option to join a single line to a selection of lines is only available in the pane-based command.
Note: End points with different elevations cannot be joined.
Note: This command works on 2D data; end points with an elevation of 0 (zero) are converted to 2D end points.

Prerequisites:

To join lines from the CAD Command Line:

  1. Press [F3] or click thei_command line icon on the Status Bar to open the CAD Command Line near the bottom of the screen.
  2. Type j or J at the command prompt, and press [Enter].
  3. Skip the Layer, Color, and Line style lists below the command prompt; they do not apply to this operation.
  4. Pick one or more lines to join in a supported view (Plan, Sheet, or Cutting Plane), and press [Enter]. Based on whether you selected one line or many lines, either the single line mode or multiple lines mode is automatically selected. Having the lines on different layers does not prevent them from being joined.
    • With a single line selected, pick another line to join to the selected line. The two lines are joined. You can continue to pick additional lines to join to the selected (now longer) line. Using this method, the properties of the joined line are copied from the base line.
    • With multiple lines selected, the lines thay can be are joined. For multiple line joined at once, the command searches from each selected line to each consecutive line, joining them until it reaches a break in the lines or a branch to multiple lines where it stops. The number of lines that were successfully joined to the base line is reported at the bottom of the pane. Using this method, all lines inherit the properties of the last line that was created.

    Before; the arrow line was created last

    After all the lines are joined at once

  5. Pick additional lines to join, or press [Escape] to end the command and return to a blank command prompt.
  6. Press [Spacebar] to rerun the command.

    Note: If you find that you need to edit any of the lines you are trying to join, click the Edit icon after you have picked the line. You can also click the Edit icon before you pick the line, and you will be prompted to specify the line to edit. This enables you to move a line's end point within the distance tolerance that allows coincident end points of lines to be joined without adding a straight segment.

Dependencies:

  • None.

Scenarios:

  • If the end points of the lines selected to join are at different elevations, vertical segments may be added between them. It is recommended that you join lines that are at the same elevations.

    Warning: Always check your results in the 3D View or Profile Viewer!

  • If the lines to join slightly overlap/cross at the end, the end points will be adjusted to avoid creating a loop.

    Before

    After

Related topics

Using the CAD Command Line

Break a Line Using the CAD Command Line

Join Lines (pane-based command)

CAD Command Line Quick Reference Guide