4 Replies Latest reply on Sep 18, 2014 10:53 PM by James Cloud

    compare two drawings to show the difference

    James Cloud

      hi I have a project to compare two drawings document, to show the difference in the annotations and the bom table, I am going to use vb.net, any ideas how to start this project ! what kind of functions I need to use...

      No pdm or solidworks utilities is allowed in this project

        • Re: compare two drawings to show the difference
          Daniel Andersson

          Hello James,

          Welcome to the SolidWorks forum.

          I'm a happy amateur in vb.net and not that skilled. There is some application designers lurking around the forums. Hopefully they can provide more feedback than me.

          I will share my thoughts about this, but please keep in mind that I'm not a professional coder. How experienced are you in vb.net and how well are you oriented in SolidWorks?

          Basically without knowing that much about the requirements you have in the project. I would start to try with a setup like this.

          Please note that this is just my thoughts just in front of the screen... there might be downsides with my thoughts... anyone please feel free to comment.

          1) Collect data

          2) Analyze data

          3) Present results

          1) Collect data

          I would not limit the project cover two drawings, I would keep an more open mind to it. If you use classes and collections you could write and application that could handle (almost..) a unlimited number of drawings. Using classes will also make it easier to expand the application in the future. And since I'm a amateur I can share you thing I discovered that some might laugh about.. Do not use user-interfaces (listviews etc) to store data and process data with. It is easier if you keep it in classes and collections. Then you can choose how to present the results quite easy. To text  file, to excel, to a windows form etc etc. Perhaps there is other opinions out there, but I found it easier to do all coding, functions etc in a way so they can be re-used easily.

          To collect data you have to dig into the API of SolidWorks. Here is a link to the SolidWorks 2012 API reference.

          There is a number of "annotations" (Revision annotations, table annotations, text annotations etc.) so I think it is important that you get clear about (at least with the one that have requested this application) what kind of annotations that should be compared and also how.

          The BOM tables can also be quite easy accessed with API. But it is important that you think about how to handle configurations if there are any ones that could come up. There is quite much about this in the forum but mostly for VBA. However it might give you some input to search the forum for how to access the BOM tables and thier data.

          I think the BOM tables can be accessed with Document Manager, not sure about annotations... this is something that you need to find out if you will build a stand-alone application. Then the Document Manager is a must.

          2) Analyze data

          How should the comparison be made. With one drawing as reference or should the comparison be made from each drawing as reference?

          How should the annotations be compared?

          How should the BOMs be compared? (E.g All data or just part number and qty... should the balloon number be included as well.?)

          3) Present data

          Get clear with the person that needs the output. Should it be text file, csv, excel, or populated listview?

          Should there be any functions in the user interface except to compare drawings? (Open/Close/Update drawing/Print/Export result  etc etc...)

          With point 1 and 2 clear, I would start to think about how to build the classes and collections. Point 3 do influence as well but I think the main thing would be to set it up for 1 and 2.

          Make sure that you use an SolidWorks API reference to a SolidWorks version that will be used. So you do not end up trying to use API functions that is not available.



          I hope that this what some useful input for you. To summarize all of above. Get clear of what should be compared, how it should be compared, and how it should be presented.

          Think multiple times about how you build the classes and collections. I find it to be a bit of an iterative process in order to get things to a acceptable level.


          // Daniel

          1 person found this helpful