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

0 Members and 1 Guest are viewing this topic.

#### TRoessler

• Newbie
• Posts: 4
##### Using "Geometry1.Path" in Master Shape, #REF-Error in instance (Visio 2013)
« on: November 10, 2017, 06:32:49 AM »
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
##### Re: Using "Geometry1.Path" in Master Shape, #REF-Error in instance (Visio 2013)
« Reply #1 on: November 10, 2017, 06:55:28 AM »
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: 1018
##### Re: Using "Geometry1.Path" in Master Shape, #REF-Error in instance (Visio 2013)
« Reply #2 on: November 10, 2017, 11:17:01 PM »
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
##### Re: Using "Geometry1.Path" in Master Shape, #REF-Error in instance (Visio 2013)
« Reply #3 on: November 11, 2017, 06:10:53 AM »

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: 1018
##### Re: Using "Geometry1.Path" in Master Shape, #REF-Error in instance (Visio 2013)
« Reply #4 on: November 11, 2017, 11:08:21 PM »
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
##### Re: Using "Geometry1.Path" in Master Shape, #REF-Error in instance (Visio 2013)
« Reply #5 on: November 13, 2017, 01:17:44 AM »
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: 1018
##### Re: Using "Geometry1.Path" in Master Shape, #REF-Error in instance (Visio 2013)
« Reply #6 on: November 14, 2017, 02:47:39 AM »
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