Hi,
I am using the function listed below for mirroring a collection of entities. I don't want the DBText entities and the Dimension texts to be mirrored. But they are always mirrored, even after setting the system variable 'MirrorText' to 0. Please somebody let me know what I am doing wrong.
I am using AutoCAD 2007 and Visual Studio 2005.
Public Shared Sub MirrorVertically(ByVal ObjIds As ArrayList, ByVal MirrorPt As Point3d, ByVal Delete As Boolean)
Dim Doc As Document = Acad.DocumentManager.MdiActiveDocument
Dim DB As Database = Doc.Database
Dim ED As Editor = Doc.Editor
Dim TR As Transaction = Doc.TransactionManager.StartTransaction()
Dim BT As BlockTable = CType(TR.GetObject(DB.BlockTableId, OpenMode.ForRead), BlockTable)
Dim BTR As BlockTableRecord
Try
BTR = CType(TR.GetObject(BT(BlockTableRecord.ModelSpace), OpenMode.ForWrite), BlockTableRecord)
For Each objId As ObjectId In ObjIds
Dim obj As Object = TR.GetObject(objId, OpenMode.ForWrite)
Dim ent As Entity = CType(obj, Entity)
Dim MirrorLine As New Line3d(MirrorPt, New Point3d(MirrorPt.X, MirrorPt.Y + 10, MirrorPt.Z))
Dim MirrorMatrix As Matrix3d = Matrix3d.Mirroring(MirrorLine)
If Delete Then
ent.TransformBy(MirrorMatrix)
Else
Dim ent1 As Entity = ent.Clone
ent1.TransformBy(MirrorMatrix)
BTR.AppendEntity(ent1)
TR.AddNewlyCreatedDBObject(ent1, True)
End If
Next
TR.Commit()
Catch ex As Autodesk.AutoCAD.Runtime.Exception
MsgBox(ex.Message)
Finally
TR.Dispose()
End Try
End Sub
Thanks,
Bala