.NET

.NET

Reply
Active Contributor
34 Posts
0 Kudos
Registered: ‎09-23-2011
Post 1 of 6

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

899 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
352 Posts
27 Kudos
Registered: ‎07-24-2007
Post 2 of 6

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
34 Posts
0 Kudos
Registered: ‎09-23-2011
Post 3 of 6

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
352 Posts
27 Kudos
Registered: ‎07-24-2007
Post 4 of 6

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*
1,286 Posts
37 Kudos
Registered: ‎06-21-2004
Post 5 of 6

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
34 Posts
0 Kudos
Registered: ‎09-23-2011
Post 6 of 6

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
Announcements
Are you interested in helping shape the future of the Autodesk Community? To participate in this brief usability study, please click here. Your time and input is greatly appreciated!