I'll toss this in for the useless utilities section. Think mirrtext 0 only for blocks and retroactively.
Option Explicit
Public Sub UnMirror()
On Error GoTo ErrorControl
Dim strSet As String
Dim intGroup() As Integer
Dim varGroup() As Variant
Dim varAtts As Variant
Dim objSelSet As AcadSelectionSet
Dim objSelSets As AcadSelectionSets
Dim strBlkName As String
Dim PI As Double
Dim strSetName As String
Dim objBlkRef As AcadBlockReference
Dim objEnt As AcadEntity
Dim intCnt As Integer
PI = (Atn(1) * 4)
Set objSelSets = ThisDrawing.SelectionSets
strSetName = 1
ReDim intGroup(0)
ReDim varGroup(0)
intGroup(0) = 0
varGroup(0) = "insert"
BlockName:
strBlkName = ThisDrawing.Utility.GetString(True, "Block to unmirror [All, Select, <default block name goes here>]:")
If strBlkName = "" Or Left(strBlkName, 1) = " " Then
ReDim Preserve intGroup(0 To 1)
ReDim Preserve varGroup(0 To 1)
intGroup(1) = 2
varGroup(1) = "defaultblockname"
ElseIf StrComp(strBlkName, "a", vbTextCompare) = 0 Or StrComp(strBlkName, "all", vbTextCompare) = 0 Then
ReDim Preserve intGroup(0 To 1)
ReDim Preserve varGroup(0 To 1)
intGroup(1) = 2
varGroup(1) = "*"
ElseIf StrComp(strBlkName, "s", vbTextCompare) = 0 Or StrComp(strBlkName, "sel", vbTextCompare) = 0 Or StrComp(strBlkName, "select", vbTextCompare) = 0 Then
KillSet strSetName
Set objSelSet = objSelSets.Add(strSetName)
objSelSet.SelectOnScreen intGroup, varGroup
ReDim intGroup(0 To (objSelSet.Count) + 1)
ReDim varGroup(0 To (objSelSet.Count) + 1)
intGroup(0) = -4
varGroup(0) = "<or"
intGroup((objSelSet.Count) + 1) = -4
varGroup((objSelSet.Count) + 1) = "or>"
For intCnt = 1 To objSelSet.Count
If TypeOf objSelSet.Item(intCnt - 1) Is AcadBlockReference Then
Set objBlkRef = objSelSet.Item(intCnt - 1)
intGroup(intCnt) = 2
varGroup(intCnt) = objBlkRef.Name
End If
Next intCnt
Else
ReDim Preserve intGroup(0 To 1)
ReDim Preserve varGroup(0 To 1)
intGroup(1) = 2
varGroup(1) = strBlkName
End If
KillSet strSetName
Set objSelSet = objSelSets.Add(strSetName)
objSelSet.Select acSelectionSetAll, , , intGroup, varGroup
If objSelSet.Count > 0 Then
GoTo FollowTheRabbit
Else
ThisDrawing.Utility.Prompt vbCrLf & "**No Blocks Selected**" & vbCrLf
GoTo ExitHere
End If
FollowTheRabbit:
Dim dblMSpc As Double
Dim dblPSpc As Double
Dim dblRotRad As Double
Dim dblRotDeg As Double
Dim dblScale(0 To 2) As Double
Dim dblInsPt(0 To 2) As Double
Dim objNewRef As AcadBlockReference
Dim varOldAtt As Variant
Dim varNewAtt As Variant
dblMSpc = ThisDrawing.ModelSpace.ObjectID
dblPSpc = ThisDrawing.PaperSpace.ObjectID
For Each objEnt In objSelSet
If TypeOf objEnt Is AcadBlockReference Then
Set objBlkRef = objEnt
If objBlkRef.XScaleFactor < 0 Then
dblInsPt(0) = objBlkRef.InsertionPoint(0)
dblInsPt(1) = objBlkRef.InsertionPoint(1)
dblInsPt(2) = objBlkRef.InsertionPoint(2)
dblScale(0) = objBlkRef.XScaleFactor * -1
dblScale(1) = objBlkRef.YScaleFactor
dblScale(2) = objBlkRef.ZScaleFactor
dblRotRad = objBlkRef.Rotation
dblRotDeg = (dblRotRad * 180) / PI
If dblRotDeg > 120 And dblRotDeg < 330 Then
dblRotDeg = dblRotDeg + 180
If dblRotDeg > 360 Then
dblRotDeg = dblRotDeg - 360
End If
dblRotRad = (PI * dblRotDeg) / 180
End If
If objBlkRef.OwnerID = dblMSpc Then
Set objNewRef = ThisDrawing.ModelSpace.InsertBlock(dblInsPt, objBlkRef.Name, dblScale(0), dblScale(1), dblScale(2), dblRotRad)
If objNewRef.HasAttributes Then
varOldAtt = objBlkRef.GetAttributes
varNewAtt = objNewRef.GetAttributes
For intCnt = 0 To UBound(varOldAtt)
varNewAtt(intCnt).TextString = varOldAtt(intCnt).TextString
Next intCnt
End If
objNewRef.Layer = objBlkRef.Layer
objNewRef.Linetype = objBlkRef.Linetype
objNewRef.LinetypeScale = objBlkRef.LinetypeScale
objNewRef.Lineweight = objBlkRef.Lineweight
If Left(ThisDrawing.GetVariable("acadver"), 2) = "16" Then
objNewRef.TrueColor = objBlkRef.TrueColor
Else
objNewRef.color = objBlkRef.color
End If
objNewRef.Visible = objBlkRef.Visible
objBlkRef.Delete
objNewRef.Update
Else
Set objNewRef = ThisDrawing.PaperSpace.InsertBlock(dblInsPt, objBlkRef.Name, dblScale(0), dblScale(1), dblScale(2), dblRotRad)
If objNewRef.HasAttributes Then
varOldAtt = objBlkRef.GetAttributes
varNewAtt = objNewRef.GetAttributes
For intCnt = 0 To UBound(varOldAtt)
varNewAtt(intCnt).TextString = varOldAtt(intCnt).TextString
Next intCnt
End If
objNewRef.Layer = objBlkRef.Layer
objNewRef.Linetype = objBlkRef.Linetype
objNewRef.LinetypeScale = objBlkRef.LinetypeScale
objNewRef.Lineweight = objBlkRef.Lineweight
If Left(ThisDrawing.GetVariable("acadver"), 2) = "16" Then
objNewRef.TrueColor = objBlkRef.TrueColor
Else
objNewRef.color = objBlkRef.color
End If
objNewRef.Visible = objBlkRef.Visible
objBlkRef.Delete
objNewRef.Update
End If
End If
End If
Next objEnt
ExitHere:
Exit Sub
ErrorControl:
Select Case Err.Number
Case Else
MsgBox "''" & Err.Description & "'' error has occured in UnMirror" & vbCr & _
"All Blocks May NOT have updated correctly" & vbCrLf & _
"Please report the error to Eric Bussey", vbCritical, "Error in UnMirror"
GoTo ExitHere
End Select
End Sub
Function KillSet(strSet As String)
Dim objSelSet As AcadSelectionSet
Dim objSelSets As AcadSelectionSets
Set objSelSets = ThisDrawing.SelectionSets
For Each objSelSet In objSelSets
If objSelSet.Name = strSet Then
ThisDrawing.SelectionSets.Item(strSet).Delete
Exit For
End If
Next
End Function
Threw it together quickly for a specific need, then went back and added additional functionality. Was going to go back and take a long look at it later but never did. It works though.