Finding parallel features

Discussion in 'AutoCAD' started by RaghuMN, Jun 10, 2004.

  1. RaghuMN

    RaghuMN Guest

    Hi all,

    Using ssget (or equivalent activex select) function, how can I find 2 lines / arcs / polylines that have same length and direction, but offset at a distance, say 0.1 unit from each other (i.e., parallel, not intersecting)?

    Thanks for any suggestions,

    MNRaghu
     
    RaghuMN, Jun 10, 2004
    #1
  2. RaghuMN

    BillZ Guest

    Here's a snip from a program I got from someone that finds lines that overlap each other.
    Maybe you can adjust it for what you want.

    (setq s2 (ssget "F" (list pt3 pt4)
    (list '(0 . "LINE")
    '(-4 . "<AND")
    '(-4 . "<OR")
    '(-4 . "<AND")
    '(-4 . ">=,>=,>=")(cons 10 (mapcar '- pt1 fuzz))
    '(-4 . "<=,<=,<=")(cons 10 (mapcar '+ pt1 fuzz))
    '(-4 . "AND>")
    '(-4 . "<AND")
    '(-4 . ">=,>=,>=")(cons 10 (mapcar '- pt2 fuzz))
    '(-4 . "<=,<=,<=")(cons 10 (mapcar '+ pt2 fuzz))
    '(-4 . "AND>")
    '(-4 . "OR>")
    '(-4 . "<OR")
    '(-4 . "<AND")
    '(-4 . ">=,>=,>=")(cons 11 (mapcar '- pt1 fuzz))
    '(-4 . "<=,<=,<=")(cons 11 (mapcar '+ pt1 fuzz))
    '(-4 . "AND>")
    '(-4 . "<AND")
    '(-4 . ">=,>=,>=")(cons 11 (mapcar '- pt2 fuzz))
    '(-4 . "<=,<=,<=")(cons 11 (mapcar '+ pt2 fuzz))
    '(-4 . "AND>")
    '(-4 . "OR>")
    '(-4 . "AND>")
    ) ;end s2 list
    ) ;end ssget
    ) ;end setq


    Bill
     
    BillZ, Jun 10, 2004
    #2
  3. RaghuMN

    randy benson Guest

    Piece of cake - here's the pseudocode:

    0) Select every entity in the drawing and save the selection set as a variable, say "SS_All"
    1) Grab a selection set of all the lines, arcs and/or polylines and save as a variable, say "SS".
    2) Set a counter to say, 0 and save as a variable named, say, "counter".
    3) Prompt the user for an offset distance and save it as a variable named, say, "offsetdist".
    3) Iterate through SS using/incrementing "counter", and for each member of SS, use (command "._OFFSET" ... ) to create a temporary entity offset offsetdist to the right of each entity in SS.
    4) Filter SS_All for the same kinds of entities as contained in SS (filter out every entity that is not the same type as the entities in SS)
    5) Compare the remaining entities to see if any of them are identical spatially with the one you just created.
    6) delete the temporary entity.
    7) repeat 3) through 7) for the left hand offset.
     
    randy benson, Jun 10, 2004
    #3
  4. RaghuMN

    RaghuMN Guest

    Thanks BillZ and Randy.

    BillZ, you have taken me to the nearest point of my requirement. Great.

    Randy, You have given another useful alternative way for achieving the same requirement.

    Thanks again,

    MNRaghu
     
    RaghuMN, Jun 11, 2004
    #4
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.