haohaohapp发表于2004-7-8 14:29:00回复:(haohaohapp)如何遍历图形中的group? 如何遍历图形中的group,并且怎么知道此group是在模型空间还是在布局空间? 用- Sub GroupAddress()
- Dim Gop As AcadGroup
- Dim Ent As Object
- For Each Gop In ThisDrawing.Groups
- Set Ent = ThisDrawing.ObjectIdToObject(Gop(0).OwnerID)
- If Ent.ObjectName = "AcDbBlockTableRecord" Then
- If Ent.Name = "*Model_Space" Then
- MsgBox Gop.Name & "位于模型空间中.", , "明经通道VBA示例"
- Else
- MsgBox Gop.Name & "位于图纸空间中.", , "明经通道VBA示例"
- End If
- End If
- Next
- End Sub
|