如何判断一个块在模型空间还是在图纸空间?
如何判断一个块在模型空间还是在图纸空间? 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
页:
[1]