.NET

Reply
Active Contributor
AdriDicri
Posts: 33
Registered: ‎09-23-2011
Message 1 of 6 (767 Views)

[.NET] Delete duplicates (Overkill not working in this case)

767 Views, 5 Replies
07-29-2013 01:43 AM

Hello everyone !

I'm working with autocad 2013, and i have to delete all duplicates entities.

I know there is the OVERKILL command but it's not working as I need. I need to delete all the duplicates.

Ex : In a drawing, 2 lines are exactly the same, and 1 is different. I need a function that erase the 2 first because they're duplicates and leave the last one on the drawing.

I can do it with a simple algorithm that compare every line with every other line, but it takes a very long time if there's too much line on the drawing.

Is there an other function to do this?

Thanks for replies.

Adri DiCri

P.S : Sorry for my english, not my mother tongue !

 

 

 

ADN Support Specialist
fenton.webb
Posts: 352
Registered: ‎07-24-2007
Message 2 of 6 (733 Views)

Re: [.NET] Delete duplicates (Overkill not working in this case)

07-29-2013 11:34 AM in reply to: AdriDicri

Please give more detail as to why OVERKILL isn't working for you...





Fenton Webb

Developer Technical Services

Autodesk Developer Network


Active Contributor
AdriDicri
Posts: 33
Registered: ‎09-23-2011
Message 3 of 6 (721 Views)

Re: [.NET] Delete duplicates (Overkill not working in this case)

07-29-2013 02:16 PM in reply to: fenton.webb

Hello fenton.webb

 

As i said, OVERKILL deletes just 1 of 2 duplicates entities, but i need that both entities to be deleted of the drawing, and single entities stays on the drawing.

Imagine a square composed by 2 triangles. I need to erase the duplicated diagonales and keep only the contour.

 

Or did I miss something with the OVERKILL function???

 

I hope it's clear enought :smileyhappy:

 

If not, i will try to post a DWG file to explain better :smileywink:

 

Thanks for your reply !

 

Adri DiCri

ADN Support Specialist
fenton.webb
Posts: 352
Registered: ‎07-24-2007
Message 4 of 6 (696 Views)

Re: [.NET] Delete duplicates (Overkill not working in this case)

07-30-2013 11:56 AM in reply to: AdriDicri

Can't you just re-run the OVERKILL command until all have been removed?





Fenton Webb

Developer Technical Services

Autodesk Developer Network


*Expert Elite*
arcticad
Posts: 1,285
Registered: ‎06-21-2004
Message 5 of 6 (692 Views)

Re: [.NET] Delete duplicates (Overkill not working in this case)

07-30-2013 12:08 PM in reply to: fenton.webb

By your own explanation if you have two lines and you delete the one duplicate then the other line is no longer a duplicate and won't be erased.

 

If you wanted to limit checking every single object in the drawing against a single object. You could get the bounding box of the object and see if any object intersect or are contained within your area and then compare the objects agains that list, instead of the entire drawing.

 

 

 

---------------------------



(defun botsbuildbots() (botsbuildbots))
Active Contributor
AdriDicri
Posts: 33
Registered: ‎09-23-2011
Message 6 of 6 (678 Views)

Re: [.NET] Delete duplicates (Overkill not working in this case)

07-30-2013 02:56 PM in reply to: AdriDicri

Ok, i will try this tomorrow at work :smileywink:

 

Thanks.

 

Adri DiCri

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.