Author Topic: Using "Geometry1.Path" in Master Shape, #REF-Error in instance (Visio 2013)  (Read 256 times)

0 Members and 1 Guest are viewing this topic.

TRoessler

  • Newbie
  • *
  • Posts: 4
Hey all,
I try to complete something for almost two weeks now... hope someone here may have some experience already.

Basic Target:
Auto-Position an arbitrary (and flexible) number of connection points around some arbitrary shape - Rectangle, Circle, Cloud … you name it. In any case, we're only talking about one Geometry section.

Idea:
1. Use a User-Defined Cell "ConnectionPoints" holding the total number of connection points to be displayed.
2. Create sufficient number of lines in the Connection Points section
3. Fill coordinates by formula - Example:  =PNTX(POINTALONGPATH(Geometry1.Path,1/User.ConnectionPoints*1)) --- with the last figure being incremented line by line
(the final solution is a bit more complex than that, still this is sufficient to illustrate the problem)

Problem:
Things work fine in the master shape itself. As soon as I create an instance of the shape on a page, each change to the ConnectionPoint-value will make the above formula evaluate to #REF.
I could track this down to Geometry1.Path … this part of the formula is the cause of the problem/error.
Interestingly, "editing" the formula (no change, just press return) thus turning it into a "local" formula does fix the problem.

Any idea how this can be solved?
Maybe I miss some basic concept here?

Thilo

TRoessler

  • Newbie
  • *
  • Posts: 4
Just see that this is most likely the same issue described here:
http://visguy.com/vgforum/index.php?topic=8102.0

So the same behavior exists in Visio 2013 and 2016.

JuneTheSecond

  • Hero Member
  • *****
  • Posts: 1003
    • Visio Shapes, Stencils and Sample Drawings
I cannot get the #REF, I am not sure if I understand fully your problem.
For my more study I thank you, if you supply an example drawing.
I am using Visio 2016 pro for Office 365 only.
Best Regards,

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

TRoessler

  • Newbie
  • *
  • Posts: 4
Thanks for your support :-)

Please find the example attached.
You will see that changing the number in the rectangle-ShapeData will change the position of the Connection Points - just as intended for this simple example.

If you drag the rectangle to a stencil and subsequently create a new instance of the resulting master, you should see that that changing the number in the rectangle-ShapeData results in the connection point coordinate formulas evaluating to #Ref ... at least, this was it does for me.

JuneTheSecond

  • Hero Member
  • *****
  • Posts: 1003
    • Visio Shapes, Stencils and Sample Drawings
Thak you for your example drawing.
But the behavior is somewhat different.
The #REF errors does not appear, I saw the normal inherited formulas.
Instead I saw the strange phenomina happend continuously.
When I increased the value of the cell of "Prop.ConnectionPoints",
the array of connection points did not change at once,
untill I put this shape into Window Stencil and  drop it again on the drawing page.
When I narrowed the width of the shape,
the array of connection points did not act untill I put it to window stencil and drop it on the drawing page.
It can be improved, if you add only one DEPENDSON(Width) at the formula in just Connections.1.X cell. , like
DEPENDSON(Width)+PNTX(POINTALONGPATH(Geometry1.Path,1/User.ConnectionPoints*1)).



« Last Edit: November 12, 2017, 04:54:40 AM by JuneTheSecond »
Best Regards,

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

TRoessler

  • Newbie
  • *
  • Posts: 4
Sorry, my explanation was not clear at that point ... the formulas are still there for me, too. In case you switch to the value-view in the shapesheet rather then the formula-view, you should see the #REF-errors.
I guess the effect you see is part of this problem. Due to the fact that the formulas do not evaluate to new values, the connection points just remain where they are, disregarding the actual dimension of the shape when it is resized.

JuneTheSecond

  • Hero Member
  • *****
  • Posts: 1003
    • Visio Shapes, Stencils and Sample Drawings
Unfortunalely, #REF does not appear.
In any old versions of Visio, I really experienced similar #REF error,
but it is quite normal in Visio 2016 pro for Office 365.
By the way I found the Document.Clean method at
https://msdn.microsoft.com/en-us/VBA/Visio-VBA/articles/document-clean-method-visio
that includes visDocCleanActBadReferences parameter.
It is explained as it detect formulas with #Ref() errors.
It might be worth trying to your #REF errors.

« Last Edit: November 14, 2017, 03:29:22 AM by JuneTheSecond »
Best Regards,

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