 - Sub GetGroupSpace()
- Dim g As AcadGroup
- Dim e As AcadEntity
- Dim L As AcadLayout
- Dim s As AcadObject
- Dim t As String
- For Each g In ThisDrawing.Groups
- Set e = g(0)
- Set s = ThisDrawing.ObjectIdToObject(e.OwnerID)
- If s.Name = "*Model_Space" Then
- t = t & "组合 " & g.Name & " 所在的空间为:模型空间" & vbCrLf
- Else
- Set L = s.Layout
- t = t & "组合 " & g.Name & " 所在的空间为:图纸空间的 " & L.Name & vbCrLf
- End If
- Next
- If t <> "" Then MsgBox t, , "明经通道VBA示例"
- End Sub
|