Author Topic: Here is a new one: "REL" is not accurate RE Visio 2013  (Read 760 times)

0 Members and 1 Guest are viewing this topic.

vojo

  • Hero Member
  • *****
  • Posts: 1035
Here is a new one: "REL" is not accurate RE Visio 2013
« on: December 27, 2016, 08:19:34 PM »
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.

Croc

  • Full Member
  • ***
  • Posts: 113
Re: Here is a new one: "REL" is not accurate RE Visio 2013
« Reply #1 on: December 28, 2016, 01:30:27 AM »
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?
« Last Edit: December 28, 2016, 01:36:08 AM by Croc »

Nikolay

  • Hero Member
  • *****
  • Posts: 644
    • UnmanagedVisio
Re: Here is a new one: "REL" is not accurate RE Visio 2013
« Reply #2 on: December 28, 2016, 02:38:59 AM »
+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?

vojo

  • Hero Member
  • *****
  • Posts: 1035
Re: Here is a new one: "REL" is not accurate RE Visio 2013
« Reply #3 on: December 28, 2016, 05:45:43 PM »
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 novices...no list of rows, cells, function even in developer mode....got 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.

JuneTheSecond

  • Hero Member
  • *****
  • Posts: 996
    • Visio Shapes, Stencils and Sample Drawings
Re: Here is a new one: "REL" is not accurate RE Visio 2013
« Reply #4 on: December 28, 2016, 09:18:40 PM »
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.
 
Code: [Select]

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



« Last Edit: December 29, 2016, 02:16:53 AM by JuneTheSecond »
Best Regards,

Junichi Yoda
http://june.minibird.jp/

vojo

  • Hero Member
  • *****
  • Posts: 1035
Re: Here is a new one: "REL" is not accurate RE Visio 2013
« Reply #5 on: December 29, 2016, 03:26:16 PM »
thanks June...

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