J. Miller Posted December 5, 2008 Share Posted December 5, 2008 Hello, I have a rather large dwg imported file that has multiple duplicates. Lines, arcs, polygons drawn over each other up to 6 times in some cases. Is there a way to dig through the file and delete the duplicates until only one object exists? I have tried a few ways but seem to delete more than I really want to. Thanks in Advance. Jeff miller Quote Link to comment
Jonathan Pickup Posted December 5, 2008 Share Posted December 5, 2008 i have never used it, but there seems to be a tool you can buy called Optimise Drawing from Vectorbits, it has an option to delete duplicate objects (note that this command cannot be undone): http://vectorbits.com/VectorBits/home.html Quote Link to comment
J. Miller Posted December 5, 2008 Author Share Posted December 5, 2008 that's great, but, I was hoping to write something myself with a little help from my friends, not that I'm stingy or anything. Jeff Quote Link to comment
Pat Stanford Posted December 5, 2008 Share Posted December 5, 2008 My guess is that you will spend far more of your time writing and testing it than you would ever save in not buying it. Here is the outline of what you would need to do: Get a handle to the first object in the file and get it's type and location and "size". Get a handle to the second object. Get it's type and location and "size". Compare the two. If they are identical then delete the second object. If they don't match, then try the third, fourth, fifth, etc. until you reach the end of the objects list. Then go back and start at the second object in the list and do it again. Repeat until you have tested every object in the file. The "Size" of each object may include its class, layer, dimensions, angle, number of vertices, etc. depending on how closely you want them to match. My guess is the code will run 200 to 400 lines. I write and debug about 20 lines an hour. So this should only take you 10 to 20 hours (if you already know how to code) to get something working. Good Luck, Pat 1 Quote Link to comment
J. Miller Posted December 5, 2008 Author Share Posted December 5, 2008 well there goes my weekend... NOT, I thought it would have been a little simpler than that. Oh well thanks for the info. Jeff Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.