Macro to detect and delete multiple lines in sketches

Discussion in 'SolidWorks' started by Chris Dubea, May 1, 2007.

  1. Chris Dubea

    Chris Dubea Guest

    Hi all,

    Has anyone seen a macro to detect multiple overlapping lines in
    sketches? I'm spending an awful lot of my time debugging crappily
    drawing AutoCAD dwg imports that lines on top of lines. Of course
    this makes feature generation problematic at best.

    Thanks in advance


    ===========================================================================
    Chris
     
    Chris Dubea, May 1, 2007
    #1
  2. Chris Dubea

    fcsuper Guest

    Chris,

    I know this isn't the answer you want, but if you are encountering
    issues with the importation of ACAD drawings into SolidWorks, then I
    highly recommend simply recreating the geometric natively in
    SolidWorks. You maybe using more time repairing crappy ACAD sketchs
    than you would if you created them from scratch within SolidWorks.

    Matt
    http://sw.fcsuper.com
     
    fcsuper, May 1, 2007
    #2
  3. Chris Dubea

    That70sTick Guest

    I have an addin that counts and sorts sketch entities. That may be a
    good start point.

    The bad news is that the program on my website is an addin, not a
    macro. I would have to go and find the source code.

    <http://www.EsoxRepublic.com/freeware/>
     
    That70sTick, May 1, 2007
    #3
  4. Chris Dubea

    Chris Dubea Guest

    Would you please?

    Could you e-mail it to me at

    Thanks Roland,

    ,
    ===========================================================================
    Chris
     
    Chris Dubea, May 1, 2007
    #4
  5. Chris Dubea

    Chris Dubea Guest

    I know what you are saying, but sometimes this is easier said then
    done.

    Thanks,

    ===========================================================================
    Chris
     
    Chris Dubea, May 1, 2007
    #5
  6. Tools/Sketch Tools/Repair Sketch is the function you need to use right
    after importing a sketch.
    It will do exactly what you want.
    If you still have superimposed segments, then they're aren't perfectly
    superimposed (not the same endpoints) and no macro can solve this.
    If so, you might try to select chains of segments and copy them to
    another sketch, or "use" them from a different sketch.
     
    Philippe Guglielmetti, May 2, 2007
    #6
  7. Chris Dubea

    Zander Guest

    Also, if I remember - autocad the an 'express tools' menu that has a
    'delete duplicate items' which does contain a 'fuzz' factor. The
    routine works very well.

    Zander
     
    Zander, May 2, 2007
    #7
  8. Chris Dubea

    Jean Marc Guest

    In those cases, I simply import the dwg as the first sketch, and start
    another sketch that uses the first's geometry.
    Hope i'm clear enough.

    JM
     
    Jean Marc, May 2, 2007
    #8
  9. Chris Dubea

    Chris Dubea Guest

    Unfortunately, I don't have access to AutoCAD, I use
    DWGEditor/Intellicad at present. I had found a LISP gizmo that was to
    have deleted these segments, but it's a compiled format and doesn't
    work properly with DWGEditor/Intellicad.

    Thanks to all who responded, particularly Phillippe!

    ===========================================================================
    Chris
     
    Chris Dubea, May 2, 2007
    #9
  10. Chris Dubea

    kenneth Guest


    some of the oem 2D geometry can be quite complex and could involve many
    hours to recreate. yes, i concur. easier said than done. ;)
     
    kenneth, May 2, 2007
    #10
  11. Chris Dubea

    samurai Guest

    When there are two or more lines sharing a common sketch end point,
    those line will appear 'thin' compared to sketch lines that meet/share
    one common end point.

    And using the sketch repair tool helps quite a bit, but is not
    perfect.

    samurai.
     
    samurai, May 3, 2007
    #11
  12. Chris Dubea

    Chris Dubea Guest

    This is how it's supposed to behave, but I've found it's not
    consistent.

    One of the problems is I use GhostScript/GhostView to extract dxf's
    from PDF catalog pages for those vendors who are afraid to give us CAD
    files. Unfortunately these extractions tend to be the worst offenders
    as in a lot of cases there are multiple overlays of lines. When faced
    with this, I usually use the imported sketch as a baseline for the
    sketch to create my geometry from.
    I've found that as well :<

    Thanks to all who responded.

    ===========================================================================
    Chris
     
    Chris Dubea, May 3, 2007
    #12
  13. Chris Dubea

    Ed Guest

    This is an older post but here are two ideas for you:

    The first is that in ACAD when the file is saved out in one of the 2D
    transfer formats, (unfortunately I can't remember which one it is
    anymore) that the 3D geometery from ACAD gets flattened into a 2D
    drawing. A lot of folks believe that ACAD is a 2D animal but it
    really is 3D wireframe and when looking straight on it looks 2D. A
    good example of this wold be a simple cube. Straight on there are
    really two edges for every line and a line that shows up as an
    endpoint at each corner. The Flatten problem has been an issue with
    ACAD for a long time. If you look around for a tool called "flatten"
    you should be able to find an AutoLisp routine that could help you.

    On a more straight forward approach if you make a sketch "above" the
    ported in sketch, (inside of SW) and then by selecting one edge at a
    time from the origional sketch and projecting, (ie. convert entity)
    you should be able to fairly easily recreate a copy that should be
    much easier then starting from scratch. Be sure that the
    associativity is turned off and then the origional ported sketch can
    be discarded at the end.

    Hope this helps,

    EdT
     
    Ed, May 22, 2007
    #13
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.