编辑ZWCAD实体--镜像对象
来源:互联网 发布:bp神经网络算法 剃度 编辑:程序博客网 时间:2024/05/18 03:06
Imports ZwSoft.ZwCAD.Runtime
Imports ZwSoft.ZwCAD.ApplicationServices
Imports ZwSoft.ZwCAD.DatabaseServices
Imports ZwSoft.ZwCAD.EditorInput
Imports ZwSoft.ZwCAD.Geometry
Public Class ZwcadApps
<CommandMethod("MirrorObject")> _
Public Sub MirrorObject()
Dim ZcDoc As Document = Application.DocumentManager.MdiActiveDocument
Dim ZcDB As Database = ZcDoc.Database
Dim ZcEd As Editor = ZcDoc.Editor
Dim peo As New PromptEntityOptions(vbLf & "Select object:")
Dim per As PromptEntityResult = ZcEd.GetEntity(peo)
If per.Status <> PromptStatus.OK Then
Return
End If
Dim pro1 As New PromptPointOptions(vbLf & "Input first point:")
Dim proR1 As PromptPointResult = ZcEd.GetPoint(pro1)
If proR1.Status <> PromptStatus.OK Then
Return
End If
Dim Pt1 As Point3d = proR1.Value
Dim pro2 As New PromptPointOptions(vbLf & "Input second point:")
Dim proR2 As PromptPointResult = ZcEd.GetPoint(pro2)
If proR2.Status <> PromptStatus.OK Then
Return
End If
Dim Pt2 As Point3d = proR2.Value
Dim MLine As Line3d = New Line3d(Pt1, Pt2)
Dim Mt As Matrix3d = Matrix3d.Mirroring(MLine)
Using ZcTran As Transaction = ZcDB.TransactionManager.StartTransaction()
Dim Ent As Entity = ZcTran.GetObject(per.ObjectId, OpenMode.ForWrite)
Ent.TransformBy(Mt)
ZcTran.Commit()
End Using
End Sub
End Class
Imports ZwSoft.ZwCAD.ApplicationServices
Imports ZwSoft.ZwCAD.DatabaseServices
Imports ZwSoft.ZwCAD.EditorInput
Imports ZwSoft.ZwCAD.Geometry
Public Class ZwcadApps
<CommandMethod("MirrorObject")> _
Public Sub MirrorObject()
Dim ZcDoc As Document = Application.DocumentManager.MdiActiveDocument
Dim ZcDB As Database = ZcDoc.Database
Dim ZcEd As Editor = ZcDoc.Editor
Dim peo As New PromptEntityOptions(vbLf & "Select object:")
Dim per As PromptEntityResult = ZcEd.GetEntity(peo)
If per.Status <> PromptStatus.OK Then
Return
End If
Dim pro1 As New PromptPointOptions(vbLf & "Input first point:")
Dim proR1 As PromptPointResult = ZcEd.GetPoint(pro1)
If proR1.Status <> PromptStatus.OK Then
Return
End If
Dim Pt1 As Point3d = proR1.Value
Dim pro2 As New PromptPointOptions(vbLf & "Input second point:")
Dim proR2 As PromptPointResult = ZcEd.GetPoint(pro2)
If proR2.Status <> PromptStatus.OK Then
Return
End If
Dim Pt2 As Point3d = proR2.Value
Dim MLine As Line3d = New Line3d(Pt1, Pt2)
Dim Mt As Matrix3d = Matrix3d.Mirroring(MLine)
Using ZcTran As Transaction = ZcDB.TransactionManager.StartTransaction()
Dim Ent As Entity = ZcTran.GetObject(per.ObjectId, OpenMode.ForWrite)
Ent.TransformBy(Mt)
ZcTran.Commit()
End Using
End Sub
End Class
- 编辑ZWCAD实体--镜像对象
- 编辑ZWCAD实体--复制对象
- 编辑ZWCAD实体--旋转对象
- 编辑ZWCAD实体--缩放对象
- 编辑ZWCAD实体--移动对象
- 编辑ZWCAD实体--偏移对象
- 创建ZWCAD实体--对齐标注
- 创建ZWCAD实体--弧长标注
- 03-04 创建和编辑AutoCAD实体(四) 编辑二维命名对象 (1)
- 03-04 创建和编辑AutoCAD实体(四) 编辑二维命名对象 (2)
- 03-04 创建和编辑AutoCAD实体(四) 编辑二维命名对象 (3)
- 03-04 创建和编辑AutoCAD实体(四) 编辑二维命名对象 (4)
- 03-04 创建和编辑AutoCAD实体(四) 编辑二维命名对象 (5)
- 03-04 创建和编辑AutoCAD实体(四) 编辑二维命名对象 (6)
- 03-04 创建和编辑AutoCAD实体(四) 编辑二维命名对象 (7)
- 03-04 创建和编辑AutoCAD实体(四) 编辑二维命名对象 (8)
- 03-04 创建和编辑AutoCAD实体(四) 编辑二维命名对象 (9)
- 03-01 创建和编辑AutoCAD实体(一) 打开和关闭对象
- 移动为先:2013年美国最佳5大科技创业公司
- WordPress调用admin的Gravatar头像作为Favicon图标
- 介绍2个工业控件
- Windows无鼠标操作方法
- 学习总结
- 编辑ZWCAD实体--镜像对象
- JSF:DataModel 中如何用单选
- c++简单图形问题
- 帮助你突破脱壳瓶颈的帖
- 日期格式转换 timer .9图片 反编译 proguard代码混淆
- 给WordPress加上评论之星–VIP等级功能
- Google File System笔记
- hihi
- 猜数列游戏( Fibonacci、Luccas、Pell、Triangular)c++实现