TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: curmudgeon on July 17, 2009, 02:39:54 PM

Title: unique entities between two files
Post by: curmudgeon on July 17, 2009, 02:39:54 PM
the real world intrudes.

when working with other peoples' files as base drawings and they send you updated files, I am often left to my own devices to figure out exactly what changed. there has been a remove duplicates in express tools for a long time. has anyone done the inverse, and created a routine to look for UNIQUE entities?

say I insert the new file into ( a copy of ) the old file and search for every entity that does not have a duplicate.
what would that look like, and how might it work?
Title: Re: unique entities between two files
Post by: Matt__W on July 17, 2009, 02:50:31 PM
This sounds like a job for... Da da da daaaaa.... DRAWING COMPARE MODULE  MODULE  MODULE  MODULE


http://autocadmepblog.ebimsolutions.com/2008/04/drawing-compare-subscription-module-for.html
Title: Re: unique entities between two files
Post by: T.Willey on July 17, 2009, 02:52:17 PM
I would think you could step through each drawing and make a list of all handles.  Then just compare the two lists.
Title: Re: unique entities between two files
Post by: Keith™ on July 17, 2009, 02:57:43 PM
I would think you could step through each drawing and make a list of all handles.  Then just compare the two lists.

Yeah, except some utilities rebase the handles so they aren't as permanent as one might think
Title: Re: unique entities between two files
Post by: T.Willey on July 17, 2009, 03:21:35 PM
I would think you could step through each drawing and make a list of all handles.  Then just compare the two lists.

Yeah, except some utilities rebase the handles so they aren't as permanent as one might think

Well that just sucks then.  I guess you could check the handle and object type, but beyond that I'm not sure how else one would do a simple check.
Title: Re: unique entities between two files
Post by: CAB on July 17, 2009, 05:28:27 PM
If the handles were changed then you would get a lot of false warnings. I could live with that.
But what if an object was moved or modified? Handle would remain the same.
Title: Re: unique entities between two files
Post by: T.Willey on July 17, 2009, 06:10:17 PM
If the handles were changed then you would get a lot of false warnings. I could live with that.
But what if an object was moved or modified? Handle would remain the same.


True.  I was thinking more of new/deleted objects only.  I guess you could get the bounding box points, and test those along with object name/type.
Title: Re: unique entities between two files
Post by: curmudgeon on July 17, 2009, 06:19:57 PM
If the handles were changed then you would get a lot of false warnings. I could live with that.
But what if an object was moved or modified? Handle would remain the same.

point taken.
I was leaning toward brute force. put all the revision's entities in one layer.
go through the old set one entity at a time and search with a ssget "CP" and filters based on the entity your checking for.

I think it would fly, but I have certainly not thought it all the way through. for example, if you were checking for a duplicate circle you would have to do something like calculate a point on the circle from the radius and center point and calculate the crossing polygon to insure you would find a duplicate.

must put this on the back burner, other things pushed ahead of it.

OOPS
this would find things removed, but I have to go through the other set too to catch additions.
Title: Re: unique entities between two files
Post by: Lee Mac on July 17, 2009, 08:36:06 PM
Just thinking aloud, but, say you copied the contents of each file into a single drawing, could you not create two selection sets of each set of entities, and, compare the DXF data for each entity in SelSet 1, with that of entities in SelSet 2, and if a match is found, remove both entities from the SelSets?

Of course, this is a completely "brute-force-sledge-hammer" approach... but then, if handles do not live up to their expectations, then this may be another option.

EDIT: this wouldn't work as all the locations would be different... stupid idea.

New Idea!

Ok, how about finding a base point and copying all the entities into one drawing, and sitting both copies on top of one another. Then use OVERKILL to remove duplicates, leaving you with the uniques :-)
Title: Re: unique entities between two files
Post by: It's Alive! on July 17, 2009, 08:54:26 PM
... compare the DXF data ...

This is how I might go about it
Title: Re: unique entities between two files
Post by: CAB on July 17, 2009, 09:37:56 PM
Compare handles between drawings
This will give you :
Missing items to report
Added Items to report
Matched items, Compare "Matched Items" & report any discrepancies


My 2 cents