Help! Compare drawings

Help! Compare drawings

Anonymous
Not applicable
2,932 Views
15 Replies
Message 1 of 16

Help! Compare drawings

Anonymous
Not applicable

Can anyone help me how to compare two AutoCAD drawing using .NET API :

 

The comparison will be done as mentioned below factors:

 

1. Any type Entity

2. Block Reference
etc.

 

Becuase I want to make my own dwg comparator which will comapre two folder with all the possible features.

 

Thanks in Advance...

 

 

Edited by
Discussion_Admin

0 Likes
2,933 Views
15 Replies
Replies (15)
Message 2 of 16

Alfred.NESWADBA
Consultant
Consultant

Hi,

 

you will have first to decide what type of comparision you like to run:

a) drawings are fully identical in database ==> scan through the database and compare each item.

b) drawings were modified from the same source drawing: you might use the handle as identifier to find matching entities in both drawings, so if handles are missing or new they come from deletion or creation (in the other drawing), if the handle exists in both drawings you may use reflection to get the entities properties to be compared (more complex than written here in one sentence). But be careful: handles are not avalid identifier when e.g. anyone ran command _WBLOCK and continued then with that new dwg.

c) visual compare (I guess the most work then) ... if two lines (in drawing A) were joined to one polyline (in drawing B) should be recognized as identical or some entities were converted to a block ... and you want to recognize them as identical ... I would suggest to do more plot-result comparision than entity compare, because there are to many different properties to compare that might not be available in the other objecttype (e.g. line has no property for start-segment-width and end-segment-width like a polyline has). Simulating a plot-device reduces all entities to minimal complex lines, curves and fills, so that would be my way in that case.

d) ... and other ideas will follow 😉

 

You can also see a comparision in DesignReview (>>>details for compare<<<) which can compare two DWF-files (visually), you can also look to a plugin from AutoCAD (described >>>here<<<) to get some ideas.

 

Good luck, - alfred -

 

 

Edited by
Discussion_Admin

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2026
------------------------------------------------------------------------------------

(not an Autodesk consultant)
Message 3 of 16

Anonymous
Not applicable

Thanksfor your reply.

 

I have gone through the points as mentioned by you.

 

Ok..The comparator that I want to make would be same as Design Review.

 

Why I want to make because in Design Review I can compare only two drawings at one time if I am not wrong.

 

But I want to comapre two folders means bunch of drawings if possible. If you know the tool available in the market which is free then let me know.

 

The comparison dependns on the following points :

 

Note: base.dwg & validate.dwg file both are same but in case I move the line from the validate.dwg then it will show the difference.

 

1. In base.dwg file if line drawn at points (10,10,0) & (20,10,0) and in validate.dwg file line drawn at points (15,15,0) & (25,15,0) then it is different.

 

2. In base.dwg one text(same position) contains "test" and in validate.dwg  text(same position) contains "test123" then it is different.

 

3. In base.dwg one block (same position) has attribute name : ATT1 & value : valATT1 and in validate.dwg  block(same position) has attribute name : ATT1 & value : valATT1 then it is different

 

Note: When I am going to comapre two block then it's name shoud be same while showing the difference.

 

0 Likes
Message 4 of 16

Anonymous
Not applicable

Hi,

 

I'm also in your boat.

 

Using VB.net with AutoCAD 2012/2013

 

currently i'm doing project for compare drawings.

Did you finish project?

 

Please share some sourcecode or ideas/suggestion.

 

Thanks in advance,

thenndral

0 Likes
Message 5 of 16

jeff
Collaborator
Collaborator
0 Likes
Message 6 of 16

Anonymous
Not applicable

Hello,

 

Thanks so much.

It's a nice plug-in.

 

I need the same process with some other customization.

Is it possible to do some customization like insert block in wrong/mistaken place.

 

Do you have any idea which language/application is used to create this plug-in?

If I have this source[open-source] it would be a great time saver for me.

 

Please let me know regarding customization using this plug-in.

 

Thanks in advance,

thenndral

0 Likes
Message 7 of 16

jeff
Collaborator
Collaborator

Paste below path in windows explorer and should be there

 

%appdata%\Autodesk\ApplicationPlugins

 

You can also find your answers @ TheSwamp
0 Likes
Message 8 of 16

Anonymous
Not applicable

Hi,

 

Thanks for your reply.

 

I'm sorry. I can't able to find the source code of dwgcompare, folder contains dll file.

 

I need to modify some thing in the source code as per my requirement, if the source code available I can modify  based on my own requirement. I guess source code will not available.If source code available I'm very happy to modify as per my task.

 

Thanks in advance,

thenndral

0 Likes
Message 9 of 16

jeff
Collaborator
Collaborator

If not there then should be

C:\Program Files\Autodesk\ApplicationPlugins

You can also find your answers @ TheSwamp
0 Likes
Message 10 of 16

Anonymous
Not applicable

Hello,

 

Thanks a lot for your reply and helping me.

 

I found the DLL in "C:\ProgramData\Autodesk\ApplicationPlugins"

 

In this folder I can find

a. XML Files

b. DLL

c. ARX

d.cuix

e.mnr

 

If I want to modify as per my requirement need source code, but here I can Find all the above file format.

Could you tell me how can I find soruce code to customize my requirements?

[ex: change color or insert block]

 

For reference I add folder images:

1.XML Files                                                                       2.ARX File

dimension.png                         01.png  

3.cuix file:

.02.png

 

Thanks in advance,

thenndral

0 Likes
Message 11 of 16

jeff
Collaborator
Collaborator

Doh!

 

Arx file.

 

Maybe one of those great ADN guys could release source.

You can also find your answers @ TheSwamp
0 Likes
Message 12 of 16

Anonymous
Not applicable

Hello,

 

Thanks for your reply.

 

I hope too, someone will help in this.

Anyone have experience how to use the DWGCompare XML [ AutoCAD with vb.net]

 

Download Link: DWG Compare

 

Thanks in advance,

thenndral

 

0 Likes
Message 13 of 16

BKSpurgeon
Collaborator
Collaborator

Hi folks and Alfred,

 

 

Some questions: regarding the comparing of drawings and some suggested slutions:

 

> Solution a: [if]....drawings are fully identical in database ==> scan through the database and compare each item.

 

Would anyone be able to elaborate on this point? Or point folks in the right direction with respect to this: are there any links or posts?

 

> Solution b) [if].... drawings were modified from the same source drawing: you might use the handle as identifier to find matching entities in both drawings...

 

Suppose I have two drawings - the second being a cut and paste of the first - will the second drawing share the same handle as the first? 

 

posterity and i thank you in advance. seems like a problem that many people have to deal with.

 

regards

 

BK

0 Likes
Message 14 of 16

Alfred.NESWADBA
Consultant
Consultant

Hi,

 

>> Would anyone be able to elaborate on this point? Or point folks in the right direction with respect to this: are there any links or posts?

It should be possible in that case to scan the full database handle by handle and compare the properties for each object (using reflection). Reflection could be slow as there are a lot of properties not needed to compare (and also some which have to be ignored), but on the other side this makes it possible to compare items without having to go into details of every single object type (as long as the object is the same type in both drawings).

 

>> Suppose I have two drawings - the second being a cut and paste of the first - will the second drawing share the same handle as the first? 

No, the handle is created as for new objects.

Simple reason: if you copy an element with handle "&h100" to a drawing where this handle already exists ... 😉

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2026
------------------------------------------------------------------------------------

(not an Autodesk consultant)
Message 15 of 16

BKSpurgeon
Collaborator
Collaborator

Hello

 

>>>> Would anyone be able to elaborate on this point? Or point folks in the right direction with respect to this: are there any links or posts?

>>It should be possible in that case to scan the full database handle by handle and compare the properties for each object (using reflection). Reflection could be slow as there are a lot of properties not needed to compare (and also some which have to be ignored), but on the other side this makes it possible to compare items without having to go into details of every single object type (as long as the object is the same type in both drawings).

 

So as I understand it, the handles are unique to all entities? So the only way we would know if two entities are equal is to compare the properties of those entities, and not the handle - because comparing the handles of two entities is not a good way to determine if they are equal? am i following this correctly?

 

 

0 Likes
Message 16 of 16

Alfred.NESWADBA
Consultant
Consultant

Hi,

 

>> So as I understand it, the handles are unique to all entities?

Yes, within one drawing, it's like a drawing-database internal ID.

 

>> So the only way we would know if two entities are equal is to compare

>> the properties of those entities, and not the handle

Well, I was assuming that this type of comparision (using the handle to identify "same" objects) only works if the drawings have the same source/the DWG-file was copied and then modified.

In that case you can scan through handles, e.g. select object with handle &h1000 in DWG1 and the object with handle &h1000 in DWG2, if they exist in both drawings then first compare if they are from same object type and if yes then compare the properties of them.

 

- alfred -

 

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2026
------------------------------------------------------------------------------------

(not an Autodesk consultant)