See the top rated post in this thread. Click here

Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: How to join two collinear segments into one segment without using polyline

  1. #1
    Login to Give a bone
    0

    Default How to join two collinear segments into one segment without using polyline

    Hey all,

    Need a usage tip here. I have collinear segments that share an endpoint that I need become one segment. I cannot use polylines because the software I export DXF to does not support them.

    Picture this: *----*----* needs to become *---------*

    That point in the middle needs to go away and I cannot use polyline. The reason why I can't just keep the two segments is because it causes the robot that follows the DXF drawing stop and restart on each segment end, so one continuous segment is considerably faster.

    Is there a command, macro, or AutoLISP code that I can use to achieve this?

    Insight is appreciated.

    Thanks!

  2. #2
    Certifiable AUGI Addict
    Join Date
    2001-03
    Location
    Tallahassee, FL USA
    Posts
    3,658
    Login to Give a bone
    1

    Default Re: How to join two collinear segments into one segment without using polyline

    Join command

  3. #3
    I could stop if I wanted to
    Join Date
    2015-05
    Location
    West Des Moines
    Posts
    306
    Login to Give a bone
    0

    Default Re: How to join two collinear segments into one segment without using polyline

    Quote Originally Posted by Tom Beauford View Post
    Join command
    Yeah, but that'll make it a polyline unless the line is perfectly straight?

    Lines don't have the functionality to bend as far as I'm aware.

    Edit: Just realized he said they're collinear lines. If that's the case that will work, but even a slight bend will not allow it.

  4. #4
    Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    6,397
    Login to Give a bone
    0

    Default Re: How to join two collinear segments into one segment without using polyline

    Here's one you can try. I've had it so long I don't remember where I got it. Its a little forgiving because it simply gets the two endpoints and draws a new line, then deletes the selected entities. So they don't have to be colinear.
    Attached Files Attached Files
    C:> ED WORKING....

  5. #5
    100 Club
    Join Date
    2007-08
    Location
    Rockford, Illinois
    Posts
    161
    Login to Give a bone
    1

    Default Re: How to join two collinear segments into one segment without using polyline

    Use OVERKILL

  6. #6
    100 Club david-k's Avatar
    Join Date
    2015-12
    Location
    San Diego, CA
    Posts
    100
    Login to Give a bone
    0

    Default Re: How to join two collinear segments into one segment without using polyline

    Quote Originally Posted by Ed Jobe View Post
    Here's one you can try. I've had it so long I don't remember where I got it. Its a little forgiving because it simply gets the two endpoints and draws a new line, then deletes the selected entities. So they don't have to be colinear.
    Added benefit of this lisp is the "gluing" of single line text

  7. #7
    Login to Give a bone
    0

    Default Re: How to join two collinear segments into one segment without using polyline

    Quote Originally Posted by duhvinci View Post
    Use OVERKILL
    That's what I want to use. But interestingly that doesn't always work. If I draw two collinear lines, they will get combined with OVERKILL. If I import a DXF with collinear segments, they will NOT get combined with OVERKILL. AND if I explicitly constrain them as collinear, they will still NOT get combined with OVERKILL. Weird, huh?

    Is there a workaround for that?

    [EDIT]
    Plot thickens. I found that if I do two things:
    1. Constrain the two segments with explicit collinear constraint
    2. Turn off "Maintain associative objects"

    It will do the combine. But how do I automate this? Right now I'd be manually having to add the explicit collinear constraint before it works.
    Last edited by whackoprogrammer760234; 2017-12-06 at 03:14 PM.

  8. #8
    Login to Give a bone
    0

    Default Re: How to join two collinear segments into one segment without using polyline

    Quote Originally Posted by Ed Jobe View Post
    Here's one you can try. I've had it so long I don't remember where I got it. Its a little forgiving because it simply gets the two endpoints and draws a new line, then deletes the selected entities. So they don't have to be colinear.
    It does weird stuff to my drawings. It deleted two segments and made another one, but it moves one of the endpoints to an endpoint of another segment. Imagine I had two vertical segments, but ended up with a "combined" segment at a 30 degree angle.
    Last edited by whackoprogrammer760234; 2017-12-07 at 02:06 AM.

  9. #9
    Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    6,397
    Login to Give a bone
    0

    Default Re: How to join two collinear segments into one segment without using polyline

    "It"? What? Do you mean GLUE? Try turning off AUTOSNAP (F11) before you run it.
    C:> ED WORKING....

  10. #10
    Login to Give a bone
    0

    Default Re: How to join two collinear segments into one segment without using polyline

    Quote Originally Posted by Ed Jobe View Post
    "It"? What? Do you mean GLUE? Try turning off AUTOSNAP (F11) before you run it.
    Quote fail, sorry. Yeah, turning off snaps helps. Pretty good, but can it be automated? I need a command that goes through the drawing and finds collinear segments and combines them. That's a job for OVERKILL normally, but segments have to be explicitly constrained as collinear, and in my source drawings they are not...

Page 1 of 2 12 LastLast

Similar Threads

  1. 2015: Separate colours for different segments within one polyline
    By j.lathouwers in forum AutoCAD General
    Replies: 4
    Last Post: 2015-04-13, 12:34 PM
  2. Different colours for separate polyline segments
    By Wish List System in forum AutoCAD Wish List
    Replies: 2
    Last Post: 2015-04-13, 12:04 PM
  3. Get Polyline segments
    By cadplayer in forum AutoLISP
    Replies: 37
    Last Post: 2015-02-06, 11:33 PM
  4. Converting line segments into polyline
    By VBOYAJI in forum AutoCAD Map 3D - General
    Replies: 9
    Last Post: 2007-06-25, 01:56 PM
  5. Changing polyline curves to straight segments
    By gadjet in forum AutoCAD General
    Replies: 3
    Last Post: 2007-01-29, 05:53 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •