Message 1 of 5
How To Count Circle by Specific Diamter in Drawing
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm trying to count all circle diameter 32.5 to double check.
Below is my minimum code, or if you have better code that would be great.
Option Explicit
Sub CountCircles()
Dim oDoc As DrawingDocument
Dim oDrawView As DrawingView
Set oDoc = ThisApplication.ActiveDocument
Set oDrawView = oDoc.ActiveSheet.DrawingViews.item(1)
Dim oCurve As DrawingCurve
Dim count As Integer
For Each oCurve In oDrawView.DrawingCurves
If oCurve.CurveType = kCircleCurve Then
'HOW TO CALCULATE CIRCLE's DIAMETER
'If Abs(oSegment.endPoint.x - oSegment.startPoint.x) * 2 = 32.5 Then
'count = count + 1
'End If
End If
Next
MsgBox count
End Sub