下列代码提供了 Enumerate_All_Groups 方法的一个示例:
Public Function GetAllGroupList(objPic As CFixPicture, ByRef colDIList As Collection) As Boolean
Dim colPIC As CFixObjectCollection
Dim colList As CFixObjectCollection
Dim objDI As Object
If TypeName(objPic) = "Nothing" Or objPic.Category <> "Pictures" Then
GetAllGroupList = False
GoTo CLEAN_UP
End If
Do While colDIList.Count > 0
colDIList.Remove (1)
Loop
Set colPIC = objPic.ContainedObjects
Call PlugandSolve.GeometryHelperObj.Enumerate_All_Groups(colPIC, colList)
If colList.Count <= 0 Then
GetAllGroupList = True
GoTo CLEAN_UP
End If
For Each objDI In colList
colDIList.Add objDI
Next objDI
GetAllGroupList = True
CLEAN_UP:
On Error Resume Next
Set colList = Nothing
Set colPIC = Nothing
Set objDI = Nothing
End Function