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

Here is a new one: "REL" is not accurate RE Visio 2013

Started by vojo, December 28, 2016, 01:19:34 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.


So it turns out that the "REL" geometry cells have a problem with precision

In the attached, a shape I am working on has a vertex (highlighted) that should be 15mm directly "south"
of the predecessor.  However, the grid behind it shows its a bit "east" of where it should be.
(I have been using that grid for 10+ years with no problem - since visio cant do isometric grids)

real nice!!!  does MS even test these "cool" functions before releasing them???
I guess I can add "REL" to the old adage about horseshoes, hand grenades, and nuclear bombs: 
Who needs precision???

The more I play with visio 2013, the more I think MS is marginalizing visio so that it can sunset it soon.


Is Geometry.X3 formula in RelLineTo row correct?
In my opinion it should be interpreted as
Geometry.X3.Value = 25 mm = 0.98 in = 0.98
This is regarded as
Geometry.X3 = Width*0.98
It may be more accurate to write Geometry2.X3 =1 instead Geometry2.X3 =Geometry1.X3?


+1. Good catch. RelLineTo is not the same as LineTo!
Like Croc pointed out, it does not seem to make much sense to add absolute value in mm in a RelLineTo cell formula.
The value in this cell is not in mm - it's a relative value normally ranged from 0 to 1, if I am not mistaken. Just use good old LineTo if you want offset in mm.

Means, as of my understanding, this formula, converted to the "LineTo" notation, seems to read like this: "(Inches(Geometry1.Y3 + 15mm))*Height".
Probably that was not the intent, or?


Croc:  Its a fixed offset off of geometry1. 
          If this was "gee, whatever formula you got, visio would translate to an overall relative" then it should be
          either much longer or somehow much more to the east.   the whole shape is 30mm high by 20 mm wide.
          so scrambling 15 mm should make a big big difference.  I.e it aint 0.98 vs 1.00

Nicolay: That would be fine IF there was a way to set default rows to absolute vs relative
             In other words, I guess one must go into ALL rows before getting started and change to absolute.
             Here's a thought, if visio sees an absolute reference (mm or in), automatically convert to absolute.
             imagine the debug nightmare of the following:
                 loctoloc(pnt(<x>,<y>)) where x, y are absolute values from some if then else tree

With all the problems on visio 2013, it looks like MS is bifurcating users:
- casual, novices, etc = make visio more and more like ppt  (simple drawings).
- intense, experts, etc = push them to other tools since it is still missing a lot for intense users
    - 3d: euler angles vs quadraions (sp) that sketchup uses
    - 3d: only translate geometry points...not control or connection points
    - 3d: translation behaves differently if a group of shapes or a collection of shapes.
    - user preferences:  forcing one to create templates in order to save user settings (e.g. mm vs default in)
    - start screen:  quite the mess...
           could have at least made all the images, fonts 20% smaller & why ask again if want create drawing
    - panel layout:  with format, props, shape dimensions, drawing tree, not much room to draw or debug ss
    - format:  try to transparent (say 50%), visio turns everything to same color
            so loose the detail / got to do 1 by 1
    - props: don't work at top level (ignores doc(1312))..only honors with child shapes
    - themes:  Still don't know what they solve since native visio is not shared with much with the ppt crowd.
    - help: only helps list of rows, cells, function even in developer to use web.
    - shapes:  MS didn't solve the closed loop issue with parametric shapes i.e. closing elliptical arc based on UI
    - I could go on and on...2003 had its quirks, but it was solid....2013 is not
Thanks though for taking a look at the situation.


In relative cells everything must be non-dimensional, so
Geometry.X3 = Geometry.X2 + 25 mm
Geometry.Y3 = Geometry.Y2 + 25 mm
should be
Geometry.X3 = Geometry.X2 + 25 mm/Width
Geometry.Y3 = Geometry.Y2 + 25 mm/Height.

Or, you had better change the cells properties from rel to abs beforehand.
I have some VBA macro to change them mutually.

By the way, the curve fitting function is not supported in Rel cells,
you have to change them to absolute cells in advance.

Option Explicit

Sub Rel2AbsRows()

    Dim shp As Visio.Shape
    Dim Irow As Long
    Dim Nrow As Long
    Dim Igeo As Long
    Dim Ngeo As Long
    Set shp = ActiveWindow.Selection(1)
    Ngeo = shp.GeometryCount - 1
    If Ngeo < 0 Then Exit Sub
    For Igeo = 0 To Ngeo
        Nrow = shp.RowCount(visSectionFirstComponent + Igeo) - 1
        For Irow = 1 To Nrow
            If shp.RowType(visSectionFirstComponent + Igeo, 1) = visTagRelMoveTo Then
                shp.RowType(visSectionFirstComponent + Igeo, 1) = visTagMoveTo
            ElseIf shp.RowType(visSectionFirstComponent + Igeo, Irow) = visTagRelLineTo Then
                shp.RowType(visSectionFirstComponent + Igeo, Irow) = visTagLineTo
            ElseIf shp.RowType(visSectionFirstComponent + Igeo, Irow) = visTagRelEllipticalArcTo Then
                shp.RowType(visSectionFirstComponent + Igeo, Irow) = visTagEllipticalArcTo
            End If
        Next Irow
    Next Igeo

End Sub

Sub AbsRows2Rel()

    Dim shp As Visio.Shape
    Dim Irow As Long
    Dim Nrow As Long
    Dim Igeo As Long
    Dim Ngeo As Long
    Set shp = ActiveWindow.Selection(1)
    Ngeo = shp.GeometryCount - 1
    If Ngeo < 0 Then Exit Sub
    For Igeo = 0 To Ngeo
        Nrow = shp.RowCount(visSectionFirstComponent + Igeo) - 1
        For Irow = 1 To Nrow
            If shp.RowType(visSectionFirstComponent + Igeo, 1) = visTagMoveTo Then
                shp.RowType(visSectionFirstComponent + Igeo, 1) = visTagRelMoveTo
            ElseIf shp.RowType(visSectionFirstComponent + Igeo, Irow) = visTagLineTo Then
                shp.RowType(visSectionFirstComponent + Igeo, Irow) = visTagRelLineTo
            ElseIf shp.RowType(visSectionFirstComponent + Igeo, Irow) = visTagEllipticalArcTo Then
                shp.RowType(visSectionFirstComponent + Igeo, Irow) = visTagRelEllipticalArcTo
            End If
        Next Irow
    Next Igeo

End Sub

Best Regards,

Junichi Yoda


thanks June...

I went back to one of my old shapes that use loctoloc.

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: 248 (show)
Files included: 34 - 1306KB. (show)
Memory used: 1149KB.
Tokens: post-login.
Cache hits: 16: 0.00193s for 26,756 bytes (show)
Cache misses: 6: (show)
Queries used: 17.

[Show Queries]