I am trying to count the grouped objects in a Visio Display by a certain width.
Asked
Active
Viewed 358 times
1 Answers
0
Option Explicit
Public Sub LocationTable()
Dim vsoShapes As Visio.Shapes
Dim vsoShape As Visio.Shape
Dim i As Integer
Dim count As Integer
Dim shpNo As Integer
Dim shapeCount As Integer
Dim shpObj As Visio.Shape, celObj As Visio.Cell
Dim localcent As Single
Dim count2 As Integer
Set vsoShapes = Application.ActiveWindow.Page.Shapes
For shpNo = 1 To Visio.ActivePage.Shapes.count
'For Each vsoShape In vsoShapes
'shapeCount = vsoShape.Shapes.count
'For shapeCount = 1 To vsoShape.Shapes.count
Set shpObj = Visio.ActivePage.Shapes(shpNo)
If Not shpObj.OneD Then
If visTypeGroup = 2 Then
Set celObj = shpObj.Cells("width")
localcent = celObj.Result("meters")
If localcent = 0.74 Then
count = count + 1
ElseIf localcent = 0.9 Then
count2 = count2 + 1
End If
End If
'Next shapeCount
End If
Next shpNo
End Sub
-
I have many types of grouped objects on a page , I need to count how many occurrences are for one type and how many for the other. To differentiate between the two types , I have two different widths (0.74 and 0.9). Also I want the code to exclude other type of shapes. – Adrian Gavrila Jun 19 '15 at 11:48