neteasy 发表于 2003-9-16 21:26:00

如何判断一个块在模型空间还是在图纸空间?

如何判断一个块在模型空间还是在图纸空间?

mccad 发表于 2003-9-17 22:34:00

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]
查看完整版本: 如何判断一个块在模型空间还是在图纸空间?