News:

Please note new Forum URL: forum.designcad.com

Main Menu
DesignCAD 3D Max 2027 box
Now available

DesignCAD 2027

Hatches that follow their boundaries, an on-screen dial to turn your model, and a way to find any command by name, in a clean Windows 11 look.

Duplicate Entities

Started by ChiliBill, May 15, 2015, 06:30:57 AM

Previous topic - Next topic

0 Members and 0 Guests are viewing this topic.

ChiliBill

I did a search and found a Macro to delete the duplicate entities, but it doesn't seem to work.  I found it here http://forum.designcad.com/index.php?topic=4904.msg31217#msg31217

It runs and tells me how many duplicates it found, but the dups are still there after I press enter.  I selected one view of the drawing, and ran it.  This time it deleted the entire view.

I'm using V23 with the update.


magic

Hi Bill,

There is a regular option called 2D Lines Cleanup at the bottom of the Tools menu that works pretty well.

Hope this helps.
It's a kind of magic!




bdeck

#2
Quote from: ChiliBill on May 15, 2015, 06:30:57 AM
I selected one view of the drawing, and ran it.  This time it deleted the entire view.
BobP's macro works ok for me, but I added the following lines to the top of macro to prevent deletion of preselected entities.
bd
>DeSelect
   {
   }



PS: I also modified the firstline of the first  loop to make it easier to alter the macro for other purposes.
for a = 1 to (Sys(9)-1)

ChiliBill

Thanks guys

Majic,  I never saw the 2D line clean up.  I tried it, but it was a bit aggressive.  Wasn't sure what options to chose so left them both selected and it deleted most of the drawing.  I'll keep it in mind when I make a new drawing to keep it clean as I go.

  BD,  I ran it again and noticed it didn't find as many duplicates as before.  The second pass through, when I noticed the counter, it found over 500 duplicates.  This time it found only 58, and so far it seems to be clean.  It's an old drawing that has been copied, pasted, grouped and un-grouped many times.  Probably accounts for all the duplicate entities.   In any case it does work, and I may have just jumped the gun.

Where can I find the information to code a macro?  Or what language is used?  There is no information in the Help file.

Bill

bdeck

Quote from: ChiliBill on May 15, 2015, 12:36:07 PM
Where can I find the information to code a macro?  Or what language is used?  There is no information in the Help file.

http://forum.designcad.com/index.php?topic=1537.msg7937#msg7937

Get the help file for version 17 (or 15 if you want to be backwards compatible).

From there, copy the sys() functions and sys$() functions to separate text files so that they will be word searchable.

bd


ChiliBill

Thank you, I'll look them over. 

My drawing is much cleaner, but unfortunately it still has some duplicate lines.  I'll just clean it manually.

Dr PR

CB,

In drawings that have a lot of duplicate lines I have found it is easier and quicker to trace over the drawing on new layers than it is to hunt out each of the duplicate lines individually. Gravity snap makes it simple to trace over the existing lines.

This is especially true of 2D projection images saved from 3D drawings.

Phil
DesignCAD user since 1987