control points

Started by david, September 08, 2009, 12:35:57 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

david

i have a question about control points.

i built a polygon which has control points in its vertexes.  it works fine.  when you drag a control point, the shape is redrawn and the coordinates are updated accordingly.

the problem is when the height of the polygon is zero.  in that case, when you try to drag a control point and to make it back a two-dimensional shape, an error message appears.  also when the height is zero, you cannot change the y-coordinate in the custom properties (which worked fine when height>0).  this is a problem in visio.  very irritating for me since i used the same implementation in polyline, and sometimes i need a horizontal line (height=0) and in this case i can't drag a control point and make it a diagonal line.

anyone knows how to fix it?

thanks
David

Paul Herber

What are the formulae you use in the geometry section etc. Sounds to me like you are doing a divide-by-zero or multiply-by-infinity or similar.

Electronic and Electrical engineering, business and software stencils for Visio -

https://www.paulherber.co.uk/

david

hi Paul,
in the geometry section i just put what is written in the control point (since it's the same point).  i don't use formulas there.

besides, the error i get is before any calculation i do.  i put a control point before all my calculations and the window still appeared.
i couldn't debug it to see what causes the error.

anyway here's the exact error appears in this case:

Visio internal error: #2912
Action 1267: Modify Control
First try closing and reopening the file.  Next try restarting Visio.

how could that be if it hasn't started my calculations?

Paul Herber

OK, would you like to post a stencil containing the shape? Just add an attachment using the Additional Options ...

Electronic and Electrical engineering, business and software stencils for Visio -

https://www.paulherber.co.uk/

Visio Guy

A geometry vertex needs to follow a control handle around. You don't need to necessarily add formulas to the control handle cells, just to the geometry.

So for example:

Controls.Row_1  X = Width*0.5,              Y = Height * 0.5
Geometry1.       X2 = Controls.Row_1,      Y2 = Controls.Row_1.Y
For articles, tips and free content, see the Visio Guy Website at http://www.visguy.com
Get my Visio Book! Using Microsoft Visio 2010

wapperdude

Hi David!

Is this along the lines of the "triangles" that you worked on awhile back?  I was reviewing that, and there doesn't seem to be anything that should be contributing to this problem.  At least for the triangle development, the geometry stuff was instantiated as per VisioGuy's suggestions, so, I'm with Paul, perhaps if we could look at the problem shape.

Wapperdude.
Visio 2019 Pro

david

ok i'm sending to you the stencil.
but you won't be able to do anything with it since the code with the implementations of the events is much too big to send here.
so of course you won't see the error message.

but if you can still find the problem by the stencil alone that'll be great!
notice that the polyline is actually a group.

thanks
David

Paul Herber

Well, nothing works with the shape, not even the control points, are you sure the full shape is too big? You can attach 1/2 a MB of file, a zipped Visio stencil shouldn't be that big!

Electronic and Electrical engineering, business and software stencils for Visio -

https://www.paulherber.co.uk/

david

what do you mean the full shape?
i have 2 files.  the VSS file (stencil) and the VSD file.
i sent you the stencil file (deleted the other shapes).
the code is in the VSD file, which is over 5 MB.
in the VSD file, i recognize whenever you drag a control point (by formulaChanged event) and do some actions accordingly.
without the VSD file, nothing works.  but you told me to send the stencil file so i thought you wanted to see it even though you cannot use the shape.  sorry but i really can't send the VSD file (even if zipped).

for now, we found a temporary (or maybe permanent...) solution.  whenever you change the height of the polyline to 0 we change it by code to 0.001.  then everything works but the line is not really horizontal.  if no other solution will be found, we'll keep it that way.