Shapesheet Geometry Section: Getting Number of the current Section

9 views
Skip to first unread message

Udo Weik

unread,
Jul 7, 2006, 1:04:18 PM7/7/06
to
Hello,

is it possible to determine the number of a Geometry Section
in that Geometry Section itself, e. g. Geometry 1 should result
in 1, Geometry 2 in 2 and so on. I must calculate offsets which
are just depending from the number of the Geometry Section.

Thanks in advance
Udo

JuneTheSecond

unread,
Jul 9, 2006, 5:50:01 PM7/9/06
to
You might get the numger of geometry sections by counting the Cells of NoFill.
Sub test()
Dim shp As Visio.Shape
Dim I As Long, NumExistingGeoSec As Long
Dim strFormulaNoFill As String

Set shp = ActivePage.Shapes(1)
For I = 0 To visSectionLastComponent
strFormulaNoFill = shp.CellsSRC(visSectionFirstComponent + I, 0,
0).Formula
If strFormulaNoFill = "FALSE" Or strFormulaNoFill = "TRUE" Then
NumExistingGeoSec = I + 1
Else
Exit For
End If
Next
Debug.Print "Number of Geometry Section is " & NumExistingGeoSec
End Sub

--
JuneTheSecond

JuneTheSecond

unread,
Jul 9, 2006, 5:57:01 PM7/9/06
to
Or more completely,

Sub test()
Dim shp As Visio.Shape
Dim myCell As Visio.Cell

Dim I As Long, NumExistingGeoSec As Long
Dim strFormulaNoFill As String

Set shp = ActivePage.Shapes(1)
For I = 0 To visSectionLastComponent
Set myCell = shp.CellsSRC(visSectionFirstComponent + I, 0, 0)
strFormulaNoFill = myCell.Formula
If myCell.Name Like "*NoFill" Then

If strFormulaNoFill = "FALSE" Or strFormulaNoFill = "TRUE" Then
NumExistingGeoSec = I + 1
Else
Exit For
End If
End If
Next
Debug.Print "Number of Geometry Section is " & NumExistingGeoSec
End Sub

--
JuneTheSecond

JuneTheSecond

unread,
Jul 9, 2006, 8:01:01 PM7/9/06
to
Or,

If myCell.Name Like "*NoFill" Then
should be replaced by
If myCell.Name Like "Geometry*" Then

--
JuneTheSecond

Mark Nelson [MS]

unread,
Jul 9, 2006, 11:43:39 PM7/9/06
to
Assuming you want to do this programmatically, you can get the number of the
geometry section just by doing Section.Index - visSectionFirstComponent + 1.

If you want to do this from the Shapesheet directly, I don't know of a
solution.

--
Mark Nelson
Office Graphics - Visio
Microsoft Corporation

This posting is provided "AS IS" with no warranties, and confers no rights.

"JuneTheSecond" <JuneTh...@discussions.microsoft.com> wrote in message
news:B3309EB4-8781-466E...@microsoft.com...

Udo Weik

unread,
Jul 10, 2006, 6:10:11 AM7/10/06
to
Hello JuneTheSecond and Mark,

my aim is to determine the number in the Shapesheet directly,
but I can use your hints using automation for another purpose,
too.

Thanks for your efforts.
Udo

wr

unread,
Jul 13, 2006, 10:15:10 AM7/13/06
to
Hi Udo,

It depends what you want to do with your geometry cells.
I can imagine that you for instance increase the width in geometry1 and then
simultaneously want to increase the width in geometry2 but how to tell the
shape?

In the following scenario I change the width of the Geometry1.X1 cell and
then activate a Custom Property cell with the value.
And vice versa if you have a change in Geometry2.X1 you can set a value in
another Custom Property cell.

1. add two custom property cells one called Prop.Geo1 and one called
Prop.Geo2
2. create a User Defined cell and place the following formula in the Value
cell
=IF(Geometry2.X1=Width*0.2727,SETF(GetRef(Prop.Geo1),2),SETF(GetRef(Prop.Geo1),0))

So based on the width value (here 0.2727) you set the value of Geo2 to '2'
but when this value changes the custom property goes to '0'

If it is really handy? Don't know.
But you have a way to capture the geometry row number in the shapesheet

René


"Udo Weik" <WeikE...@aol.com> wrote in message
news:%231fm9ce...@TK2MSFTNGP04.phx.gbl...

David Parker

unread,
Oct 3, 2006, 9:14:43 AM10/3/06
to
Actually you can:

Create a User-defined cell, say GeometryCount, and enter the following
formula:
=ABS(NOT(ISERR(INT(INDEX(0,"Geometry1.NoFill")))))+ABS(NOT(ISERR(INT(INDEX(0,"Geometry2.NoFill")))))+ABS(NOT(ISERR(INT(INDEX(0,"Geometry3.NoFill")))))+ABS(NOT(ISERR(INT(INDEX(0,"Geometry4.NoFill")))))+ABS(NOT(ISERR(INT(INDEX(0,"Geometry5.NoFill")))))+ABS(NOT(ISERR(INT(INDEX(0,"Geometry6.NoFill")))))+ABS(NOT(ISERR(INT(INDEX(0,"Geometry7.NoFill")))))+ABS(NOT(ISERR(INT(INDEX(0,"Geometry8.NoFill")))))+ABS(NOT(ISERR(INT(INDEX(0,"Geometry9.NoFill")))))+ABS(NOT(ISERR(INT(INDEX(0,"Geometry10.NoFill")))))

Since there can be 255(?) Geometry Sections, you an extend the above
formula, if you need to check for more than 10 sections.

Also, if you need it to evaluate periodically the add DEPENDSON(NOW())+
after the = sign.

"Mark Nelson [MS]" <mar...@online.microsoft.com> wrote in message
news:uOlHJM9o...@TK2MSFTNGP04.phx.gbl...

Reply all
Reply to author
Forward
0 new messages