Are lines connected?

Discussion in 'AutoCAD' started by BillZ, Aug 21, 2003.

  1. BillZ

    BillZ Guest

    R14 Autolisp:
    I am working on a program that checks to see if the lines that comprise the outline of a 2d CNC part are drawn correctly. We have had novice AutoCAD users and others make some of these parts. Sometimes a line for one side of a part is really two or three lines (don't ask me why) It's like when a mirror was done, the center point was ignored so the lines overlap yet are supposed to be end to end. Sometimes the segments are broken @, sometimes there is a small gap between them.
    The tricky part is that there are lines that are collinear to these lines but need to be part of a different bend, i.e. two bends may be on the same side of the part but are at least 1/4" - 5/8" from lines on the other bend.
    What I have so far is a selection set that has all the lines that are collinear along one side of the part. What I have to do is discern when lines are a part of one bend or another bend. Yet each bend may have 2 or 3 lines that touch or overlap.
    I need to convert the 2 or 3 lines that comprise one bend to a single line. And yet not accidentally include lines from another bend that's further down the side of the part.
    I need to go through this ss and tell if a line overlaps by 1/4" or if it really is 1/4" away from some of the others. And end up with individual sets of lines that are a part of the individual bends.
    I have no trouble when the side has only one bend, because then I can check the overall distance of the length of the lines and draw a new line to replace them. It's when there are two bends that are collinear that I have trouble separating them.
    Just looking for some fresh insight.

    Bill
     
    BillZ, Aug 21, 2003
    #1
  2. BillZ

    BillZ Guest

    Nevermind... I got it.
    An error in my programming :(. I was adding the distance to the list before the line passed testing. Now run a templist and if distance passes, add distance to list. :)

    Bill
     
    BillZ, Aug 22, 2003
    #2
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.