Constrain Control Handle to Circle

Started by Visio Guy, November 07, 2018, 09:11:18 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Visio Guy

How to do something very useful and rather obscure:

Constrain Control Handle to Circle
For articles, tips and free content, see the Visio Guy Website at
Get my Visio Book! Using Microsoft Visio 2010


Live life with an open mind


So you know what this is evidence of????

MS laziness!!!

With this, they could easily open the door to control point translation into 3D!!!
- use this to put control point function in a user or new controls3D cell
- No or significantly less cell constraints (this works with user cells today)...e.g. circle or ellipse easy enough
- Either transform the base function before pasting...or...let shape designers have more freedom for 3D

Just how tough is it to add rows to the shapesheet based on 2D rows, really!!!!!
(added bunch of other 3D cells)
Same for connection points.

BTW, very nice work on this...never even occurred to me to try something like this!!!!


if anybody wants constrain control handle to an ellipse, then

Assume ellipse is defined by width and height similar to circle.  For example, ellipse defined as  10mm X 6 mm

Then all is needed is to change the user.angle cell

From:   ATAN2(user.CHY-height*0.5, user.CHX-width*0.5)

To :      ATAN2((user.CHY-height*0.5)/height),(user.CHX-width*0.5)/width))



So to reveiew
- Visio guy constrained a control handle for a circle
- I extended to an ellipsis
- Here for an elliptical arc

Using the nice tutorial from visio guy, here is how to constrain and elliptical arc

Just need to change the controls.pntperimenter.y

From     setatref(user.chy,setatrefexpr(),true)+pnt(x,y)

To         setatref(user.chy,setatrefeval(bound(setatrefexpr(),0, false, height*0.5, height*1),true) + pnt(x,y)

The bound function essentially locks the controls to upper half of the ellipse.
In all cases - circle, ellipsis, elliptical arc - the rest of visio guys tutorial applies
I suspect you can do the same on controls.pntperimeter to constrain the x dimension 
(maybe constrain a "slice of pie" in both X and Y axis).)

I would proffer that one can now constrain any simple curve.



Uh, did I miss something?

Visio Guys article was about moving a control point on a shape.  It looks more like your control points allow the user to change the shape.  What you did is nice development, but, I'm confused--not what I was expecting.


Visio 2019 Pro


The article was about constraining a control point in a circle no so much I have a given shape and want to move around the edge.  Control point around a circle gets complicated (dependence between X and Y...yet maintain the radius).

All I did was figure out how to extend to a ellipsis and how to bound for an elliptic arc.
(original article only worked on perfect circle).

What people choose to do with it is up them
(some sort of curve fitting around as given shape or user control of some curve creation).

I guess all I am saying is that I was impressed with myself on figuring out changes
- Modifying the angles (for ellipsis)...had to search and find a pretty obscure article about translating angles in an ellipsis
- Bound a control point in a Setatref statement (arc)....more experimentation with all the setat*** functions.

Apologies if this seems pedantic.