Macro to detect and delete multiple lines in sketches

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

Reply to
Chris Dubea
Loading thread data ...

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

formatting link

Reply to
fcsuper

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.

Reply to
That70sTick

Would you please?

Could you e-mail it to me at snipped-for-privacy@dubea.org

Thanks Roland,

, =========================================================================== Chris

Reply to
Chris Dubea

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

Thanks,

=========================================================================== Chris

Reply to
Chris Dubea

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.

Reply to
Philippe Guglielmetti

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

Reply to
Zander

"Chris Dubea" a écrit dans le message de news: snipped-for-privacy@4ax.com...

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

Reply to
Jean Marc

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

Reply to
Chris Dubea

some of the oem 2D geometry can be quite complex and could involve many hours to recreate. yes, i concur. easier said than done. ;)

Reply to
kenneth

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.

Reply to
samurai

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

Reply to
Chris Dubea

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

Reply to
Ed

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.