Visio Guy

Visio Guy Website & General Stuff => User-submitted Stuff => Topic started by: Thomas Winkel on April 22, 2018, 08:31:31 PM

Title: Visio Diff Tool
Post by: Thomas Winkel on April 22, 2018, 08:31:31 PM
Hi,

for my project I created a Diff tool that can compare two documents.
The result is an Excel list with all modifications.
A mouse click on a row will show the modification directly in the Visio documents that should be placed on two monitors.

Currently the following modifications will be detected:
* Shape added
* Shape removed
* Property added
* Property removed
* Property modified

Sometimes I have crashes with openex(). Maybe someone can help?
I'm sure there are more bugs. Please report.

You can checkout the project with SVN here:
https://geradeaus.plan.io/svn/wit.wit

Or browse the documents here:
https://geradeaus.plan.io/projects/wit/repository

Or download as ZIP:
https://geradeaus.plan.io/projects/wit/files

In order to use it, just load: /Visio/Stencils/wit/wit_M.vssm
Or, in Visio 2010: /Visio2010/Stencils/wit/wit_M.vss
You need the complete folder structure, otherwise it will not work.

I hope the usability is self-explanatory. Otherwise please give feedback.

Video:
https://youtu.be/Qd2guUH4vOE (https://youtu.be/Qd2guUH4vOE)

Best regards,
Thomas
Title: Re: Visio Diff Tool
Post by: vojo on April 22, 2018, 10:13:36 PM
good start

unless you intend this for simple drawings, I think you should consider
- shape name added at pinx and piny
- shape name deleted at pinx and piny
- prop added to shape name at pinx and piny
- prop removed to shape name at pinx and piny
- prop modified (maybe the field title) to shape name at pinx and piny
- Format modified to shape name at pinx and piny

unless simple drawing, you should consider this because
- pinx and piny will give you location on the sheet
     - I bet a sheet with more than 10 shapes, it will be tough to find what changed
- shape name will give specific shape (group or container or not).
     - Groups can contain many subshapes....so precision is even more important

I realize this is lots of work, but may be needed...otherwise, could visually compare the docs to see differences
(what you are starting to do is to "overcome" the brains efforts to gloss over detail to get the big picture).

just a thought

imagine comparing left and right....they are different
Title: Re: Visio Diff Tool
Post by: Thomas Winkel on April 24, 2018, 08:20:54 PM
Thanks for the feedback, vojo.

I'm not sure if I really got your point with shape name and PinX/Y.
I use shape.NameID to identify if a shape is new, deleted or still there (then I compare).
This could be a problem if shapes are deleted and then new shapes of the same type are added on a page because free IDs will be reused.
First I used shape.ID. But then this problem is so much the worse.

We use this feature to compare different versions of electric schematics.
So we usually are not interested if shapes are moved on a page because such rearrangements are usual (for cleanup / better overview), but will not affect the functionality.
We are interested if settings, signal names, IO channels or wiring was modified.

Anyhow, it's no problem to compare PinX/Y for shapes with identical NameID and add it to the list if it was moved.
If a user is not interested he could use the filter to hide entries with Category="Position".
Is this what you mean?

But first I would like to use this feature in practice before I enhance it.
The problem: At the moment it crashes with many of our documents on OpenEx() without debug message.
I fear this is a MS bug that I cannot control...

BR,
Thomas
Title: Re: Visio Diff Tool
Post by: vojo on April 25, 2018, 12:59:47 AM
so what is the plan if I
A) move a shape (resistor) 5mm east...would tool catch that?
B) assume you are creative, and I change the band colors on the resistor to indicate 10K vs 5K...would user know via tool?
    (if text only, what if I change the text to say 5K)
C) assume fairly busy schematic, how do I tell user that resistor added in NW quadrant or 100mm X 150mm location?

pinx  and piny indicate the position the shape resides on the page.

just some thoughts
Title: Re: Visio Diff Tool
Post by: metuemre on April 25, 2018, 09:52:57 AM
Nice tool, thanks. You can also consider putting revision clouds around the shapes that are different. In my application I used visguy's revision bubbles.http://www.visguy.com/2006/11/04/bubble-revision-shapes/ (http://www.visguy.com/2006/11/04/bubble-revision-shapes/)

Below is a small pic to show how it looks in action. Clouds are created automatically and their geometry depends on the shapes.

Title: Re: Visio Diff Tool
Post by: Thomas Winkel on April 25, 2018, 07:29:03 PM
Hi,

@vojo:
Here is a video that shows our use case:
https://youtu.be/Qd2guUH4vOE (https://youtu.be/Qd2guUH4vOE)
In 1:15 and 1:35 I make some modifications that are irrelevant to track.
But I agree, there are use cases where position tacking makes sense, so I think I will implement it.

@metuemre:
Thanks for the hint with the revision bubbles. I will definitely have a look at it.

@all:
Any idea why the following code crashes without debug mode and message:
Set docOld = Application.Documents.OpenEx(txt, visOpenMinimized + visOpenRO + visOpenMacrosDisabled + visOpenNoWorkspace)
If I replace it like this it works:
Set docOld = Application.Documents.Open(txt)
It does not crash with every document, but I cannot find a correlation.
Title: Re: Visio Diff Tool
Post by: Yacine on April 25, 2018, 09:09:00 PM
Quote from: Thomas Winkel on April 25, 2018, 07:29:03 PM
Any idea why the following code crashes without debug mode and message:
Set docOld = Application.Documents.OpenEx(txt, visOpenMinimized + visOpenRO + visOpenMacrosDisabled + visOpenNoWorkspace)
I guess you have already tried combinations of the options?
You may also check for their values, you could have misspelled the one or the other option, so the value is wrong (debug.print visOpenRo, ...)

BTW, your video is not showing. Did something go wrong?
Title: Re: Visio Diff Tool
Post by: Nikolay on April 25, 2018, 11:24:07 PM
Interesting  :)

Dear Thomas, is video working?
I don't see anything but one big gray exclamation mark.. Or is it limited to Germany maybe?

Also, how can one download the tool? All the files should be downloaded one-by-one and then the folder structure re-created, or?
Like some Lithuanians were importing cars once to avoid taxes - they first cut them into pieces on the one side of the border,
then imported as "spare parts", and then assembled them back on the other side of the border? :D

About the crash - not sure what is causing it. Probably this is a bug.
As a workaround, you could try starting another (invisible) Visio instance, and opening the file there.
Other than that, you could try visOpenCopy (to not break if the file is opened elsewhere)
Title: Re: Visio Diff Tool
Post by: Thomas Winkel on April 26, 2018, 04:31:58 AM
Good morning,

Video was set to private, please check again:
https://youtu.be/Qd2guUH4vOE (https://youtu.be/Qd2guUH4vOE)

This is a SVN link:
https://geradeaus.plan.io/svn/wit.wit
You can check out the complete project with a tool like TortoiseSVN:
https://tortoisesvn.net (https://tortoisesvn.net)
I will provide a ZIP file later.

Thanks for the hints, I'll check later.
Title: Re: Visio Diff Tool
Post by: Thomas Winkel on April 26, 2018, 05:46:07 PM
Here is the ZIP file:
https://geradeaus.plan.io/projects/wit/files

@Yacine:
Yes, I tried with different (or even no) option.
Always the same, some documents work, others not.
We work with Visio 2010, but I develop with 2016.
This increases the test cases...

Quote from: Nikolay on April 25, 2018, 11:24:07 PM
About the crash - not sure what is causing it. Probably this is a bug.
As a workaround, you could try starting another (invisible) Visio instance, and opening the file there.
Other than that, you could try visOpenCopy (to not break if the file is opened elsewhere)
I make both:
First open in the same application to do the comparison.
Then I close the document and reopen in a new application so that it can be placed on another monitor.
This proceeding (do the comparison in the same application) increases the speed around factor 10.
Title: Re: Visio Diff Tool
Post by: tinhtruong192 on August 10, 2019, 05:21:19 PM
Hi Thomas

I cannot download this file. I want to use your tools. Please help me
Title: Re: Visio Diff Tool
Post by: Thomas Winkel on August 12, 2019, 02:55:12 PM
Hi,

the SVN repository above is not accessible at the moment.
So I pushed the project to GitHub:
https://github.com/ThomasWinkel/VisioToolsVBA

Click the green download button on the right to download a ZIP file (or clone via Git).