Mirror Objects Along a Plane
From AutoCAD ActiveX
With the Mirror3D method, you can mirror objects along a specified mirroring plane specified by three points.
For more information on mirroring objects in 3D, see “Mirror Objects” in the User's Guide.
This example creates a box in model space. It then mirrors the box about a plane and colors the mirrored box red.
Sub Ch8_MirrorABox3D()
' Create the box object
Dim boxObj As Acad3DSolid
Dim length As Double
Dim width As Double
Dim height As Double
Dim center(0 To 2) As Double
center(0) = 5#: center(1) = 5#: center(2) = 0
length = 5#: width = 7: height = 10#
' Create the box (3DSolid) object in model spaceSet boxObj = ThisDrawing.ModelSpace. _AddBox(center, length, width, height)' Define the mirroring plane with three pointsDim mirrorPt1(0 To 2) As DoubleDim mirrorPt2(0 To 2) As DoubleDim mirrorPt3(0 To 2) As DoublemirrorPt1(0) = 1.25: mirrorPt1(1) = 0: mirrorPt1(2) = 0mirrorPt2(0) = 1.25: mirrorPt2(1) = 2: mirrorPt2(2) = 0mirrorPt3(0) = 1.25: mirrorPt3(1) = 2: mirrorPt3(2) = 2' Mirror the boxDim mirrorBoxObj As Acad3DSolidSet mirrorBoxObj = boxObj.Mirror3D _(mirrorPt1, mirrorPt2, mirrorPt3)mirrorBoxObj.Color = acRedZoomAllEnd Sub