- Sub BlkOwnObj()
- Dim Ent As AcadEntity
- Dim Pnt As Variant
- ThisDrawing.Utility.GetEntity Ent, Pnt
- Dim OwnId As Long
- OwnId = Ent.OwnerID
- Dim Obj As AcadObject
- Set Obj = ThisDrawing.ObjectIdToObject(OwnId)
- If TypeName(Obj) = "IAcadModelSpace" Then
- MsgBox "选定对象是在模型空间中。", , "明经通道VBA示例"
- ElseIf TypeName(Obj) = "IAcadPaperSpace" Then
- MsgBox "选定对象是在图纸空间中。", , "明经通道VBA示例"
- End If
- End Sub
|