BB code in posts seems to be working again!
I haven't turned on every single tag, so please let me know if there are any that are used/needed but not activated.

Main Menu

Cable Length PATHLENGTH Changing Unexpectedly

Started by vorax, August 22, 2019, 02:40:34 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.


Hello everyone!

First of all, thanks a lot to Visio Guy! I learnt a lot from your website!

So, I'm an IT technician in a small business where we manage infrastructure moves from our clients to Datacenters. I recently discovered the use of Visio to create layouts in order to estimate the length of the future cables that will be installed in the Datacenters.

I found the very helpful post Simple Cabling Shape with Length Reporting and was able to create dynamic cables which show their length as well as their source and destination devices and then I create reports from visio to process that data with Excel.

Here is my issue:
The formula that I use to show the length for the cable going to the same face of the rack is :
FORMAT(0 m+PATHLENGTH(Geometry1.Path),"0.00u")
and for the cables going from to the other side of the rack :
FORMAT(1 m+PATHLENGTH(Geometry1.Path),"0.00u")

This formula is added in the .Format and .Value of a "Length" section in the Shape Data in each of my cables (It's actually directly in each master's shape data, because I've got one master per cable type).

So, it works very well BUT everytime I close the file and reopen it, all the lengths (or sometimes just a part of it) are wrong. For instance, instead of a 1.40m cable, it changed to 0.03m. From what I can see, each cable's length become randomly less than 0.10m, but never above that.

Does anyone have an idea? I searched on the forum, but didn't find anything similar..

Thanks !


Can you post an example of such a document? Let it be at least a small fragment with the behavior described above.

Visio Guy

Hi Guys,

I've made a very simple test case in Visio 2019/Office 365. I can't reproduce the bug.

Which version of Visio are we talking about, and does the attached file have the problem?

Note: before saving, I write in a text block the last value that was displayed on the cable shape, so it is easy to tell if something goes wrong.
For articles, tips and free content, see the Visio Guy Website at
Get my Visio Book! Using Microsoft Visio 2010


Hey guys, thanks for the answers!

My version is Visio 2016 (16.0.4266.1001) 64 bits

So, I tried with your file and I can't reproduce the bug either..

But, I spent some time doing other tests on my file and it seems like it only occurs when :
- 1 : A cable crosses the path of an other one. Then, the one which does the little bridge over the other gets the bug.
- 2 : Too many items are placed in the drawing (?) Couldn't verify that because it really seems random.. I don't understand the logic behind it, it's a real puzzle

I don't know if I'm clear, so you can see for yourself with my file. I tried to reduce its size to less than 500ko, but I couldn't, so here is a link to it :

Also, the thing with the cable's lengths becoming randomly less than 0.10m and not higher, seems to be wrong. It can be higher than 0.10m, but it still looks random.


Downloaded your file.  Seems to work fine.  No "bug".  Using V2019 64B on Win10 64B.
Visio 2019 Pro


Well, I tried with the 2019 version and the bug isn't there indeed...

So weird. Thank you all for your answers anyway ;)


The source of the error is the FORMAT () function.
There is a suspicion that the error is related to the choice of the locale and the way the units are converted from IU to "m".
Locale 5129 is different from 1033.
I would recommend trying to change the settings as follows:
set for Prop.Lng locale 1033
formula in the field Value = Prop.Lng.Format
the formula in the field Format = FORMAT ("0 m" + PATHLENGTH (Geometry1.Path), "0.00u") with quotation marks!
This must be checked on the computer where the error occurs. I can't check, because on my computer in Visio 2013 an error only appears when I open the file for the first time. After a simple rewrite of the formula, the error disappears and no longer appears.
(These are recommendations for the RJ45 Front-Front.225 master.)


It is possible that the above recommendations are also unreliable, since the greatest influence is exerted by the inheritance of formulas from the master and it is necessary to fight against this reason.
In this case, a good way to fix the file is to run a macro that translates the formulas into local ones:
Sub ttt()
    For Each shp In ActivePage.Shapes
        If Left(shp.Name, 16) = "RJ45 Front-Front" Then
            shp.Cells("Prop.Lng.Format").FormulaU = shp.Cells("Prop.Lng.Format").FormulaU
            shp.Cells("Prop.Lng").FormulaU = shp.Cells("Prop.Lng").FormulaU
        End If
End Sub


The minimum material for those wishing to study the problem is posted in
The li.gif file demonstrates the process of getting the error
The NewPrototipe.vsdx file is a minimal prototype.
The li.gif file was obtained using Visio 2013.
Attempting to reproduce the error in Visio 2019 was unsuccessful. But if we create a file in Visio 2019, save it and open it in Visio 2013, we will see an error.


That sounds like a bug which finally was corrected. 
Visio 2019 Pro

Browser ID: smf (possibly_robot)
Templates: 4: index (default), Display (default), GenericControls (default), GenericControls (default).
Sub templates: 6: init, html_above, body_above, main, body_below, html_below.
Language files: 4: index+Modifications.english (default), Post.english (default), Editor.english (default), Drafts.english (default).
Style sheets: 4: index.css, attachments.css, jquery.sceditor.css, responsive.css.
Hooks called: 323 (show)
Files included: 34 - 1306KB. (show)
Memory used: 1185KB.
Tokens: post-login.
Cache hits: 13: 0.00119s for 26,766 bytes (show)
Cache misses: 2: (show)
Queries used: 16.

[Show Queries]