Using Bound function to restrict text control handle on a 1D shape

B

Bryant

I have been attempting to restrict the movement of the text block on a
1D connector shape to stay only within the shapes geometry
(specifically, only staying on the line) utilizing Bound formulas in
the Controls section of the shapesheet...to no avail. The main problem
I see with this appoach is that connectors can have many geometry
points to consider when trying to constrain the text to only stay on
the line. The goal is to create a formula(s) that can bind the text /
Control to only the shapes 1D geometry wheather that line is straight
or has numerous curves. Any suggestions would be greatly appreciated!
 
C

Chris Roth [MVP]

Bryant,

Since the connector change, um, er...Dynamically...you'd have to have some
sort of code, be it VBA, COM-Add-in, or .vsl , backing up your shape. With
pure ShapeSheet-ing, I think it would be very impractical (if not
impossible) to generate the correct formulas. You could always try to make
formulas that accoutn for up to 10 legs, and assume that the legs are all at
right angles, or linear to simplify the calculation.

In order to check if a geometry section exists, you can do some hacking and
put in forumulas like:

=ISERR(INDEX(0,"Geometry15.x1")+0)

=ISERR(INDEX(0,"Geometry16.x1")+0)

By wrapping the cell reference in quotes, you protect yourself from getting
an invalid ShapeSheet formula upon entry. Adding + 0 forces Visio to try to
make sense of the expression. Visio will try to evaluate the text in a
ShapeSheet context first (ie: numbers, units, or cell-references) So if
"Geometry15.X1" actually exists, you will get False for ISERR, and you know
that you can do calculations with that cell.

It's very awkward and cumbersome, in my opinion...


--
Hope this helps,

Chris Roth
Visio MVP

Free Visio shapes:
http://www.visguy.com/category/shapes
Visio programming info:
http://www.visguy.com/category/programming/
Other Visio resources:
http://www.visguy.com/visio-links/
 
B

Bryant

Bryant,

Since the connector change, um, er...Dynamically...you'd have to have some
sort of code, be it VBA, COM-Add-in, or .vsl , backing up your shape. With
pure ShapeSheet-ing, I think it would be very impractical (if not
impossible) to generate the correct formulas. You could always try to make
formulas that accoutn for up to 10 legs, and assume that the legs are all at
right angles, or linear to simplify the calculation.

In order to check if a geometry section exists, you can do some hacking and
put in forumulas like:

=ISERR(INDEX(0,"Geometry15.x1")+0)

=ISERR(INDEX(0,"Geometry16.x1")+0)

By wrapping the cell reference in quotes, you protect yourself from getting
an invalid ShapeSheet formula upon entry. Adding + 0 forces Visio to try to
make sense of the expression. Visio will try to evaluate the text in a
ShapeSheet context first (ie: numbers, units, or cell-references) So if
"Geometry15.X1" actually exists, you will get False for ISERR, and you know
that you can do calculations with that cell.

It's very awkward and cumbersome, in my opinion...

--
Hope this helps,

Chris Roth
Visio MVP

Free Visio shapes:
http://www.visguy.com/category/shapes
Visio programming info:
http://www.visguy.com/category/programming/
Other Visio resources:
http://www.visguy.com/visio-links/






- Show quoted text -

Chris,

Thanks for the very valuable insight! I was afraid someone was going
to tell me that the solution wasn't going to be that easy. I seem to
have a knack
for wanting certain fuctionality that lies just outside of immediate
reach. I will attempt your
suggestion and post any resulting success. Thanks again!

-Bryant
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top