how to reference last X or Y value of geometry

H

Harry79880

Hi,
generally I know how to reference a x or y value of a point in the geometry
section.

Geometryi.Xj
where i and j = <1>, 2, 3

But now I need a way to reference always the last X and Y values of the
Geometry section as I want to display a letter always next to the last point
of a (connector) line. The problem is that the count of entries in the
Geometry section changes, when the line gets bended due to shifting the
source object.

Is there a way like "Geometry1.XLast" or something like that?

Regards,
Harry
 
J

JuneTheSecond

My idea is to use EventXFMod cell.
Put a formula like CALLTHIS("test",) in EventXFMod cell.
and make any macro like this.
But this macro is just a toy.
You can make your fine macro.

Option Explicit

Private KeepX(100) As Double
Private I As Long

Sub test(shp As Visio.Shape)
I = I + 1
KeepX(I) = shp.Cells("PinX").Result("mm")
shp.Text = KeepX(I - 1)
If I = 100 Then
I = 0
End If
End Sub
 
V

vojo

you can use setatexpr in the last row of geometry.

in geometry1.x<n> = setatref(props.myrefx,setatrefexpr(<equation for this x>))
in geometry1.y<n> = setatref(props.myrefy, setatrefexpr(<equation for this
y>))

props.myrefx and props.myrefy can be hidden so dont show up or can shown as
needed (ie drop down to state where exactly the test field is located)

use the props.myrefx, props.myrefy in text transform to locate/rotate/etc
the text block (or if a group, use to set text shape within group).

Look at function referernce for exact format.
As usual ; crawl, walk, run....debug slowly....get the value to show up in
props...then use to set the text

Some thing
 
C

Chris Roth [Visio MVP]

Hi Harry,

David Parker came up with a method for counting Geometry sections via
ShapeSheet formulas. I discuss it in an article on my site:

http://www.visguy.com/2006/10/04/counting-geometry-sections/

You might be able to adapt the technique to counting rows. I think the
commenters have discussed this at the end of the article. If memory
serves it worked, but they had trouble getting it to update when the row
count changed. I can't remember exactly, but have a look!

--
Hope this helps,

Chris Roth
Visio MVP


Register for the 2008 Microsoft Office Visio Conference!
http://www.msvisioconference.com/

Visio Guy: Smart Graphics for Visual People
http://www.visguy.com
 

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