Shape vertical numbering

B

ben h

Hello!

Background to the issue:

Set of shapes on drawing, stacked like boxes down (or up depending on
your viewpoint) the page. The shapes contain text, and that is all that
there is. The master on the stencil is called "JobText".

There will only ever be one column of stacked text boxes, and I want to
insert a field into the text to number them down the page:

1. foo
2. bar
3. fubar
4. figjam
etc so that whenever I re-arrange them, the numbers calculate the
correct order:

1. bar
2. foo
etc...

I would prefer to do this as a formula in the shapesheet of the master,
any ideas how i can solve this?

Thanks in advance!! It will make me very happy!

Ben
 
M

Mark Nelson [MS]

Without writing code there is not much you can do here. Shapes have no idea
how they relate to one another, so a shape would not know what index in the
order it was. Perhaps you could rely on the page coordinates. For example,
a shape with a PinY value of 9.5 inches could display that value in a text
field. If you want integers, then add a multiplier to the display value or
add a rounding function.
 
B

ben h

Mark said:
Without writing code there is not much you can do here. Shapes have no idea
how they relate to one another, so a shape would not know what index in the
order it was. Perhaps you could rely on the page coordinates. For example,
a shape with a PinY value of 9.5 inches could display that value in a text
field. If you want integers, then add a multiplier to the display value or
add a rounding function.

I am thinking about a hidden or invisible background grid of shapes,
which are already numbered, so that when one of my masters is dropped on
the page, I can check spatial relationship or similar (?), and number
accordingly.
Not sure how to do this, or how to continue numbering on a second page
(i.e. continue numbering from previous page).

Obviously I'd have to make sure my template was used with my stencil.

Think this could be done?

Ben
 
M

Mark Nelson [MS]

At that point you would be writing code, so yes anything is possible.
However, once you are writing code there would be no need for such an
elaborate scheme. Just iterate through the shapes on each page, noting
their PinY coordinate, then sort your list and number the shapes.
 
J

John Marshall, MVP

This can be done using just shapesheet formulas. Create a special shape for
the number and then group it with the shape you want to use.

1) Create a square shape and set it's text to something.
2) open it's Shapesheet.
3) In the line Foramt section, set the line pattern to 0. - This will create
a shape that just contains text with no surrounding box.
4) Add a section for "User defined cells". You could change the name of the
first row to something more appropriate, but it is not necssecary.
5) Set the Value of the field to "=INT((ThePage!PageHeight-PinY)*2)+1". This
will set the value of the user defined cell to be a number equivalent to the
number of half inches from the top of the page. You can change the "*2" to
"*4" to get it every quarter inch.
6) Close the shapesheet and select the text within the square.
7) From the Insert menu, choose "Field..."
8) Selct "User Defined Cells" from the category
9) Select the name of the row you created from the Field

You now have a shape that show a number based on the distance from the top
of the page. You can then group this with other shapes.

John... Visio MVP

Need stencils or ideas? http://www.mvps.org/visio/3rdparty.htm
Need VBA examples? http://www.mvps.org/visio/VBA.htm
Common Visio Questions http://www.mvps.org/visio/common_questions.htm
Visio Wishlist http://www.mvps.org/visio/wish_list.htm
 

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