判断一个外部参照是overlay还是attachment。
来源:互联网 发布:adobe软件打不开 编辑:程序博客网 时间:2024/05/01 12:23
Imports ZwSoft.ZwCAD.Runtime
Imports ZwSoft.ZwCAD.ApplicationServices
Imports ZwSoft.ZwCAD.DatabaseServices
Imports ZwSoft.ZwCAD.EditorInput
Public Class ZwcadApp
<CommandMethod("blockORxref")> _
Public Sub blockORxref()
Dim ZcDoc As Document = Application.DocumentManager.MdiActiveDocument
Dim ZcDB As Database = ZcDoc.Database
Dim ZcEd As Editor = ZcDoc.Editor
Using ZcTran As Transaction = ZcDB.TransactionManager.StartTransaction()
Dim ZcBTR As BlockTableRecord = Nothing
Dim objId As ObjectId = ObjectId.Null
Do
Dim peo As New PromptEntityOptions(vbLf & "Select a block reference or an external reference:")
peo.SetRejectMessage(vbLf & "Must be a block reference or an external reference.")
peo.AddAllowedClass(GetType(BlockReference), True)
Dim per As PromptEntityResult = ZcEd.GetEntity(peo)
If per.Status <> PromptStatus.OK Then
Return
End If
Dim br As BlockReference = DirectCast(ZcTran.GetObject(per.ObjectId, OpenMode.ForRead), BlockReference)
ZcBTR = DirectCast(ZcTran.GetObject(br.BlockTableRecord, OpenMode.ForRead), BlockTableRecord)
If ZcBTR.IsFromExternalReferenceThen
Loop While ZcBTR Is Nothing '(or) Loop Until Not ZcBTR Is Nothing
If objId <> ObjectId.Null Then
ZcEd.WriteMessage(vbLf & "The object is an external reference.")
Else
ZcEd.WriteMessage(vbLf & "The object is a block reference.")
End If
ZcTran.Commit()
End Using
End Sub
End Class
Imports ZwSoft.ZwCAD.ApplicationServices
Imports ZwSoft.ZwCAD.DatabaseServices
Imports ZwSoft.ZwCAD.EditorInput
Public Class ZwcadApp
<CommandMethod("blockORxref")> _
Public Sub blockORxref()
Dim ZcDoc As Document = Application.DocumentManager.MdiActiveDocument
Dim ZcDB As Database = ZcDoc.Database
Dim ZcEd As Editor = ZcDoc.Editor
Using ZcTran As Transaction = ZcDB.TransactionManager.StartTransaction()
Dim ZcBTR As BlockTableRecord = Nothing
Dim objId As ObjectId = ObjectId.Null
Do
Dim peo As New PromptEntityOptions(vbLf & "Select a block reference or an external reference:")
peo.SetRejectMessage(vbLf & "Must be a block reference or an external reference.")
peo.AddAllowedClass(GetType(BlockReference), True)
Dim per As PromptEntityResult = ZcEd.GetEntity(peo)
If per.Status <> PromptStatus.OK Then
Return
End If
Dim br As BlockReference = DirectCast(ZcTran.GetObject(per.ObjectId, OpenMode.ForRead), BlockReference)
ZcBTR = DirectCast(ZcTran.GetObject(br.BlockTableRecord, OpenMode.ForRead), BlockTableRecord)
If ZcBTR.IsFromExternalReferenceThen
objId = br.BlockTableRecord
if ZcBTR.IsFromOverlayReferencethen
ZcEd.WriteMessage(vbLf & "The object is an overlay reference.")
else
ZcEd.WriteMessage(vbLf & "The object is an attacment reference.")
end if
Loop While ZcBTR Is Nothing '(or) Loop Until Not ZcBTR Is Nothing
If objId <> ObjectId.Null Then
ZcEd.WriteMessage(vbLf & "The object is an external reference.")
Else
ZcEd.WriteMessage(vbLf & "The object is a block reference.")
End If
ZcTran.Commit()
End Using
End Sub
End Class
0 0
- 判断一个外部参照是overlay还是attachment。
- 判断所选的对象是块参照还是外部参照
- Difference between attachment & overlay
- 判断点是在多边形内部还是外部
- 判断一个自然数是质数还是偶数
- 判断一个窗口是显示还是隐藏
- 判断一个数是偶数还是奇数
- 判断一个路径是文件夹还是文件
- 判断一个数是奇数还是偶数
- 判断一个工程是java还是web
- 判断一个文件夹是远程还是本地
- 判断一个数是偶数还是奇数
- 判断一个文件是一个文件夹还是一个文件
- 如何判断一个图是稀疏的还是稠密的
- ASP中如何判断一个FORM是POST还是GET??
- 如何判断一个网页是刷新还是关闭的方法。
- 如何判断一个网页是刷新还是关闭的方法。
- 判断一个字符是双字节还是单字节
- MySQL基础知识---------CHAR和VARCHAR类型
- 只愿得一人心白首不分离
- 甚瞥充艷縇聬蔮絔糮,衛疆螘懊粫遭!
- C语言中修改字符串的一个字符的值
- 虚拟机(Vmware)怎么进入BIOS
- 判断一个外部参照是overlay还是attachment。
- 简明的VIM攻略
- 路由器怎么与路由器连接
- .net js 键盘事件
- spring三种实例化bean的方式
- MAT内存泄露分析
- HTMLParser学习笔记2
- 安装Matlab2010b出现一堆warning的问题
- 怀念老金